guard-coffeescript 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.md +157 -0
- data/lib/guard/coffeescript/templates/Guardfile +1 -1
- data/lib/guard/coffeescript/version.rb +1 -1
- metadata +4 -4
- data/README.rdoc +0 -135
data/LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
# Guard::CoffeeScript
|
2
|
+
|
3
|
+
Guard::CoffeeScript compiles you CoffeeScripts automatically when files are modified. It is tested on Ruby 1.8.7 & 1.9.2.
|
4
|
+
|
5
|
+
## Install
|
6
|
+
|
7
|
+
Please be sure to have [Guard](http://github.com/guard/guard) installed before continue.
|
8
|
+
|
9
|
+
Install the gem:
|
10
|
+
|
11
|
+
gem install guard-coffeescript
|
12
|
+
|
13
|
+
Add it to your `Gemfile`, preferably inside the development group:
|
14
|
+
|
15
|
+
gem 'guard-coffeescript'
|
16
|
+
|
17
|
+
Add guard definition to your `Guardfile` by running this command:
|
18
|
+
|
19
|
+
guard init coffeescript
|
20
|
+
|
21
|
+
## JSON
|
22
|
+
|
23
|
+
The json library is also required but is not explicitly stated as a gem dependency. If you're on Ruby 1.8 you'll need
|
24
|
+
to install the json or json_pure gem. On Ruby 1.9, json is included in the standard library.
|
25
|
+
|
26
|
+
## CoffeeScript
|
27
|
+
|
28
|
+
Guard::CoffeeScript uses [Ruby CoffeeScript](http://github.com/josh/ruby-coffee-script/) to compile the CoffeeScripts,
|
29
|
+
that in turn uses [ExecJS](https://github.com/sstephenson/execjs) to pick the best runtime to evaluate the JavaScript.
|
30
|
+
|
31
|
+
### node.js
|
32
|
+
|
33
|
+
Please refer to the [CoffeeScript documentation](http://jashkenas.github.com/coffee-script/) for more information about
|
34
|
+
how to install the latest CoffeeScript version on node.js.
|
35
|
+
|
36
|
+
### JavaScript Core
|
37
|
+
|
38
|
+
JavaScript Core is only available on Mac OS X. To use JavaScript Core you don't have to install anything, because
|
39
|
+
JavaScript Core is packaged with Mac OS X.
|
40
|
+
|
41
|
+
### V8
|
42
|
+
|
43
|
+
To use CoffeeScript on V8, simple add `therubyracer` to your Gemfile. The Ruby Racer acts as a bridge between Ruby
|
44
|
+
and the V8 engine, that will be automatically installed by the Ruby Racer.
|
45
|
+
|
46
|
+
group :development do
|
47
|
+
gem 'therubyracer'
|
48
|
+
end
|
49
|
+
|
50
|
+
### Mozilla Rhino
|
51
|
+
|
52
|
+
If you're using JRuby, you can embed the Mozilla Rhino runtime by adding `therubyrhino` to your Gemfile:
|
53
|
+
|
54
|
+
group :development do
|
55
|
+
gem 'therubyrhino'
|
56
|
+
end
|
57
|
+
|
58
|
+
### Microsoft Windows Script Host
|
59
|
+
|
60
|
+
[Microsoft Windows Script Host](http://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx) is available on any Microsoft
|
61
|
+
Windows operating systems.
|
62
|
+
|
63
|
+
## Usage
|
64
|
+
|
65
|
+
Please read the [Guard usage documentation](http://github.com/guard/guard#readme).
|
66
|
+
|
67
|
+
## Guardfile
|
68
|
+
|
69
|
+
Guard::CoffeeScript can be adapted to all kind of projects. Please read the
|
70
|
+
[Guard documentation](http://github.com/guard/guard#readme) for more information about the Guardfile DSL.
|
71
|
+
|
72
|
+
### Standard ruby gems
|
73
|
+
|
74
|
+
guard 'coffeescript' do
|
75
|
+
watch(%r{coffeescripts/(.+\.coffee)})
|
76
|
+
end
|
77
|
+
|
78
|
+
### Rails app
|
79
|
+
|
80
|
+
guard 'coffeescript', :output => 'public/javascripts/compiled' do
|
81
|
+
watch(%r{app/coffeescripts/(.+\.coffee)})
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
## Options
|
86
|
+
|
87
|
+
There following options can be passed to Guard::CoffeeScript:
|
88
|
+
|
89
|
+
:output => 'javascripts' # Relative path to the output directory
|
90
|
+
:bare => true # Compile without the top-level function wrapper
|
91
|
+
:shallow => true # Do not create nested output directories
|
92
|
+
|
93
|
+
### Nested directories
|
94
|
+
|
95
|
+
The guard detects by default nested directories and creates these within the output directory. The detection is based on the match of the watch regular expression:
|
96
|
+
|
97
|
+
A file
|
98
|
+
|
99
|
+
/app/coffeescripts/ui/buttons/toggle_button.coffee
|
100
|
+
|
101
|
+
that has been detected by the watch
|
102
|
+
|
103
|
+
watch(%r{app/coffeescripts/(.+\.coffee)})
|
104
|
+
|
105
|
+
with an output directory of
|
106
|
+
|
107
|
+
:output => 'public/javascripts/compiled'
|
108
|
+
|
109
|
+
will be compiled to
|
110
|
+
|
111
|
+
public/javascripts/compiled/ui/buttons/toggle_button.js
|
112
|
+
|
113
|
+
|
114
|
+
Note the parenthesis around the `.+\.coffee`. This enables guard-coffeescript to place the full path that was matched inside the parenthesis into the proper output directory.
|
115
|
+
|
116
|
+
This behaviour can be switched off by passing the option `:shallow => true` to the guard, so that all JavaScripts will be compiled directly to the output directory.
|
117
|
+
|
118
|
+
## Development
|
119
|
+
|
120
|
+
- Source hosted at [GitHub](http://github.com/netzpirat/guard-coffeescript)
|
121
|
+
- Report issues/Questions/Feature requests on [GitHub Issues](http://github.com/netzpirat/guard-coffeescript/issues)
|
122
|
+
|
123
|
+
Pull requests are very welcome! Make sure your patches are well tested.
|
124
|
+
|
125
|
+
## Acknowledgment
|
126
|
+
|
127
|
+
The [Guard Team](https://github.com/guard/guard/contributors) for giving us such a nice pice of software
|
128
|
+
that is so easy to extend, one *has* to make a plugin for it!
|
129
|
+
|
130
|
+
All the authors of the numerous [Guards](http://github.com/guard) avaiable for making the Guard ecosystem
|
131
|
+
so much growing and comprehensive.
|
132
|
+
|
133
|
+
## License
|
134
|
+
|
135
|
+
(The MIT License)
|
136
|
+
|
137
|
+
Copyright (c) 2010 - 2011 Michael Kessler
|
138
|
+
|
139
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
140
|
+
a copy of this software and associated documentation files (the
|
141
|
+
'Software'), to deal in the Software without restriction, including
|
142
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
143
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
144
|
+
permit persons to whom the Software is furnished to do so, subject to
|
145
|
+
the following conditions:
|
146
|
+
|
147
|
+
The above copyright notice and this permission notice shall be
|
148
|
+
included in all copies or substantial portions of the Software.
|
149
|
+
|
150
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
151
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
152
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
153
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
154
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
155
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
156
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
157
|
+
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: guard-coffeescript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.9
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Michael Kessler
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-04-01 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -84,7 +84,7 @@ files:
|
|
84
84
|
- lib/guard/coffeescript/version.rb
|
85
85
|
- lib/guard/coffeescript.rb
|
86
86
|
- LICENSE
|
87
|
-
- README.
|
87
|
+
- README.md
|
88
88
|
has_rdoc: true
|
89
89
|
homepage: http://github.com/netzpirat/guard-coffeescript
|
90
90
|
licenses: []
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
requirements: []
|
110
110
|
|
111
111
|
rubyforge_project: guard-coffeescript
|
112
|
-
rubygems_version: 1.6.
|
112
|
+
rubygems_version: 1.6.2
|
113
113
|
signing_key:
|
114
114
|
specification_version: 3
|
115
115
|
summary: Guard gem for CoffeeScript
|
data/README.rdoc
DELETED
@@ -1,135 +0,0 @@
|
|
1
|
-
= Guard::CoffeeScript
|
2
|
-
|
3
|
-
Guard::CoffeeScript compiles you CoffeeScripts automatically when files are modified.
|
4
|
-
|
5
|
-
- Tested on Ruby 1.8.7 & 1.9.2.
|
6
|
-
|
7
|
-
== Install
|
8
|
-
|
9
|
-
Please be sure to have {guard}[http://github.com/guard/guard] installed before continue.
|
10
|
-
|
11
|
-
Install the gem:
|
12
|
-
|
13
|
-
gem install guard-coffeescript
|
14
|
-
|
15
|
-
Add it to your Gemfile (inside test group):
|
16
|
-
|
17
|
-
gem 'guard-coffeescript'
|
18
|
-
|
19
|
-
Add guard definition to your Guardfile by running this command:
|
20
|
-
|
21
|
-
guard init coffeescript
|
22
|
-
|
23
|
-
== JSON
|
24
|
-
|
25
|
-
The json library is also required but is not explicitly stated as a gem dependency. If you're on Ruby 1.8 you'll need
|
26
|
-
to install the json or json_pure gem. On Ruby 1.9, json is included in the standard library.
|
27
|
-
|
28
|
-
== CoffeeScript
|
29
|
-
|
30
|
-
Guard::CoffeeScript uses {Ruby CoffeeScript}[http://github.com/josh/ruby-coffee-script/] to compile the CoffeeScripts,
|
31
|
-
that in turn uses {ExecJS}[https://github.com/sstephenson/execjs] to pick the best runtime to evaluate the JavaScript.
|
32
|
-
|
33
|
-
=== node.js
|
34
|
-
|
35
|
-
Please refer to the {CoffeeScript documentation}[http://jashkenas.github.com/coffee-script/] for more information about
|
36
|
-
how to install the latest CoffeeScript version on node.js.
|
37
|
-
|
38
|
-
=== JavaScript Core
|
39
|
-
|
40
|
-
JavaScript Core is only available on Mac OS X. To use JavaScript Core you don't have to install anything, because
|
41
|
-
JavaScript Core is packaged with Mac OS X.
|
42
|
-
|
43
|
-
=== V8
|
44
|
-
|
45
|
-
To use CoffeeScript on V8, simple add `therubyracer` to your Gemfile. The Ruby Racer acts as a bridge between Ruby
|
46
|
-
and the V8 engine, that will be automatically installed by the Ruby Racer.
|
47
|
-
|
48
|
-
group :development do
|
49
|
-
gem 'therubyracer'
|
50
|
-
end
|
51
|
-
|
52
|
-
=== Mozilla Rhino
|
53
|
-
|
54
|
-
If you're using JRuby, you can embed the Mozilla Rhino runtime by adding `therubyrhino` to your Gemfile:
|
55
|
-
|
56
|
-
group :development do
|
57
|
-
gem 'therubyrhino'
|
58
|
-
end
|
59
|
-
|
60
|
-
=== Microsoft Windows Script Host
|
61
|
-
|
62
|
-
{Microsoft Windows Script Host}[http://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx] is available on any Microsoft
|
63
|
-
Windows operating systems.
|
64
|
-
|
65
|
-
== Usage
|
66
|
-
|
67
|
-
Please read {guard usage doc}[http://github.com/guard/guard#readme]
|
68
|
-
|
69
|
-
== Guardfile
|
70
|
-
|
71
|
-
CoffeeScript guard can be adapated to all kind of projects.
|
72
|
-
Please read {guard doc}[http://github.com/guard/guard#readme] for more info about Guardfile DSL.
|
73
|
-
|
74
|
-
=== Standard ruby gems
|
75
|
-
|
76
|
-
guard 'coffeescript' do
|
77
|
-
watch(%r{coffeescripts/.+\.coffee})
|
78
|
-
end
|
79
|
-
|
80
|
-
=== Rails app
|
81
|
-
|
82
|
-
guard 'coffeescript', :output => 'public/javascripts/compiled' do
|
83
|
-
watch(%r{app/coffeescripts/.+\.coffee})
|
84
|
-
end
|
85
|
-
|
86
|
-
== Options
|
87
|
-
|
88
|
-
There following options can be passed to the CoffeeSCript Guard:
|
89
|
-
|
90
|
-
:output => 'javascripts' # Relative path to the output directory
|
91
|
-
:bare => true # Compile without the top-level function wrapper
|
92
|
-
:shallow => true # Do not create nested output directories
|
93
|
-
|
94
|
-
=== Nested directories
|
95
|
-
|
96
|
-
The guard detects by default nested directories and creates these within the output directory. The detection is based on the match of the watch regular expression:
|
97
|
-
|
98
|
-
A file
|
99
|
-
|
100
|
-
/app/coffeescripts/ui/buttons/toggle_button.coffee
|
101
|
-
|
102
|
-
that has been detected by the watch
|
103
|
-
|
104
|
-
watch(%r{app/coffeescripts/.+\.coffee})
|
105
|
-
|
106
|
-
with an output directory of
|
107
|
-
|
108
|
-
:output => 'public/javascripts/compiled'
|
109
|
-
|
110
|
-
will be compiled to
|
111
|
-
|
112
|
-
public/javascripts/compiled/ui/buttons/toggle_button.js
|
113
|
-
|
114
|
-
This behaviour can be switched off by passing the option `:shallow => true` to the guard, so that all JavaScripts will
|
115
|
-
be compiled directly to the output directory.
|
116
|
-
|
117
|
-
== Development
|
118
|
-
|
119
|
-
- Source hosted at {GitHub}[http://github.com/netzpirat/guard-coffeescript]
|
120
|
-
- Report issues/Questions/Feature requests on {GitHub Issues}[http://github.com/netzpirat/guard-coffeescript/issues]
|
121
|
-
|
122
|
-
Pull requests are very welcome! Make sure your patches are well tested.
|
123
|
-
|
124
|
-
== Author
|
125
|
-
|
126
|
-
{Michael Kessler}[http://github.com/netzpirat]
|
127
|
-
|
128
|
-
== Contributors
|
129
|
-
|
130
|
-
{Aaron Jensen}[https://github.com/aaronjensen]
|
131
|
-
|
132
|
-
== Acknowledgment
|
133
|
-
|
134
|
-
Many thanks to the {Guard Team}[https://github.com/guard/guard/contributors] and all the authors of the numerous {Guards}[http://github.com/guard]
|
135
|
-
|