padrino-gen 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -2
- data/VERSION +1 -1
- data/lib/padrino-gen/generators/actions.rb +4 -4
- data/lib/padrino-gen/generators/app.rb +2 -1
- data/lib/padrino-gen/generators/components/mocks/mocha_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/mocks/rr_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/orms/activerecord_gen.rb +2 -1
- data/lib/padrino-gen/generators/components/orms/datamapper_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/bacon_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/riot_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/rspec_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/shoulda_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/components/tests/testspec_test_gen.rb +1 -1
- data/lib/padrino-gen/generators/templates/Gemfile.tt +12 -0
- data/lib/padrino-gen.rb +1 -0
- data/padrino-gen.gemspec +9 -9
- data/test/test_app_generator.rb +2 -2
- metadata +5 -5
- data/lib/padrino-gen/generators/app/Gemfile +0 -12
data/Rakefile
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
|
+
require 'sdoc'
|
3
4
|
|
4
5
|
GEM_VERSION = File.read(File.dirname(__FILE__) + '/VERSION')
|
5
6
|
|
@@ -17,7 +18,7 @@ begin
|
|
17
18
|
gem.add_runtime_dependency "sinatra", ">= 0.9.2"
|
18
19
|
gem.add_runtime_dependency "padrino-core", "= #{GEM_VERSION}"
|
19
20
|
gem.add_runtime_dependency "thor", ">= 0.13.0"
|
20
|
-
gem.add_runtime_dependency "bundler", ">= 0.
|
21
|
+
gem.add_runtime_dependency "bundler", ">= 0.9.3"
|
21
22
|
gem.add_development_dependency "haml", ">= 2.2.1"
|
22
23
|
gem.add_development_dependency "shoulda", ">= 0"
|
23
24
|
gem.add_development_dependency "mocha", ">= 0.9.7"
|
@@ -27,7 +28,7 @@ begin
|
|
27
28
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
28
29
|
end
|
29
30
|
Jeweler::GemcutterTasks.new
|
30
|
-
Jeweler::
|
31
|
+
Jeweler::RubyforgeTasks.new { |r| r.doc_task = :none }
|
31
32
|
rescue LoadError
|
32
33
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
33
34
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.4
|
@@ -90,7 +90,7 @@ module Padrino
|
|
90
90
|
|
91
91
|
# Adds all the specified gems into the Gemfile for bundler
|
92
92
|
# require_dependencies 'active_record'
|
93
|
-
# require_dependencies 'mocha', 'bacon', :
|
93
|
+
# require_dependencies 'mocha', 'bacon', :group => :testing
|
94
94
|
def require_dependencies(*gem_names)
|
95
95
|
options = gem_names.extract_options!
|
96
96
|
gem_names.reverse.each { |lib| insert_into_gemfile(lib, options) }
|
@@ -98,10 +98,10 @@ module Padrino
|
|
98
98
|
|
99
99
|
# Inserts a required gem into the Gemfile to add the bundler dependency
|
100
100
|
# insert_into_gemfile(name)
|
101
|
-
# insert_into_gemfile(name, :
|
101
|
+
# insert_into_gemfile(name, :group => :testing, :require => 'foo')
|
102
102
|
def insert_into_gemfile(name, options={})
|
103
|
-
after_pattern = options[:
|
104
|
-
gem_options = options.slice(:
|
103
|
+
after_pattern = options[:group] ? "#{options[:group].to_s.capitalize} requirements\n" : "Component requirements\n"
|
104
|
+
gem_options = options.slice(:group, :require).collect { |k, v| "#{k.inspect} => #{v.inspect}" }.join(", ")
|
105
105
|
include_text = "gem '#{name}'" << (gem_options.present? ? ", #{gem_options}" : "") << "\n"
|
106
106
|
options.merge!(:content => include_text, :after => after_pattern)
|
107
107
|
inject_into_file('Gemfile', options[:content], :after => options[:after])
|
@@ -40,6 +40,7 @@ module Padrino
|
|
40
40
|
self.destination_root = File.join(options[:root], name)
|
41
41
|
directory("app/", destination_root)
|
42
42
|
store_component_config('.components')
|
43
|
+
template "templates/Gemfile.tt", destination_root("Gemfile")
|
43
44
|
end
|
44
45
|
|
45
46
|
# For each component, retrieve a valid choice and then execute the associated generator
|
@@ -54,7 +55,7 @@ module Padrino
|
|
54
55
|
def bundle_dependencies
|
55
56
|
if options[:run_bundle]
|
56
57
|
say "Bundling application dependencies using bundler..."
|
57
|
-
in_root { run '
|
58
|
+
in_root { run 'bundle install' }
|
58
59
|
end
|
59
60
|
end
|
60
61
|
end
|
@@ -57,7 +57,8 @@ module Padrino
|
|
57
57
|
AR
|
58
58
|
|
59
59
|
def setup_orm
|
60
|
-
require_dependencies '
|
60
|
+
require_dependencies 'sqlite3-ruby', :require => 'sqlite3'
|
61
|
+
require_dependencies 'activerecord', :require => 'active_record'
|
61
62
|
create_file("config/database.rb", AR)
|
62
63
|
empty_directory('app/models')
|
63
64
|
end
|
@@ -23,7 +23,7 @@ module Padrino
|
|
23
23
|
DM
|
24
24
|
|
25
25
|
def setup_orm
|
26
|
-
require_dependencies 'dm-core', 'dm-validations', 'dm-aggregates', 'dm-timestamps'
|
26
|
+
require_dependencies 'data_objects', 'do_sqlite3', 'dm-core', 'dm-validations', 'dm-aggregates', 'dm-timestamps', 'dm-migrations'
|
27
27
|
create_file("config/database.rb", DM)
|
28
28
|
empty_directory('app/models')
|
29
29
|
end
|
@@ -16,7 +16,7 @@ module Padrino
|
|
16
16
|
|
17
17
|
# TODO move to spec directory to follow convention
|
18
18
|
def setup_test
|
19
|
-
require_dependencies 'rspec', :
|
19
|
+
require_dependencies 'rspec', :group => :testing, :require => 'spec'
|
20
20
|
insert_test_suite_setup RSPEC_SETUP
|
21
21
|
end
|
22
22
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
source 'http://gemcutter.org'
|
2
|
+
|
3
|
+
# Project requirements
|
4
|
+
gem 'sinatra', :require => 'sinatra/base'
|
5
|
+
gem 'padrino', "<%= Padrino.version %>"
|
6
|
+
gem 'rack-flash'
|
7
|
+
gem 'thin' # or mongrel
|
8
|
+
|
9
|
+
# Component requirements
|
10
|
+
|
11
|
+
# Testing requirements
|
12
|
+
gem 'rack-test', :require => 'rack/test', :group => :testing
|
data/lib/padrino-gen.rb
CHANGED
data/padrino-gen.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{padrino-gen}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-08}
|
13
13
|
s.default_executable = %q{padrino-gen}
|
14
14
|
s.description = %q{Generators for easily creating and building padrino applications from the console}
|
15
15
|
s.email = %q{padrinorb@gmail.com}
|
@@ -30,7 +30,6 @@ Gem::Specification.new do |s|
|
|
30
30
|
"lib/padrino-gen/generators/actions.rb",
|
31
31
|
"lib/padrino-gen/generators/app.rb",
|
32
32
|
"lib/padrino-gen/generators/app/.gitignore",
|
33
|
-
"lib/padrino-gen/generators/app/Gemfile",
|
34
33
|
"lib/padrino-gen/generators/app/app/.empty_directory",
|
35
34
|
"lib/padrino-gen/generators/app/app/app.rb.tt",
|
36
35
|
"lib/padrino-gen/generators/app/app/controllers/.empty_directory",
|
@@ -67,6 +66,7 @@ Gem::Specification.new do |s|
|
|
67
66
|
"lib/padrino-gen/generators/mailer.rb",
|
68
67
|
"lib/padrino-gen/generators/migration.rb",
|
69
68
|
"lib/padrino-gen/generators/model.rb",
|
69
|
+
"lib/padrino-gen/generators/templates/Gemfile.tt",
|
70
70
|
"lib/padrino-gen/generators/templates/controller.rb.tt",
|
71
71
|
"lib/padrino-gen/generators/templates/helper.rb.tt",
|
72
72
|
"lib/padrino-gen/generators/templates/mailer.rb.tt",
|
@@ -99,9 +99,9 @@ Gem::Specification.new do |s|
|
|
99
99
|
|
100
100
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
101
101
|
s.add_runtime_dependency(%q<sinatra>, [">= 0.9.2"])
|
102
|
-
s.add_runtime_dependency(%q<padrino-core>, ["= 0.7.
|
102
|
+
s.add_runtime_dependency(%q<padrino-core>, ["= 0.7.4"])
|
103
103
|
s.add_runtime_dependency(%q<thor>, [">= 0.13.0"])
|
104
|
-
s.add_runtime_dependency(%q<bundler>, [">= 0.
|
104
|
+
s.add_runtime_dependency(%q<bundler>, [">= 0.9.3"])
|
105
105
|
s.add_development_dependency(%q<haml>, [">= 2.2.1"])
|
106
106
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
107
107
|
s.add_development_dependency(%q<mocha>, [">= 0.9.7"])
|
@@ -110,9 +110,9 @@ Gem::Specification.new do |s|
|
|
110
110
|
s.add_development_dependency(%q<fakeweb>, [">= 1.2.3"])
|
111
111
|
else
|
112
112
|
s.add_dependency(%q<sinatra>, [">= 0.9.2"])
|
113
|
-
s.add_dependency(%q<padrino-core>, ["= 0.7.
|
113
|
+
s.add_dependency(%q<padrino-core>, ["= 0.7.4"])
|
114
114
|
s.add_dependency(%q<thor>, [">= 0.13.0"])
|
115
|
-
s.add_dependency(%q<bundler>, [">= 0.
|
115
|
+
s.add_dependency(%q<bundler>, [">= 0.9.3"])
|
116
116
|
s.add_dependency(%q<haml>, [">= 2.2.1"])
|
117
117
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
118
118
|
s.add_dependency(%q<mocha>, [">= 0.9.7"])
|
@@ -122,9 +122,9 @@ Gem::Specification.new do |s|
|
|
122
122
|
end
|
123
123
|
else
|
124
124
|
s.add_dependency(%q<sinatra>, [">= 0.9.2"])
|
125
|
-
s.add_dependency(%q<padrino-core>, ["= 0.7.
|
125
|
+
s.add_dependency(%q<padrino-core>, ["= 0.7.4"])
|
126
126
|
s.add_dependency(%q<thor>, [">= 0.13.0"])
|
127
|
-
s.add_dependency(%q<bundler>, [">= 0.
|
127
|
+
s.add_dependency(%q<bundler>, [">= 0.9.3"])
|
128
128
|
s.add_dependency(%q<haml>, [">= 2.2.1"])
|
129
129
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
130
130
|
s.add_dependency(%q<mocha>, [">= 0.9.7"])
|
data/test/test_app_generator.rb
CHANGED
@@ -105,7 +105,7 @@ class TestAppGenerator < Test::Unit::TestCase
|
|
105
105
|
should "properly generate for activerecord" do
|
106
106
|
buffer = silence_logger { @app.start(['sample_app', '--root=/tmp', '--orm=activerecord', '--script=none']) }
|
107
107
|
assert_match /Applying.*?activerecord.*?orm/, buffer
|
108
|
-
assert_match_in_file(/gem 'active_record
|
108
|
+
assert_match_in_file(/gem 'activerecord', :require => "active_record"/, '/tmp/sample_app/Gemfile')
|
109
109
|
assert_match_in_file(/ActiveRecord::Base.establish_connection/, '/tmp/sample_app/config/database.rb')
|
110
110
|
assert_dir_exists('/tmp/sample_app/app/models')
|
111
111
|
end
|
@@ -194,7 +194,7 @@ class TestAppGenerator < Test::Unit::TestCase
|
|
194
194
|
should "properly generate for rspec" do
|
195
195
|
buffer = silence_logger { @app.start(['sample_app', '--root=/tmp', '--test=rspec', '--script=none']) }
|
196
196
|
assert_match /Applying.*?rspec.*?test/, buffer
|
197
|
-
assert_match_in_file(/gem 'rspec'.*?:
|
197
|
+
assert_match_in_file(/gem 'rspec'.*?:require => "spec"/, '/tmp/sample_app/Gemfile')
|
198
198
|
assert_match_in_file(/PADRINO_ENV = 'test' unless defined\?\(PADRINO_ENV\)/, '/tmp/sample_app/test/test_config.rb')
|
199
199
|
assert_match_in_file(/Spec::Runner/, '/tmp/sample_app/test/test_config.rb')
|
200
200
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Padrino Team
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2010-02-
|
15
|
+
date: 2010-02-08 00:00:00 +01:00
|
16
16
|
default_executable: padrino-gen
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
requirements:
|
34
34
|
- - "="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.7.
|
36
|
+
version: 0.7.4
|
37
37
|
version:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: thor
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
56
|
+
version: 0.9.3
|
57
57
|
version:
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: haml
|
@@ -136,7 +136,6 @@ files:
|
|
136
136
|
- lib/padrino-gen/generators/actions.rb
|
137
137
|
- lib/padrino-gen/generators/app.rb
|
138
138
|
- lib/padrino-gen/generators/app/.gitignore
|
139
|
-
- lib/padrino-gen/generators/app/Gemfile
|
140
139
|
- lib/padrino-gen/generators/app/app/.empty_directory
|
141
140
|
- lib/padrino-gen/generators/app/app/app.rb.tt
|
142
141
|
- lib/padrino-gen/generators/app/app/controllers/.empty_directory
|
@@ -173,6 +172,7 @@ files:
|
|
173
172
|
- lib/padrino-gen/generators/mailer.rb
|
174
173
|
- lib/padrino-gen/generators/migration.rb
|
175
174
|
- lib/padrino-gen/generators/model.rb
|
175
|
+
- lib/padrino-gen/generators/templates/Gemfile.tt
|
176
176
|
- lib/padrino-gen/generators/templates/controller.rb.tt
|
177
177
|
- lib/padrino-gen/generators/templates/helper.rb.tt
|
178
178
|
- lib/padrino-gen/generators/templates/mailer.rb.tt
|
@@ -1,12 +0,0 @@
|
|
1
|
-
clear_sources
|
2
|
-
source 'http://gemcutter.org'
|
3
|
-
|
4
|
-
# Project requirements
|
5
|
-
gem 'sinatra', :require_as => 'sinatra/base'
|
6
|
-
gem 'padrino'
|
7
|
-
gem 'rack-flash'
|
8
|
-
|
9
|
-
# Component requirements
|
10
|
-
|
11
|
-
# Testing requirements
|
12
|
-
gem 'rack-test', :require_as => 'rack/test', :only => :testing
|