baldwin 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/baldwin.gemspec +2 -1
- data/lib/baldwin/installer.rb +22 -11
- data/lib/baldwin/rails_template.rb +9 -0
- data/lib/baldwin/tasks.rb +1 -1
- data/lib/baldwin/version.rb +1 -1
- metadata +20 -3
data/baldwin.gemspec
CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Baldwin::VERSION
|
17
17
|
|
18
|
+
gem.add_dependency 'rails', '>= 3.0.0'
|
18
19
|
gem.add_dependency 'appraisal', '>= 0.4.1'
|
19
|
-
gem.add_dependency 'thor', '>= 0.
|
20
|
+
gem.add_dependency 'thor', '>= 0.14.6'
|
20
21
|
end
|
data/lib/baldwin/installer.rb
CHANGED
@@ -5,15 +5,13 @@ module Baldwin
|
|
5
5
|
include Thor::Actions
|
6
6
|
|
7
7
|
def ignore_dummy_rails_apps
|
8
|
-
|
9
|
-
#{byline}
|
8
|
+
append_to_file '.gitignore', <<-EOS
|
10
9
|
spec/support/rails-*
|
11
10
|
EOS
|
12
11
|
end
|
13
12
|
|
14
13
|
def create_appraisals_file
|
15
14
|
create_file 'Appraisals', <<-EOS
|
16
|
-
#{byline}
|
17
15
|
# add your rails configurations to test against here, like:
|
18
16
|
#
|
19
17
|
# appraise 'rails-3.1.0' do
|
@@ -28,10 +26,16 @@ EOS
|
|
28
26
|
end
|
29
27
|
|
30
28
|
def add_appraisal_rake_task
|
31
|
-
|
29
|
+
# TODO figure out why this isn't in Thor 0.15 +
|
30
|
+
# TODO also, ask those guys why they haven't
|
31
|
+
# updated their version.rb in two years. wtf.
|
32
|
+
# comment_lines 'Rakefile', /RSpec::Core::RakeTask/
|
33
|
+
flag = 'RSpec::Core::RakeTask.new'
|
34
|
+
gsub_file 'Rakefile', /^(\s*)([^#|\n]*#{flag})/, '\1# \2'
|
35
|
+
|
36
|
+
append_to_file 'Rakefile', <<-EOS
|
37
|
+
require 'baldwin/tasks'
|
32
38
|
|
33
|
-
append_file 'Rakefile', <<-EOS
|
34
|
-
#{byline}
|
35
39
|
RSpec::Core::RakeTask.new :spec => [ :'baldwin:env', :'baldwin:rails' ]
|
36
40
|
|
37
41
|
desc "Run specs for all supported rails versions"
|
@@ -44,14 +48,21 @@ task :default => [ :'baldwin:clean', :'appraisal:install', :all ]
|
|
44
48
|
EOS
|
45
49
|
end
|
46
50
|
|
47
|
-
def
|
48
|
-
|
51
|
+
def add_baldwin_setup_to_spec_helper
|
52
|
+
prepend_to_file 'spec/spec_helper.rb', <<-EOS
|
53
|
+
require 'baldwin/setup'
|
54
|
+
# require test helpers _after_ baldwin/setup
|
55
|
+
# require 'rspec/rails'
|
56
|
+
# require 'shoulda'
|
57
|
+
EOS
|
49
58
|
end
|
50
59
|
|
51
|
-
|
60
|
+
def copy_example_rails_template
|
61
|
+
copy_file 'rails_template.rb', 'spec/rails/rails_template.rb'
|
62
|
+
end
|
52
63
|
|
53
|
-
def
|
54
|
-
|
64
|
+
def self.source_root
|
65
|
+
File.dirname __FILE__
|
55
66
|
end
|
56
67
|
end
|
57
68
|
end
|
data/lib/baldwin/tasks.rb
CHANGED
@@ -24,7 +24,7 @@ namespace :baldwin do
|
|
24
24
|
if File.exist? ENV[ 'BALDWIN_RAILS_PATH' ]
|
25
25
|
puts "Using existing #{ENV[ 'BALDWIN_RAILS_NAME' ]} app"
|
26
26
|
else
|
27
|
-
sh "bundle exec rails new #{ENV[ 'BALDWIN_RAILS_PATH' ]} -m spec/
|
27
|
+
sh "bundle exec rails new #{ENV[ 'BALDWIN_RAILS_PATH' ]} -m spec/rails/rails_template.rb"
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
data/lib/baldwin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baldwin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,6 +11,22 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2012-05-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.0.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.0.0
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: appraisal
|
16
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +50,7 @@ dependencies:
|
|
34
50
|
requirements:
|
35
51
|
- - ! '>='
|
36
52
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.
|
53
|
+
version: 0.14.6
|
38
54
|
type: :runtime
|
39
55
|
prerelease: false
|
40
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +58,7 @@ dependencies:
|
|
42
58
|
requirements:
|
43
59
|
- - ! '>='
|
44
60
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
61
|
+
version: 0.14.6
|
46
62
|
description: Bootstrap testing your rails 3 engine
|
47
63
|
email:
|
48
64
|
- jeremy.ruppel@gmail.com
|
@@ -58,6 +74,7 @@ files:
|
|
58
74
|
- baldwin.gemspec
|
59
75
|
- lib/baldwin.rb
|
60
76
|
- lib/baldwin/installer.rb
|
77
|
+
- lib/baldwin/rails_template.rb
|
61
78
|
- lib/baldwin/setup.rb
|
62
79
|
- lib/baldwin/tasks.rb
|
63
80
|
- lib/baldwin/version.rb
|