kosmas58-cucumber 0.1.16.5 → 0.1.16.6
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/lib/cucumber/rake/task.rb
CHANGED
@@ -7,5 +7,7 @@ Description:
|
|
7
7
|
Also see the feature generator, which you can use to generate skeletons
|
8
8
|
for new features.
|
9
9
|
|
10
|
+
If you set a language as argument, then a subdirectory features/[language] will be generated.
|
11
|
+
|
10
12
|
Examples:
|
11
|
-
`./script/generate cucumber`
|
13
|
+
`./script/generate cucumber [language]`
|
@@ -1,31 +1,44 @@
|
|
1
1
|
require 'rbconfig'
|
2
|
-
|
2
|
+
|
3
3
|
# This generator bootstraps a Rails project for use with Cucumber
|
4
4
|
class CucumberGenerator < Rails::Generator::Base
|
5
5
|
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
6
6
|
Config::CONFIG['ruby_install_name'])
|
7
|
+
|
8
|
+
def initialize(args, options)
|
9
|
+
@features_path = 'features'
|
10
|
+
set_language(args.first)
|
11
|
+
super(args, options)
|
12
|
+
end
|
13
|
+
|
7
14
|
def manifest
|
8
15
|
record do |m|
|
9
|
-
m.directory '
|
10
|
-
m.file
|
11
|
-
|
16
|
+
m.directory File.join(@features_path, 'step_definitions')
|
17
|
+
m.file 'webrat_steps.rb', File.join(@features_path, 'step_definitions', 'webrat_steps.rb')
|
18
|
+
|
12
19
|
m.directory 'features/support'
|
13
|
-
m.file
|
14
|
-
m.file
|
15
|
-
|
20
|
+
m.file 'env.rb', 'features/support/env.rb'
|
21
|
+
m.file 'paths.rb', 'features/support/paths.rb'
|
22
|
+
|
16
23
|
m.directory 'lib/tasks'
|
17
|
-
m.file
|
18
|
-
|
19
|
-
m.file
|
24
|
+
m.file 'cucumber.rake', 'lib/tasks/cucumber.rake'
|
25
|
+
|
26
|
+
m.file 'cucumber', 'script/cucumber', {
|
20
27
|
:chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang]
|
21
28
|
}
|
22
29
|
end
|
23
30
|
end
|
24
|
-
|
31
|
+
|
25
32
|
protected
|
26
|
-
|
33
|
+
|
27
34
|
def banner
|
28
|
-
"Usage: #{$0} cucumber"
|
35
|
+
"Usage: #{$0} cucumber [language]"
|
29
36
|
end
|
30
|
-
|
37
|
+
|
38
|
+
# Load up the transations for the passed language, and modify the features_path accordingly
|
39
|
+
def set_language(language)
|
40
|
+
@language = language
|
41
|
+
@features_path = File.join(@features_path, @language) if @language
|
42
|
+
end
|
43
|
+
|
31
44
|
end
|