Closed elado closed 14 years ago
The rake tasks currently assume that your main file is 'init.rb' and that your class is called 'Main' -- yeah, a bad assumption on our part. We'll be sure to make these customizable in the future versions.
OK Why does it need app_class ? For config you should probably use a YML file
(closed mistakenly, should be reopened)
Have a look at the new instructions. The rake task is really simple; there's no reason we should abstract them away with YAML files or a Tasks class (like Jeweller) ;)
http://github.com/sinefunc/sinatra-minify/blob/master/README.md
Thanks for the quick fix!
However, it still gives error:
rake minify --trace (in /Users/X/Y) * Invoke minify (first_time) * Execute minify Building... rake aborted! can't convert nil into String /Users/X/.rvm/gems/ruby-1.8.7-p249/gems/sinatra-minify-0.2.3/lib/sinatra/minify/config.rb:26:in `dirname'
So I figured out I should define app_file & config_file paths
set :app_file, File.dirname(FILE) set :config_file, File.join(File.dirname(FILE), "config/assets.yml")
Now rake task is working!
$ rake minify:build --trace (in /Users/X/Y) * Invoke minify:build (first_time) * Execute minify:build rake aborted! no such file to load -- init /Users/X/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /Users/X/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' ./vendor/sinatra-minify/lib/tasks.rake:4I tried to require all files from 'sinatra/minify/' and then got:
$ rake minify:build --trace (in /Users/X/Y) * Invoke minify:build (first_time) * Execute minify:build rake aborted! uninitialized constant Sinatra::Minify::Package::Forwardable /Users/X/.rvm/gems/ruby-1.8.7-p174/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing' /Users/X/.rvm/gems/ruby-1.8.7-p174/gems/sinatra-minify-0.2.2/lib/sinatra/minify/package.rb:45
added require 'forwardable' to package.rb and then got
uninitialized constant Main /Users/X/.rvm/gems/ruby-1.8.7-p174/gems/sinatra-minify-0.2.2/lib/sinatra/minify/package.rb:31:in `build'
Am I missing something?
Thanks