cucumber-nagios 0.7.2 → 0.7.3
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/bin/cucumber-nagios-gen +48 -14
- metadata +3 -4
- data/lib/generators/project/bin/cucumber-nagios-gen +0 -52
data/bin/cucumber-nagios-gen
CHANGED
@@ -18,38 +18,72 @@ module CucumberNagiosGenerators
|
|
18
18
|
File.join(@destination_root, name)
|
19
19
|
end
|
20
20
|
|
21
|
+
@root = Pathname.new(File.dirname(__FILE__)).parent.join('lib/cucumber/nagios')
|
22
|
+
|
21
23
|
desc "Generate a new self-contained cucumber-nagios project."
|
22
24
|
first_argument :name, :required => true, :desc => "Project name"
|
23
25
|
|
24
26
|
file '.gitignore', '.gitignore'
|
25
27
|
file '.bzrignore', '.bzrignore'
|
26
28
|
|
27
|
-
directory :steps,
|
28
|
-
directory :features,
|
29
|
+
directory :steps, @root.join('steps'), 'features/steps'
|
30
|
+
directory :features, @root.join('support'), 'features/support', :after => :readme
|
29
31
|
|
30
32
|
glob!
|
31
33
|
|
34
|
+
def readme(action)
|
35
|
+
puts <<-README
|
36
|
+
|
37
|
+
Your new cucumber-nagios project has been generated.
|
38
|
+
|
39
|
+
To get going, you'll need to bundle gems into the project:
|
40
|
+
|
41
|
+
$ gem bundle
|
42
|
+
|
43
|
+
It's *highly* recommended you version control your project:
|
44
|
+
|
45
|
+
- with Git: git init ; git add .
|
46
|
+
- with Bazaar: bzr init ; bzr add
|
47
|
+
|
48
|
+
README
|
49
|
+
end
|
50
|
+
|
32
51
|
end
|
33
52
|
|
34
53
|
desc "Generate a cucumber-nagios project."
|
35
54
|
add :project, ProjectGenerator
|
36
55
|
|
37
|
-
end
|
38
56
|
|
57
|
+
# feature generator
|
58
|
+
class FeatureGenerator < Templater::Generator
|
59
|
+
def self.source_root
|
60
|
+
File.join(File.dirname(__FILE__), '..', 'lib', 'generators', 'project', 'lib', 'generators', 'feature')
|
61
|
+
end
|
39
62
|
|
40
|
-
|
63
|
+
desc <<-DESC
|
64
|
+
Generate a cucumber feature. Takes a two arguments:
|
65
|
+
bin/cucumber-nagios-gen feature <site-name> <feature-name>
|
66
|
+
DESC
|
41
67
|
|
42
|
-
|
43
|
-
|
68
|
+
first_argument :site, :required => true, :desc => "Site name"
|
69
|
+
second_argument :feature, :required => true, :desc => "Feature name"
|
44
70
|
|
45
|
-
|
46
|
-
|
47
|
-
|
71
|
+
template :feature do |template|
|
72
|
+
template.source = "%feature_name%.feature"
|
73
|
+
template.destination = "features/#{site}/#{feature}.feature"
|
74
|
+
end
|
75
|
+
|
76
|
+
template :step do |template|
|
77
|
+
template.source = "%feature_name%_steps.rb"
|
78
|
+
template.destination = "features/#{site}/steps/#{feature}_steps.rb"
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
48
82
|
|
49
|
-
|
50
|
-
|
51
|
-
- with Git: git init ; git add .
|
52
|
-
- with Bazaar: bzr init ; bzr add
|
83
|
+
desc "Generators for a cucumber-nagios project"
|
84
|
+
add :feature, FeatureGenerator
|
53
85
|
|
54
|
-
|
86
|
+
end
|
87
|
+
|
88
|
+
CucumberNagiosGenerators.run_cli Dir.pwd, 'cucumber-nagios-gen', Cucumber::Nagios::VERSION, ARGV
|
55
89
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 7
|
8
|
-
-
|
9
|
-
version: 0.7.
|
8
|
+
- 3
|
9
|
+
version: 0.7.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Lindsay Holmwood
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-06-23 00:00:00 +10:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -156,7 +156,6 @@ files:
|
|
156
156
|
- lib/cucumber/nagios.rb
|
157
157
|
- lib/cucumber-nagios.rb
|
158
158
|
- lib/generators/project/bin/cucumber-nagios
|
159
|
-
- lib/generators/project/bin/cucumber-nagios-gen
|
160
159
|
- lib/generators/project/Gemfile
|
161
160
|
- lib/generators/project/lib/generators/feature/%feature_name%.feature
|
162
161
|
- lib/generators/project/lib/generators/feature/%feature_name%_steps.rb
|
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# attempt to load up the bundled gems, and give an explanatory message if we can't
|
4
|
-
begin
|
5
|
-
require File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'environment')
|
6
|
-
rescue LoadError
|
7
|
-
puts "You need to bundle gems into your project before you can run this."
|
8
|
-
puts
|
9
|
-
puts "To do this, make sure the 'bundler' gem is installed, and run:"
|
10
|
-
puts
|
11
|
-
puts " $ gem bundle"
|
12
|
-
puts
|
13
|
-
exit 1
|
14
|
-
end
|
15
|
-
require 'templater'
|
16
|
-
|
17
|
-
module CucumberNagiosGenerators
|
18
|
-
|
19
|
-
extend Templater::Manifold
|
20
|
-
|
21
|
-
# feature generator
|
22
|
-
class FeatureGenerator < Templater::Generator
|
23
|
-
def self.source_root
|
24
|
-
File.join(File.dirname(__FILE__), '..', 'lib', 'generators', 'feature')
|
25
|
-
end
|
26
|
-
|
27
|
-
desc <<-DESC
|
28
|
-
Generate a cucumber feature. Takes a two arguments:
|
29
|
-
bin/cucumber-nagios-gen feature <site-name> <feature-name>
|
30
|
-
DESC
|
31
|
-
|
32
|
-
first_argument :site, :required => true, :desc => "Site name"
|
33
|
-
second_argument :feature, :required => true, :desc => "Feature name"
|
34
|
-
|
35
|
-
template :feature do |template|
|
36
|
-
template.source = "%feature_name%.feature"
|
37
|
-
template.destination = "features/#{site}/#{feature}.feature"
|
38
|
-
end
|
39
|
-
|
40
|
-
template :step do |template|
|
41
|
-
template.source = "%feature_name%_steps.rb"
|
42
|
-
template.destination = "features/#{site}/steps/#{feature}_steps.rb"
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
desc "Generators for a cucumber-nagios project"
|
48
|
-
add :feature, FeatureGenerator
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
CucumberNagiosGenerators.run_cli Dir.pwd, 'cucumber-nagios-gen', '0.6.3', ARGV
|