guard-rails-assets 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/README.md +3 -30
- data/lib/guard/rails-assets.rb +2 -5
- data/lib/guard/rails-assets/templates/Guardfile +1 -1
- data/lib/guard/version.rb +1 -1
- data/spec/guard/rails-assets_spec.rb +4 -12
- metadata +8 -8
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
Guard::RailsAssets compiles all the assets in Rails 3.1 application automatically when files are modified.
|
5
5
|
|
6
6
|
Tested on MRI Ruby 1.9.2 (please report if it works on your platform).
|
7
|
-
Currently only POSIX system is supported. Sorry Windows guys :(
|
8
7
|
|
9
8
|
If you have any questions please contact me [@dnagir](http://www.ApproachE.com).
|
10
9
|
|
@@ -35,14 +34,9 @@ explicitly depend on Rails.
|
|
35
34
|
Good thing about it is that assets will always be same as produced by Rails.
|
36
35
|
Bad thing is that it is pretty slow (~10 seconds) because it starts Rails from ground zero.
|
37
36
|
|
38
|
-
|
37
|
+
*NOTE*: The guard runs the `rake assets:clean assets:precopile`.
|
38
|
+
As of current Rails 3.1 edge that means that the assets will be deleted before they are compiled.
|
39
39
|
|
40
|
-
The convention used in this guard are:
|
41
|
-
|
42
|
-
- assets prefix is set to 'assets' meaning that all assets are compiled in to `public/assets` folder;
|
43
|
-
- the assets folder is disposable and can be cleared out.
|
44
|
-
|
45
|
-
If the conventions above are not valid for you then perhaps you'd better submit a patch.
|
46
40
|
|
47
41
|
## Guardfile and Options
|
48
42
|
|
@@ -83,26 +77,5 @@ Pull requests are very welcome!
|
|
83
77
|
|
84
78
|
## License
|
85
79
|
|
86
|
-
|
87
|
-
|
88
|
-
Copyright (c) 2010 - 2011 Michael Kessler
|
89
|
-
|
90
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
91
|
-
a copy of this software and associated documentation files (the
|
92
|
-
'Software'), to deal in the Software without restriction, including
|
93
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
94
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
95
|
-
permit persons to whom the Software is furnished to do so, subject to
|
96
|
-
the following conditions:
|
97
|
-
|
98
|
-
The above copyright notice and this permission notice shall be
|
99
|
-
included in all copies or substantial portions of the Software.
|
100
|
-
|
101
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
102
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
103
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
104
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
105
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
106
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
107
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
80
|
+
MIT License
|
108
81
|
|
data/lib/guard/rails-assets.rb
CHANGED
@@ -26,12 +26,9 @@ module Guard
|
|
26
26
|
|
27
27
|
def compile_assets
|
28
28
|
puts 'Compiling rails assets'
|
29
|
-
result = system "
|
29
|
+
result = system "bundle exec rake assets:clean assets:precompile"
|
30
30
|
if result
|
31
|
-
|
32
|
-
puts tree
|
33
|
-
summary = tree.split("\n").last
|
34
|
-
Notifier::notify summary, :title => 'Assets compiled'
|
31
|
+
Notifier::notify 'Assets compiled'
|
35
32
|
else
|
36
33
|
Notifier::notify 'see the details in the terminal', :title => "Can't compile assets", :image => :failed
|
37
34
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
# Make sure this guard is ABOVE any guards using assets such as jasmine-headless-webkit
|
2
|
+
# Make sure this guard is ABOVE any other guards using assets such as jasmine-headless-webkit
|
3
3
|
# It is recommended to make explicit list of assets in `config/application.rb`
|
4
4
|
# config.assets.precompile = ['application.js', 'application.css', 'all-ie.css']
|
5
5
|
guard 'rails-assets' do
|
data/lib/guard/version.rb
CHANGED
@@ -5,10 +5,6 @@ describe Guard::RailsAssets do
|
|
5
5
|
let(:options) { {} }
|
6
6
|
subject { Guard::RailsAssets.new(['watchers'], options) }
|
7
7
|
|
8
|
-
it 'should be able to create guard' do
|
9
|
-
::Guard::RailsAssets.new(['watchers'], {:options=>:here}).should_not be_nil
|
10
|
-
end
|
11
|
-
|
12
8
|
describe '#start' do
|
13
9
|
it_behaves_like 'guard command', :command => :start, :run => true
|
14
10
|
end
|
@@ -28,24 +24,20 @@ describe Guard::RailsAssets do
|
|
28
24
|
|
29
25
|
describe 'asset compilation using CLI' do
|
30
26
|
def stub_system_with result
|
31
|
-
subject.should_receive(:system).with("
|
27
|
+
subject.should_receive(:system).with("bundle exec rake assets:clean assets:precompile").and_return result
|
32
28
|
end
|
33
29
|
|
34
30
|
it 'should notify on success' do
|
35
31
|
stub_system_with true
|
36
|
-
|
37
|
-
Guard::Notifier.should_receive(:notify).with('1 directory, 2 files', :title => 'Assets compiled')
|
32
|
+
Guard::Notifier.should_receive(:notify).with('Assets compiled')
|
38
33
|
subject.compile_assets
|
39
34
|
end
|
35
|
+
|
40
36
|
it 'should notify on failure' do
|
41
37
|
stub_system_with false
|
42
|
-
|
38
|
+
subject.should_not_receive(:`) # don't obtain tree
|
43
39
|
Guard::Notifier.should_receive(:notify).with('see the details in the terminal', :title => "Can't compile assets", :image => :failed)
|
44
40
|
subject.compile_assets
|
45
41
|
end
|
46
42
|
end
|
47
|
-
|
48
|
-
describe 'custom assets prefix' do
|
49
|
-
it 'should use given prefix'
|
50
|
-
end
|
51
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-rails-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-06-
|
12
|
+
date: 2011-06-24 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
16
|
-
requirement: &
|
16
|
+
requirement: &10073600 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10073600
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &10071740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *10071740
|
36
36
|
description: guard-rails-assets automatically generates JavaScript, CSS, Image files
|
37
37
|
using Rails assets pipelie
|
38
38
|
email:
|
@@ -67,7 +67,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: '0'
|
68
68
|
segments:
|
69
69
|
- 0
|
70
|
-
hash:
|
70
|
+
hash: 3568271390413150560
|
71
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
segments:
|
78
78
|
- 0
|
79
|
-
hash:
|
79
|
+
hash: 3568271390413150560
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project: guard-rails-assets
|
82
82
|
rubygems_version: 1.8.5
|