sinefunc / sinatra-minify

CSS/JS compression
MIT License
24 stars 1 forks source link

Tons of errors on rake task #2

Closed elado closed 14 years ago

elado commented 14 years ago

$ 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:inrequire' ./vendor/sinatra-minify/lib/tasks.rake:4

I 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

sinefunc commented 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.

elado commented 14 years ago

OK Why does it need app_class ? For config you should probably use a YML file

elado commented 14 years ago

(closed mistakenly, should be reopened)

sinefunc commented 14 years ago

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

elado commented 14 years ago

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!