Someone know how can I use this option in Rails 3.1? Now CoffeScript puts a function ".call(this)" on each file, but I want to remove this. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Kieran P
2011-May-27 10:54 UTC
Re: How can I use option --bare in Rails 3.1 for CoffeeScript?
+1 This seems to affect functions too, since Coffeescript makes functions into vairables, and those variables aren''t available outside of that scope. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Martin Wawrusch
2011-May-27 11:03 UTC
Re: Re: How can I use option --bare in Rails 3.1 for CoffeeScript?
you can use class window.MyClassName or window.functionName Check out this here: http://coffeescript-seattlejs.heroku.com/ No need to go bare. On Fri, May 27, 2011 at 3:54 AM, Kieran P <kieran776-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> +1 This seems to affect functions too, since Coffeescript makes functions > into vairables, and those variables aren''t available outside of that scope. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >- -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Martin Wawrusch
2011-May-27 11:26 UTC
Re: Re: How can I use option --bare in Rails 3.1 for CoffeeScript?
If you want to run it both on node and client you can do something like this (taken from http://stackoverflow.com/questions/4214731/coffeescript-global-variables): root = exports ? @ root.alertMe =(msg) -> alert msg alertMe ''hi there'' The following should actually work too for client side only (not battle tested here though) @.alertMe =(msg) -> alert msg It is a matter of personal style I guess On Fri, May 27, 2011 at 4:03 AM, Martin Wawrusch <martin-qs6+VQBngv1Wk0Htik3J/w@public.gmane.org>wrote:> you can use > > class window.MyClassName or > window.functionName > > Check out this here: http://coffeescript-seattlejs.heroku.com/ > > No need to go bare. > > > On Fri, May 27, 2011 at 3:54 AM, Kieran P <kieran776-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> +1 This seems to affect functions too, since Coffeescript makes functions >> into vairables, and those variables aren''t available outside of that scope. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > - > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.