terraformation 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -2,18 +2,7 @@ require 'rake/rdoctask'
2
2
  require 'rake/gempackagetask'
3
3
  require 'fileutils'
4
4
 
5
- spec = Gem::Specification.new do |s|
6
- s.name = "terraformation"
7
- s.version = "0.2.1"
8
- s.summary = "Generators with a Hashrocket twist"
9
- s.email = "info@hashrocket.com"
10
- s.homepage = "http://github.com/hashrocket/terraformation"
11
- s.has_rdoc = false
12
- s.authors = ["Hashrocket"]
13
- s.files = %w( LICENSE README.rdoc Rakefile ) + Dir["{bin,rails_generators}/**/*"].sort
14
- s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
15
- s.executables = ["terrarails"]
16
- end
5
+ spec = eval(File.read(File.join(File.dirname(__FILE__), 'terraformation.gemspec')))
17
6
 
18
7
  Rake::GemPackageTask.new(spec) do |package|
19
8
  package.gem_spec = spec
@@ -8,7 +8,12 @@ if instance_of?(Object) # Invoked directly
8
8
  elsif ARGV.empty?
9
9
  exec('rake', 'rails:template', "LOCATION=#{__FILE__}")
10
10
  else
11
- exec('rails', '--template', __FILE__, *ARGV)
11
+ require 'rails/version'
12
+ if Rails::VERSION::MAJOR >= 3
13
+ exec('rails', 'new', *ARGV + ['--template', __FILE__])
14
+ else
15
+ exec('rails', '--template', __FILE__, *ARGV)
16
+ end
12
17
  end
13
18
  end
14
19
 
@@ -32,10 +37,10 @@ def self.reformat(*files)
32
37
  end
33
38
  end
34
39
 
35
- unless File.exist?('config/database.example.yml')
40
+ if File.exist?('config/database.example.yml') && !File.exist?('config/database.example.yml')
36
41
  file 'config/database.example.yml', File.read('config/database.yml')
37
42
  end
38
- adapter = YAML.load(File.read('config/database.yml'))['development']['adapter']
43
+ adapter = YAML.load(File.read('config/database.yml'))['development']['adapter'] rescue 'sqlite3'
39
44
 
40
45
  unlink 'test/performance/browsing_test.rb'
41
46
  %w(test/fixtures test/functional test/integration test/performance test/unit).each do |d|
@@ -59,7 +64,11 @@ end
59
64
  unlink 'public/images/rails.png'
60
65
  unlink 'public/index.html'
61
66
 
62
- application_name = File.basename(root).gsub('_',' ').capitalize
67
+ if respond_to?(:root)
68
+ application_name = File.basename(root).gsub('_',' ').capitalize
69
+ else
70
+ application_name = app_name.capitalize
71
+ end
63
72
  if File.size('README') == 10011
64
73
  unlink 'README'
65
74
  file 'README', "= #{application_name}\n"
@@ -10,19 +10,19 @@ When /^I go to (.+)$/ do |page_name|
10
10
  visit path_to(page_name)
11
11
  end
12
12
 
13
- When /^I press "([^\"]*)"$/ do |button, selector|
13
+ When /^I press "([^\"]*)"$/ do |button|
14
14
  click_button(button)
15
15
  end
16
16
 
17
- When /^I follow "([^\"]*)"$/ do |link, selector|
17
+ When /^I follow "([^\"]*)"$/ do |link|
18
18
  click_link(link)
19
19
  end
20
20
 
21
- When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value, selector|
21
+ When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
22
22
  fill_in(field, :with => value)
23
23
  end
24
24
 
25
- When /^I fill in "([^\"]*)" for "([^\"]*)"$/ do |value, field, selector|
25
+ When /^I fill in "([^\"]*)" for "([^\"]*)"$/ do |value, field|
26
26
  fill_in(field, :with => value)
27
27
  end
28
28
 
@@ -37,29 +37,29 @@ end
37
37
  # TODO: Add support for checkbox, select og option
38
38
  # based on naming conventions.
39
39
  #
40
- When /^I fill in the following:$/ do |selector, fields|
40
+ When /^I fill in the following:$/ do |fields|
41
41
  fields.rows_hash.each do |name, value|
42
42
  When %{I fill in "#{name}" with "#{value}"}
43
43
  end
44
44
  end
45
45
 
46
- When /^I select "([^\"]*)" from "([^\"]*)"$/ do |value, field, selector|
46
+ When /^I select "([^\"]*)" from "([^\"]*)"$/ do |value, field|
47
47
  select(value, :from => field)
