guard-lono 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +3 -0
- data/Guardfile +11 -0
- data/LICENSE +22 -0
- data/README.md +15 -0
- data/Rakefile +7 -0
- data/guard-lono.gemspec +28 -0
- data/lib/guard/lono.rb +50 -0
- data/lib/guard/lono/templates/Guardfile +3 -0
- data/lib/guard/version.rb +3 -0
- data/spec/lono_spec.rb +30 -0
- data/spec/spec_helper.rb +14 -0
- metadata +191 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
guard "bundler" do
|
2
|
+
watch("Gemfile")
|
3
|
+
watch(/^.+\.gemspec/)
|
4
|
+
end
|
5
|
+
|
6
|
+
guard "rspec", :version => 2, :cli=> "--format nested" do
|
7
|
+
watch(%r{^spec/.+_spec\.rb$})
|
8
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
9
|
+
watch("spec/spec_helper.rb") { "spec" }
|
10
|
+
watch(%r{^spec/support/(.+)\.rb$}) { |m| "spec" }
|
11
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Tung Nguyen
|
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,15 @@
|
|
1
|
+
# Guard::Lono
|
2
|
+
|
3
|
+
Guard::Lono automatically generates cloud formation templates from hono ERB templates.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Please be sure to have [Guard](https://github.com/guard/guard) installed before continuing.
|
8
|
+
|
9
|
+
Install the gem:
|
10
|
+
|
11
|
+
$ gem install guard-hono
|
12
|
+
|
13
|
+
Add the guard-cloudformation definition to your Guardfile by running this command:
|
14
|
+
|
15
|
+
$ guard init hono
|
data/Rakefile
ADDED
data/guard-lono.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/guard/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Tung Nguyen"]
|
6
|
+
gem.email = ["tongueroo@gmail.com"]
|
7
|
+
gem.description = %q{Guard::Lono automatically builds cloud formation templates from lono erb templates.}
|
8
|
+
gem.summary = %q{Guard::Lono automatically builds cloud formation templates from lono erb templates.}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "guard-lono"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Guard::LONO_VERSION
|
17
|
+
|
18
|
+
gem.add_dependency "colorize"
|
19
|
+
gem.add_dependency "guard"
|
20
|
+
|
21
|
+
gem.add_development_dependency "rspec"
|
22
|
+
gem.add_development_dependency "travis-lint"
|
23
|
+
gem.add_development_dependency "growl"
|
24
|
+
gem.add_development_dependency "guard-bundler"
|
25
|
+
gem.add_development_dependency "guard-rspec"
|
26
|
+
gem.add_development_dependency "rb-fsevent"
|
27
|
+
|
28
|
+
end
|
data/lib/guard/lono.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require "guard"
|
2
|
+
require "guard/guard"
|
3
|
+
require "colorize"
|
4
|
+
|
5
|
+
module Guard
|
6
|
+
class Lono < Guard
|
7
|
+
|
8
|
+
# Initialize a Guard.
|
9
|
+
# @param [Array<Guard::Watcher>] watchers the Guard file watchers
|
10
|
+
# @param [Hash] options the custom Guard options
|
11
|
+
def initialize(watchers = [], options = {})
|
12
|
+
super
|
13
|
+
@results = {}
|
14
|
+
@options = {
|
15
|
+
:all_on_start => true,
|
16
|
+
:notification => true,
|
17
|
+
}.merge(@options)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Call once when Guard starts. Please override initialize method to init stuff.
|
21
|
+
# @raise [:task_has_failed] when start has failed
|
22
|
+
def start
|
23
|
+
run_all if @options[:all_on_start]
|
24
|
+
end
|
25
|
+
|
26
|
+
# Called when just `enter` is pressed
|
27
|
+
# This method should be principally used for long action like running all specs/tests/...
|
28
|
+
# @raise [:task_has_failed] when run_all has failed
|
29
|
+
def run_all
|
30
|
+
run!
|
31
|
+
end
|
32
|
+
|
33
|
+
# Called on file(s) modifications that the Guard watches.
|
34
|
+
# @param [Array<String>] paths the changes files or paths
|
35
|
+
# @raise [:task_has_failed] when run_on_change has failed
|
36
|
+
def run_on_change(paths)
|
37
|
+
run!
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def run!
|
43
|
+
throw :task_has_failed unless command
|
44
|
+
end
|
45
|
+
|
46
|
+
def command
|
47
|
+
system("lono generate")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/spec/lono_spec.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "guard/lono"
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
describe Lono do
|
6
|
+
before { Notifier.stub(:notify) }
|
7
|
+
|
8
|
+
it { should be_a_kind_of ::Guard::Guard }
|
9
|
+
|
10
|
+
describe "#run_all" do
|
11
|
+
subject { guard.run_all }
|
12
|
+
let(:guard) { described_class.new [], :notification => notification }
|
13
|
+
let(:notification) { false }
|
14
|
+
let(:command) { mock "command" }
|
15
|
+
|
16
|
+
it "runs return true lono command runs successfully" do
|
17
|
+
guard.stub(:command).and_return(true)
|
18
|
+
guard.should_receive(:command).exactly(1).times
|
19
|
+
subject
|
20
|
+
end
|
21
|
+
|
22
|
+
it "runs return false lono command runs unsuccessfully" do
|
23
|
+
guard.stub(:command).and_return(false)
|
24
|
+
expect { subject }.to throw_symbol(:task_has_failed)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require "bundler/setup"
|
2
|
+
require "rspec/autorun"
|
3
|
+
|
4
|
+
ENV["GUARD_ENV"] = "test"
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |file| require file }
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
12
|
+
config.run_all_when_everything_filtered = true
|
13
|
+
config.filter_run :focus
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,191 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-lono
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Tung Nguyen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: colorize
|
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: guard
|
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: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
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: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: travis-lint
|
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
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: growl
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: guard-bundler
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: guard-rspec
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rb-fsevent
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
description: Guard::Lono automatically builds cloud formation templates from lono
|
143
|
+
erb templates.
|
144
|
+
email:
|
145
|
+
- tongueroo@gmail.com
|
146
|
+
executables: []
|
147
|
+
extensions: []
|
148
|
+
extra_rdoc_files: []
|
149
|
+
files:
|
150
|
+
- .gitignore
|
151
|
+
- .rspec
|
152
|
+
- .travis.yml
|
153
|
+
- Gemfile
|
154
|
+
- Guardfile
|
155
|
+
- LICENSE
|
156
|
+
- README.md
|
157
|
+
- Rakefile
|
158
|
+
- guard-lono.gemspec
|
159
|
+
- lib/guard/lono.rb
|
160
|
+
- lib/guard/lono/templates/Guardfile
|
161
|
+
- lib/guard/version.rb
|
162
|
+
- spec/lono_spec.rb
|
163
|
+
- spec/spec_helper.rb
|
164
|
+
homepage: ''
|
165
|
+
licenses: []
|
166
|
+
post_install_message:
|
167
|
+
rdoc_options: []
|
168
|
+
require_paths:
|
169
|
+
- lib
|
170
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
172
|
+
requirements:
|
173
|
+
- - ! '>='
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
requirements: []
|
183
|
+
rubyforge_project:
|
184
|
+
rubygems_version: 1.8.24
|
185
|
+
signing_key:
|
186
|
+
specification_version: 3
|
187
|
+
summary: Guard::Lono automatically builds cloud formation templates from lono erb
|
188
|
+
templates.
|
189
|
+
test_files:
|
190
|
+
- spec/lono_spec.rb
|
191
|
+
- spec/spec_helper.rb
|