makevoid / guard-concat

This little guard plugin allows you to concatenate js/css (or other) files in one.
Other
12 stars 6 forks source link

Doesn't work out of the box #1

Closed tomasdev closed 11 years ago

tomasdev commented 11 years ago
$ guard list
/Users/tom/Sites/github/Guardfile:7:in `instance_eval_guardfile': compile error (SyntaxError)
/Users/tom/Sites/github/Guardfile:7: syntax error, unexpected ':', expecting $end
guard :concat, type: "js", files: %w(a b), input_d...
                    ^
    from /Library/Ruby/Gems/1.8/gems/guard-1.7.0/lib/guard/dsl.rb:74:in `evaluate_guardfile'
    from /Library/Ruby/Gems/1.8/gems/guard-1.7.0/lib/guard/dsl_describer.rb:33:in `evaluate_guardfile'
    from /Library/Ruby/Gems/1.8/gems/guard-1.7.0/lib/guard/dsl_describer.rb:42:in `list'
    from /Library/Ruby/Gems/1.8/gems/guard-1.7.0/lib/guard/cli.rb:127:in `list'
    from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:in `__send__'
    from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
    from /Library/Ruby/Gems/1.8/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from /Library/Ruby/Gems/1.8/gems/guard-1.7.0/bin/guard:6
    from /usr/bin/guard:23:in `load'
    from /usr/bin/guard:23
tomasdev commented 11 years ago
guard :concat,
    :type => "js",
    :files => %w(),
    :input_dir => "scripts",
    :output => "js/app"

This syntax does compile but doesn't work either.

makevoid commented 11 years ago

You must specify the file names like:

:files => %w(jquery underscore)

On 01/apr/2013, at 07:23, Tomas notifications@github.com wrote:

guard :concat, :type => "js", :files => %w(), :input_dir => "scripts", :output => "js/app" This syntax does compile but doesn't work either.

\ Reply to this email directly or view it on GitHub.

tomasdev commented 11 years ago

@makevoid I've tried that, didn't work either. Ruby say's there's a parsing error BEFORE :files, just right after type:

makevoid commented 11 years ago

I tested today with ruby 1.8 and it works, this is the full syntax (translated from the new hash to 1.8 one):

guard :concat, :type => "js", :files => %w(b a), :input_dir => "public/js", :output => "public/js/all"

this example is taken from the spec folder, I created a ruby1.8 branch where the test runs, clone it and see run.rb

https://github.com/makevoid/guard-concat/tree/ruby1.8/spec

If you have an error let me know (posting the stacktrace please)

also consider upgrading to 1.9 - 2.0 ;)

tomasdev commented 11 years ago

Thanks, you were right, it was a ruby 1.8 bug. But the point is nor 1.9 nor 2.0 are available for Lion (not ML)

makevoid commented 11 years ago

to change ruby version you can always download ruby from ruby-lang.org and compile it from source (./configure && make && sudo make install) or use a manager like rvm or rbenv

anyway the gem should work correctly even with 1.8