guard-embertools 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +64 -0
- data/Rakefile +1 -0
- data/guard-embertools.gemspec +26 -0
- data/lib/guard/embertools/templates/Guardfile +3 -0
- data/lib/guard/embertools/version.rb +5 -0
- data/lib/guard/embertools.rb +40 -0
- metadata +121 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Brad Humphrey
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# Guard::Embertools
|
2
|
+
|
3
|
+
Ember tools guard automatically rebuilds the Ember
|
4
|
+
application.js file when ember files are modified using
|
5
|
+
[ember tools](https://github.com/rpflorence/ember-tools).
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
This guard is dependant on ember-tools so install that first:
|
10
|
+
|
11
|
+
```
|
12
|
+
$ npm install -g ember-tools
|
13
|
+
```
|
14
|
+
|
15
|
+
Add this line to your application's Gemfile:
|
16
|
+
|
17
|
+
``` ruby
|
18
|
+
gem 'guard-embertools'
|
19
|
+
```
|
20
|
+
|
21
|
+
And then execute:
|
22
|
+
|
23
|
+
```
|
24
|
+
$ bundle
|
25
|
+
```
|
26
|
+
|
27
|
+
Or install it yourself as:
|
28
|
+
|
29
|
+
```
|
30
|
+
$ gem install guard-embertools
|
31
|
+
```
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
See the [guard usage documentation](https://github.com/guard/guard#readme) for
|
36
|
+
more guard usage information.
|
37
|
+
|
38
|
+
## Guardfile
|
39
|
+
|
40
|
+
This sample guard will run ember build for any change in the javascripts directory,
|
41
|
+
excluding the three files that `ember build` uses to compile the application.
|
42
|
+
``` ruby
|
43
|
+
guard :embertools do
|
44
|
+
watch(%r{^public\/javascripts\/(?!index\.js)(?!templates\.js)(?!application\.js).*})
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
This guard shows how to send in the command line arguments for `ember build`. See
|
49
|
+
``` ruby
|
50
|
+
guard :embertools, debug: true, no_cleanup: true, out_file: '/my/custom/location.js' do
|
51
|
+
watch(%r{^public\/javascripts\/(?!index\.js)(?!templates\.js)(?!application\.js).*})
|
52
|
+
end
|
53
|
+
```
|
54
|
+
|
55
|
+
See [ember tools](https://github.com/rpflorence/ember-tools/blob/master/bin/ember#L21-L28)
|
56
|
+
for more information about the different build flags.
|
57
|
+
|
58
|
+
## Contributing
|
59
|
+
|
60
|
+
1. Fork it
|
61
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
62
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
63
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
64
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'guard/embertools/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "guard-embertools"
|
8
|
+
spec.version = Guard::EmberToolsVersion::VERSION
|
9
|
+
spec.authors = ["Brad Humphrey"]
|
10
|
+
spec.email = ["brad@instructure.com"]
|
11
|
+
spec.description = 'Guard::EmberTools automatically recompiles the ember application when changes are made'
|
12
|
+
spec.summary = 'Guard gem for ember tools'
|
13
|
+
spec.homepage = "https://github.com/wbhumphrey/guard-embertools"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'guard'
|
22
|
+
spec.add_dependency 'colorize'
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
25
|
+
spec.add_development_dependency "rake"
|
26
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
class EmberTools < Guard
|
6
|
+
require 'colorize'
|
7
|
+
|
8
|
+
def initialize(watchers = [], options = {})
|
9
|
+
super
|
10
|
+
@options = {
|
11
|
+
:debug => false,
|
12
|
+
:no_cleanup => false,
|
13
|
+
:out_file => nil
|
14
|
+
}.merge(options)
|
15
|
+
end
|
16
|
+
|
17
|
+
def run_all
|
18
|
+
compile_ember
|
19
|
+
end
|
20
|
+
|
21
|
+
def run_on_changes(path)
|
22
|
+
puts "detected changes in #{path.join(', ')}".yellow
|
23
|
+
compile_ember
|
24
|
+
end
|
25
|
+
|
26
|
+
def compile_ember
|
27
|
+
command = "ember build #{generate_cl_arguments}"
|
28
|
+
puts command
|
29
|
+
puts `#{command}`
|
30
|
+
end
|
31
|
+
|
32
|
+
def generate_cl_arguments
|
33
|
+
args = []
|
34
|
+
args << "-d" if @options[:debug]
|
35
|
+
args << "-c" if @options[:no_cleanup]
|
36
|
+
args << "--out-file #{@options[:out_file]}" if @options[:out_file]
|
37
|
+
args.join(' ')
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-embertools
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Brad Humphrey
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: guard
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: colorize
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: bundler
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.3'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.3'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: Guard::EmberTools automatically recompiles the ember application when
|
79
|
+
changes are made
|
80
|
+
email:
|
81
|
+
- brad@instructure.com
|
82
|
+
executables: []
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files: []
|
85
|
+
files:
|
86
|
+
- .gitignore
|
87
|
+
- Gemfile
|
88
|
+
- LICENSE.txt
|
89
|
+
- README.md
|
90
|
+
- Rakefile
|
91
|
+
- guard-embertools.gemspec
|
92
|
+
- lib/guard/embertools.rb
|
93
|
+
- lib/guard/embertools/templates/Guardfile
|
94
|
+
- lib/guard/embertools/version.rb
|
95
|
+
homepage: https://github.com/wbhumphrey/guard-embertools
|
96
|
+
licenses:
|
97
|
+
- MIT
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - ! '>='
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
requirements: []
|
115
|
+
rubyforge_project:
|
116
|
+
rubygems_version: 1.8.24
|
117
|
+
signing_key:
|
118
|
+
specification_version: 3
|
119
|
+
summary: Guard gem for ember tools
|
120
|
+
test_files: []
|
121
|
+
has_rdoc:
|