48
48
  end
49
49
 
50
- When /^I check "([^\"]*)"$/ do |field, selector|
50
+ When /^I check "([^\"]*)"$/ do |field|
51
51
  check(field)
52
52
  end
53
53
 
54
- When /^I uncheck "([^\"]*)"$/ do |field, selector|
54
+ When /^I uncheck "([^\"]*)"$/ do |field|
55
55
  uncheck(field)
56
56
  end
57
57
 
58
- When /^I choose "([^\"]*)"$/ do |field, selector|
58
+ When /^I choose "([^\"]*)"$/ do |field|
59
59
  choose(field)
60
60
  end
61
61
 
62
- When /^I attach the file "([^\"]*)" to "([^\"]*)"$/ do |path, field, selector|
62
+ When /^I attach the file "([^\"]*)" to "([^\"]*)"$/ do |path, field|
63
63
  attach_file(field, path)
64
64
  end
65
65
 
@@ -70,42 +70,42 @@ Then /^I should see JSON:$/ do |expected_json|
70
70
  expected.should == actual
71
71
  end
72
72
 
73
- Then /^I should see "([^\"]*)"$/ do |text, selector|
73
+ Then /^I should see "([^\"]*)"$/ do |text|
74
74
  page.should have_content(text)
75
75
  end
76
76
 
77
- Then /^I should see \/([^\/]*)\/$/ do |regexp, selector|
77
+ Then /^I should see \/([^\/]*)\/$/ do |regexp|
78
78
  regexp = Regexp.new(regexp)
79
79
  page.should have_xpath('//*', :text => regexp)
80
80
  end
81
81
 
82
- Then /^I should not see "([^\"]*)"$/ do |text, selector|
82
+ Then /^I should not see "([^\"]*)"$/ do |text|
83
83
  page.should have_no_content(text)
84
84
  end
85
85
 
86
- Then /^I should not see \/([^\/]*)\/$/ do |regexp, selector|
86
+ Then /^I should not see \/([^\/]*)\/$/ do |regexp|
87
87
  regexp = Regexp.new(regexp)
88
88
  page.should have_no_xpath('//*', :text => regexp)
89
89
  end
90
90
 
91
- Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, selector, value|
91
+ Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, value|
92
92
  field = find_field(field)
93
93
  field_value = (field.tag_name == 'textarea') ? field.text : field.value
94
94
  field_value.should =~ /#{value}/
95
95
  end
96
96
 
97
- Then /^the "([^\"]*)" field should not contain "([^\"]*)"$/ do |field, selector, value|
97
+ Then /^the "([^\"]*)" field should not contain "([^\"]*)"$/ do |field, value|
98
98
  field = find_field(field)
99
99
  field_value = (field.tag_name == 'textarea') ? field.text : field.value
100
100
  field_value.should_not =~ /#{value}/
101
101
  end
102
102
 
103
- Then /^the "([^\"]*)" checkbox should be checked$/ do |label, selector|
103
+ Then /^the "([^\"]*)" checkbox should be checked$/ do |label|
104
104
  field_checked = find_field(label)['checked']
105
105
  field_checked.should == 'checked'
106
106
  end
107
107
 
108
- Then /^the "([^\"]*)" checkbox should not be checked$/ do |label, selector|
108
+ Then /^the "([^\"]*)" checkbox should not be checked$/ do |label|
109
109
  field_checked = find_field(label)['checked']
110
110
  field_checked.should_not == 'checked'
111
111
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Hashrocket
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-01 00:00:00 -04:00
17
+ date: 2011-02-07 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -97,6 +97,7 @@ rdoc_options: []
97
97
  require_paths:
98
98
  - lib
99
99
  required_ruby_version: !ruby/object:Gem::Requirement
100
+ none: false
100
101
  requirements:
101
102
  - - ">="
102
103
  - !ruby/object:Gem::Version
@@ -104,6 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
105
  - 0
105
106
  version: "0"
106
107
  required_rubygems_version: !ruby/object:Gem::Requirement
108
+ none: false
107
109
  requirements:
108
110
  - - ">="
109
111
  - !ruby/object:Gem::Version
@@ -113,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
115
  requirements: []
114
116
 
115
117
  rubyforge_project:
116
- rubygems_version: 1.3.6
118
+ rubygems_version: 1.3.7
117
119
  signing_key:
118
120
  specification_version: 3
119
121
  summary: Generators with a Hashrocket twist