remi-scenarios 0.1.1 → 0.1.2

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/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
+ :patch: 2
2
3
  :major: 0
3
4
  :minor: 1
4
- :patch: 1
@@ -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
- # setup_rails_to_run_scenarios
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
- # bootstrap
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
@@ -1,3 +1,5 @@
1
1
  # my one-line description of the <%= name_of_scenario_to_create %> scenario
2
2
 
3
3
  $foo = "the <%= name_of_scenario_file_to_create %> scenario sets a global variable!"
4
+
5
+ puts "Hello from the <%= name_of_scenario_to_create %> scenario!"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remi-scenarios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - remi