remi-scenarios 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml
CHANGED
@@ -9,7 +9,7 @@ class ScenarioGenerator < Rails::Generator::Base
|
|
9
9
|
# runtime_options: {:quiet=>false, :generator=>"scenario", :command=>:create, :collision=>:ask}
|
10
10
|
#
|
11
11
|
def initialize(runtime_args, runtime_options = {})
|
12
|
-
|
12
|
+
setup_rails_to_run_scenarios
|
13
13
|
@name_of_scenario_to_create = runtime_args.join(' ')
|
14
14
|
@name_of_scenario_file_to_create = runtime_args.join('_').downcase
|
15
15
|
super
|
@@ -17,7 +17,15 @@ class ScenarioGenerator < Rails::Generator::Base
|
|
17
17
|
|
18
18
|
# this should be done by ./script/generate blackbox
|
19
19
|
def setup_rails_to_run_scenarios
|
20
|
-
|
20
|
+
rakefile = File.join RAILS_ROOT, 'Rakefile'
|
21
|
+
if File.file? rakefile
|
22
|
+
source = File.read rakefile
|
23
|
+
unless source =~ /require .scenarios.tasks./
|
24
|
+
File.open( rakefile, 'a' ) do |f|
|
25
|
+
f << %[require 'scenarios/tasks']
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
21
29
|
end
|
22
30
|
|
23
31
|
def manifest
|