Skip to content

Compile doesn't work #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rusikf opened this issue Apr 7, 2015 · 5 comments
Open

Compile doesn't work #20

rusikf opened this issue Apr 7, 2015 · 5 comments

Comments

@rusikf
Copy link

rusikf commented Apr 7, 2015

Hello, @e2 and all ruby hackers!
On this small library i am trying to exec

$ bundle exec guard --debug
10:28:55 - DEBUG - Notiffany: gntp not available (Please add "gem 'ruby_gntp'" to your Gemfile and run your app with "bundle exec".).
10:28:55 - DEBUG - Notiffany: growl not available (Please add "gem 'growl'" to your Gemfile and run your app with "bundle exec".).
10:28:55 - DEBUG - Command execution: emacsclient --eval '1'
10:28:55 - DEBUG - Notiffany: emacs not available (Emacs client failed).
10:28:55 - DEBUG - Notiffany: tmux not available (:tmux notifier is only available inside a TMux session.).
10:28:55 - DEBUG - Notiffany: file not available (No :path option given).
10:28:56 - DEBUG - Notiffany is using TerminalNotifier to send notifications.
10:28:56 - DEBUG - Notiffany is using TerminalTitle to send notifications.
10:28:56 - DEBUG - Command execution: hash stty
10:28:56 - DEBUG - Guard starts all plugins
10:28:56 - DEBUG - Hook :start_begin executed for Guard::CoffeeScript
10:28:56 - DEBUG - Hook :start_end executed for Guard::CoffeeScript
10:28:56 - DEBUG - Hook :start_begin executed for Guard::CoffeeScript
10:28:56 - DEBUG - Hook :start_end executed for Guard::CoffeeScript
10:28:56 - DEBUG - Hook :start_begin executed for Guard::CoffeeScript
10:28:56 - DEBUG - Hook :start_end executed for Guard::CoffeeScript
10:28:56 - INFO - Guard is now watching at '/Users/ruslan/fun/websocket-rails-js'
10:28:56 - DEBUG - Start interactor
10:28:56 - DEBUG - Command execution: stty -g 2>/dev/null
[1] guard(main)> all
10:28:58 - DEBUG - Interactor was stopped or killed
10:28:58 - DEBUG - Command execution: stty  2>/dev/null
10:28:58 - INFO - Run all
10:28:58 - DEBUG - Hook :run_all_begin executed for Guard::CoffeeScript
10:28:58 - INFO - Compile
10:28:58 - INFO - 10:28:58 AM Successfully generated

10:28:58 - DEBUG - Hook :run_all_end executed for Guard::CoffeeScript
10:28:58 - DEBUG - Hook :run_all_begin executed for Guard::CoffeeScript
10:28:58 - INFO - Compile
10:28:58 - INFO - 10:28:58 AM Successfully generated

10:28:59 - DEBUG - Hook :run_all_end executed for Guard::CoffeeScript
10:28:59 - DEBUG - Hook :run_all_begin executed for Guard::CoffeeScript
10:28:59 - INFO - Compile
10:28:59 - INFO - 10:28:59 AM Successfully generated

10:28:59 - DEBUG - Hook :run_all_end executed for Guard::CoffeeScript
10:28:59 - DEBUG - Start interactor
10:28:59 - DEBUG - Command execution: stty -g 2>/dev/null

It notify, that everythins is compile but there is no js output here!
I read carefully Guard README, guard-coffescript readme, but i can't understand what is going wrong
Here is Guard file

guard 'coffeescript', :input => 'assets/javascripts', :output => 'src/'
guard 'coffeescript', :input => 'spec/javascripts/websocket_rails', :output => 'spec/javascripts/generated'
guard 'coffeescript', :input => 'spec/javascripts/helpers', :output => 'spec/javascripts/helpers'

I am trying also to create output dir like this

rm -rf src
mkdir src
chmod 700 src

But it also, doesn't compile anything

Note: To reproduce the bug, just clone the library above, and reproduce the obviouse steps, descriped above.

I will also repost this issue in google group 😄

With best regards, Ruslan.

@e2
Copy link

e2 commented Apr 7, 2015

Thanks! Especially for the repo to reproduce (you can't imagine how much it helps!).

I've updated the README with notes: https://github.com/guard/guard-coffeescript/blob/master/README.md#important-notes

I've also opened an issue for this (I might fix it someday, but can't promise): #21

@jdsimcoe
Copy link

@e2 I followed your instructions to compile but it is not putting my files in scripts/js but instead in scripts/js/coffee. Here is my Guardfile section on CoffeeScript:

# Compile Coffeescript
coffeescript_options = {
  input: 'scripts/coffee',
  output: 'scripts/js',
  patterns: [%r{scripts/(.*)\.coffee$}]
}

guard 'coffeescript', coffeescript_options do
  coffeescript_options[:patterns].each { |pattern| watch(pattern) }
end

Have any ideas why it adding the extra coffee folder inside scripts/js?

@e2
Copy link

e2 commented Aug 26, 2015

The handling was a bit complex and I never fully understood. I can't check
right now, but I think it's the regexp capture pattern that's capturing the
input folder name.

Script/(.*)\.coffee captures the coffee dir.

Try changing both patterns, e.g. to

script/coffee/(.*)/.coffee or something like that.

There's some magic, but it could also be a bug, so let me know if that
helps or not.
On Aug 26, 2015 4:50 PM, "Jonathan Simcoe" [email protected] wrote:

@e2 https://github.com/e2 I followed your instructions to compile but
it is not putting my files in scripts/js but instead in scripts/js/coffee.
Here is my Guardfile section on CoffeeScript:

Compile Coffeescript

coffeescript_options = {
input: 'scripts/coffee',
output: 'scripts/js',
patterns: [%r{scripts/(.*).coffee$}]
}

guard 'coffeescript', coffeescript_options do
watch(%r{scripts/(.*).coffee$})end

Have any ideas why it adding the extra coffee folder inside scripts/js?


Reply to this email directly or view it on GitHub
#20 (comment)
.

@jdsimcoe
Copy link

@e2 I actually solved it by adding the coffeescript_options section:

# Compile Coffeescript
coffeescript_options = {
  input: 'scripts',
  output: 'scripts/js',
  patterns: [%r{scripts/(.*)\.coffee$}]
}

guard 'coffeescript', coffeescript_options do
  coffeescript_options[:patterns].each { |pattern| watch(pattern) }
end

Hadn't checked the documentation thoroughly.

@e2
Copy link

e2 commented Aug 28, 2015

Don't worry about it - I'm just glad the documentation was enough to
solve this.

On Wed, Aug 26, 2015 at 03:01:20PM -0700, Jonathan Simcoe wrote:

@e2 I actually solved it by adding the coffeescript_options section:

# Compile Coffeescript
coffeescript_options = {
  input: 'scripts',
  output: 'scripts/js',
  patterns: [%r{scripts/(.*)\.coffee$}]
}

guard 'coffeescript', coffeescript_options do
  coffeescript_options[:patterns].each { |pattern| watch(pattern) }
end

Hadn't checked the documentation thoroughly.


Reply to this email directly or view it on GitHub:
#20 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants