guard-sprockets 0.5.0 → 1.0.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/LICENSE +1 -1
- data/README.md +10 -10
- data/lib/guard/sprockets.rb +7 -7
- data/lib/guard/sprockets/templates/Guardfile +1 -1
- data/lib/guard/sprockets/version.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29e994249a106a797aa8d40fbfff3c1cf4288c23
|
4
|
+
data.tar.gz: b328c9901b2ac758aef46c226f3a5314ffe9ba8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7569a35af03ff5c73e3299a33ce9a73be7a19275f762d3a6bc0555b3d22fe503bbfd632fb9ed79b3551f10ee1d8a2959dd89b3c38006226d921e131496976daf
|
7
|
+
data.tar.gz: dafc1cb3b4ccbbfb1ac5d84d8fc3629078c9499318f7a3c94f64f2d1f5c0030bd8ba36b766d53f824958eb915eb5d574d1eccdd4f0841b467c77e415fe85918d
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Moved to [GitHub releases](https://github.com/guard/guard-sprockets/releases) page.
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
Sprockets guard automatically packages your JavaScript files together when your source files are saved.
|
6
6
|
|
7
7
|
* Compatible with Sprockets 2.x (for Sprockets 1.x compatibility, please use Guard::Sprockets 0.1.4 or the `sprockets_1` branch).
|
8
|
-
* Tested against Ruby 1.
|
8
|
+
* Tested against Ruby 1.9.3, 2.0.0, Rubinius & JRuby (1.9 mode only).
|
9
9
|
|
10
10
|
## Install
|
11
11
|
|
@@ -42,7 +42,7 @@ Guard::Sprockets can be adapted to all kind of projects.
|
|
42
42
|
### Typical Rails 3 app (default generated Guardfile)
|
43
43
|
|
44
44
|
```ruby
|
45
|
-
guard
|
45
|
+
guard :sprockets, destination: 'public/javascripts', asset_paths: ['/app/assets/javascripts'] do
|
46
46
|
watch 'app/assets/javascripts/application.js'
|
47
47
|
end
|
48
48
|
```
|
@@ -52,17 +52,17 @@ Please read [Guard doc](https://github.com/guard/guard#readme) for more informat
|
|
52
52
|
## Options
|
53
53
|
|
54
54
|
```ruby
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
55
|
+
destination: 'public/js' # change the destination folder in which the compiled assets are saved, default: 'public/javascripts'
|
56
|
+
asset_paths: 'app/js' # add a directory (or on array of directories) to Sprockets' environment's load path, default: ['app/assets/javascripts']
|
57
|
+
asset_paths: ['app/js', 'lib/js'] # asset_paths can be a String or an Array
|
58
|
+
minify: true # minify the JavaScript files content using Uglifier, default: false
|
59
59
|
# be sure to add: "gem 'uglifier'" in your Gemfile
|
60
|
-
:
|
60
|
+
keep_paths: true # retain the directory structure of an asset's path relative to the asset_path, default: false
|
61
61
|
# this prevents assets with the same basename, but placed different folders, from overwriting each other in the destination folder
|
62
62
|
# e.x. with this option set to true: app/js/vendor/rails/turbolinks.js.coffee -> public/js/vendor/rails/turbolinks.js
|
63
63
|
# and with this option set to false: app/js/vendor/rails/turbolinks.js.coffee -> public/js/turbolinks.js
|
64
|
-
:
|
65
|
-
:
|
64
|
+
root_file: 'app/js/app.js' # if set, only this file will be compiled, default: nil
|
65
|
+
root_file: ['one.js', 'two.js'] # root_file can be a String or an Array
|
66
66
|
```
|
67
67
|
|
68
68
|
## Development
|
@@ -91,4 +91,4 @@ For questions please join us in our [Google group](http://groups.google.com/grou
|
|
91
91
|
|
92
92
|
## Contributors
|
93
93
|
|
94
|
-
https://github.com/guard/guard-sprockets/contributors
|
94
|
+
[https://github.com/guard/guard-sprockets/graphs/contributors](https://github.com/guard/guard-sprockets/graphs/contributors)
|
data/lib/guard/sprockets.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
require 'guard'
|
2
|
-
require 'guard/
|
2
|
+
require 'guard/plugin'
|
3
3
|
|
4
4
|
require 'sprockets'
|
5
5
|
require 'execjs'
|
6
6
|
|
7
7
|
module Guard
|
8
|
-
class Sprockets <
|
8
|
+
class Sprockets < Plugin
|
9
9
|
|
10
10
|
attr_reader :asset_paths, :destination, :root_file, :sprockets
|
11
11
|
|
12
|
-
def initialize(
|
13
|
-
super
|
12
|
+
def initialize(options = {})
|
13
|
+
super
|
14
14
|
|
15
15
|
@options = options
|
16
16
|
@asset_paths = Array(@options[:asset_paths] || 'app/assets/javascripts')
|
17
17
|
@destination = @options[:destination] || 'public/javascripts'
|
18
18
|
@root_file = Array(@options[:root_file])
|
19
|
-
@keep_paths
|
19
|
+
@keep_paths = @options[:keep_paths] || false
|
20
20
|
|
21
21
|
@sprockets = ::Sprockets::Environment.new
|
22
22
|
@asset_paths.each { |p| @sprockets.append_path(p) }
|
@@ -43,7 +43,7 @@ module Guard
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def run_all
|
46
|
-
run_on_changes
|
46
|
+
run_on_changes([])
|
47
47
|
end
|
48
48
|
|
49
49
|
def run_on_changes(paths)
|
@@ -86,7 +86,7 @@ module Guard
|
|
86
86
|
rescue ExecJS::ProgramError => ex
|
87
87
|
UI.error "Sprockets failed compiling #{output_filename}"
|
88
88
|
UI.error ex.message
|
89
|
-
Notifier.notify "Sprockets failed compiling #{output_filename}!", :
|
89
|
+
Notifier.notify "Sprockets failed compiling #{output_filename}!", priority: 2, image: :failed
|
90
90
|
|
91
91
|
false
|
92
92
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Cruz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '2.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '2.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: execjs
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,8 +83,7 @@ dependencies:
|
|
83
83
|
version: '0'
|
84
84
|
description: Guard::Sprockets automatically packages your JavaScript files together.
|
85
85
|
email:
|
86
|
-
-
|
87
|
-
- kematzy at gmail
|
86
|
+
- remy@rymai.me
|
88
87
|
executables: []
|
89
88
|
extensions: []
|
90
89
|
extra_rdoc_files: []
|
@@ -92,10 +91,12 @@ files:
|
|
92
91
|
- lib/guard/sprockets/templates/Guardfile
|
93
92
|
- lib/guard/sprockets/version.rb
|
94
93
|
- lib/guard/sprockets.rb
|
94
|
+
- CHANGELOG.md
|
95
95
|
- LICENSE
|
96
96
|
- README.md
|
97
97
|
homepage: https://rubygems.org/gems/guard-sprockets
|
98
|
-
licenses:
|
98
|
+
licenses:
|
99
|
+
- MIT
|
99
100
|
metadata: {}
|
100
101
|
post_install_message:
|
101
102
|
rdoc_options: []
|
@@ -105,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
106
|
requirements:
|
106
107
|
- - '>='
|
107
108
|
- !ruby/object:Gem::Version
|
108
|
-
version: 1.
|
109
|
+
version: 1.9.2
|
109
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
111
|
requirements:
|
111
112
|
- - '>='
|