padrino-gen 0.14.1.1 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YjI5ZjIxMmQwYzJhMGIyMmQ4N2I2NTBmZmY4OGQwYTQ3MzYxZDE5NQ==
5
- data.tar.gz: !binary |-
6
- ZGU1Yzg5NjI2NDBkNjQzNjJlODc0ODY4MjQ5ZDZjZmNlZTBlNmQ5Yw==
2
+ SHA256:
3
+ metadata.gz: 9897984eee6550c278a48190ada56e7d88d38cec9b6a912ce8136b911a8578f7
4
+ data.tar.gz: cc0de388292f104d491401feffbf673000b439728696ac4cd012a1fbba668bfd
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjEwMmQ3OWVhOTA1ODBiYWU2ZWUyNWFhMzZiNjkxNzQ3MjExZGE1MDY3ZWQ4
10
- ZTE0MTYzYjdlMzlkZTZjYmVmZjYyYTRlY2JlM2MxZGI1YTEyNTQ0Mjc3OTQy
11
- M2ZjOTJlNzZkNWJiNTJiNjc3MTRjNzNlMDJhOGYyMjk4OTNkOGM=
12
- data.tar.gz: !binary |-
13
- YWM1OGU1NmIzZTc1NzlhNjIxNTdjNmRiMDFhOTZkMzRlOWEzNTRhZDM5YzJk
14
- MzgyMjZmOGYyNDRlYTNjYmI4MzIyNTg1Y2ZmNDU4YzMwNWM1ODE5N2FmZGZh
15
- ZDFiNGQ0MDFhMmY0ZWI2YWY3NjNlYWQyMTQ1ODE5Zjg2NGRmNDk=
6
+ metadata.gz: 1c5f835446e50a8009cf55c37439fb0134faa3b1f2ea5fd14e342fbfe6688b4300a45f49a7efd7281a7af4aebfa471ba5eeac0061c8c2ac3c7d3aba861b664ba
7
+ data.tar.gz: e3cc0d72979f835fdaf9b04672eb7b0775cff146a65816b8b336bb340763d7f97dd292e46160ac403dc8a07ac294a91b5e5d4fe80a7cd675d2c9bdd0205725b6
@@ -13,6 +13,6 @@ module Padrino
13
13
  #
14
14
  def self.bin_gen(*args)
15
15
  @_padrino_gen_bin ||= [Padrino.ruby_command, File.expand_path("../../../bin/padrino-gen", __FILE__)]
16
- system args.unshift(@_padrino_gen_bin).join(" ")
16
+ system *@_padrino_gen_bin, *args
17
17
  end
18
18
  end
@@ -145,11 +145,11 @@ module Padrino
145
145
  # resolve_valid_choice(:mock)
146
146
  #
147
147
  def resolve_valid_choice(component)
148
- available_string = self.class.available_choices_for(component).join(", ")
148
+ choices = self.class.available_choices_for(component).map(&:to_s)
149
149
  choice = options[component]
150
150
  until valid_choice?(component, choice)
151
151
  say("Option for --#{component} '#{choice}' is not available.", :red)
152
- choice = ask("Please enter a valid option for #{component} (#{available_string}):")
152
+ choice = ask("Please enter a valid option for #{component}:", :limited_to => choices)
153
153
  end
154
154
  choice
155
155
  end
@@ -181,9 +181,9 @@ module Padrino
181
181
  # @example
182
182
  # store_component_config('/foo/bar')
183
183
  #
184
- def store_component_config(destination)
184
+ def store_component_config(destination, opts = {})
185
185
  components = @_components || options
186
- create_file(destination) do
186
+ create_file(destination, opts) do
187
187
  self.class.component_types.inject({}) { |result, comp|
188
188
  result[comp] = components[comp].to_s; result
189
189
  }.to_yaml
@@ -435,29 +435,6 @@ WARNING
435
435
  in_root { run 'bundle install --binstubs' }
436
436
  end
437
437
 
438
- ##
439
- # Ask something to the user and receives a response.
440
- #
441
- # @param [String] statement
442
- # String of statement to display for input.
443
- # @param [String] default
444
- # Default value for input.
445
- # @param [String] color
446
- # Name of color to display input.
447
- #auto_locale
448
- # @return [String] Input value
449
- #
450
- # @example
451
- # ask("What is your name?")
452
- # ask("Path for ruby", "/usr/local/bin/ruby") => "Path for ruby (leave blank for /usr/local/bin/ruby):"
453
- #
454
- def ask(statement, default=nil, color=nil)
455
- default_text = default ? " (leave blank for #{default}):" : nil
456
- say("#{statement}#{default_text} ", color)
457
- result = $stdin.gets.strip
458
- result.empty? ? default : result
459
- end
460
-
461
438
  ##
462
439
  # Raise SystemExit if the app does not exist.
463
440
  #
@@ -71,8 +71,8 @@ module Padrino
71
71
  direction, table_name = migration_scan[0].downcase, migration_scan[1].downcase.pluralize if migration_scan.any?
72
72
  tuples = direction ? columns.map { |value| value.split(":") } : []
73
73
  tuples.map! { |field, kind| kind =~ /datetime/i ? [field, 'DateTime'] : [field, kind] }
74
- add_columns = tuples.map(&options[:add]).join("\n ")
75
- remove_columns = tuples.map(&options[:remove]).join("\n ")
74
+ add_columns = tuples.map(&options[:add]).join("\n ")
75
+ remove_columns = tuples.map(&options[:remove]).join("\n ")
76
76
  forward_text = change_format.gsub(/!TABLE!/, table_name).gsub(/!COLUMNS!/, add_columns) if tuples.any?
77
77
  back_text = change_format.gsub(/!TABLE!/, table_name).gsub(/!COLUMNS!/, remove_columns) if tuples.any?
78
78
  contents = options[:base].dup.gsub(/\s{4}!UP!\n/m, (direction == 'add' ? forward_text.to_s : back_text.to_s))
@@ -111,29 +111,38 @@ MIDDLEWARE
111
111
  def setup_orm
112
112
  ar = AR
113
113
  db = @project_name.underscore
114
- # We're now defaulting to mysql2 since mysql is deprecated
115
- case options[:adapter]
116
- when 'mysql-gem'
117
- ar.sub! /!DB_DEVELOPMENT!/, MYSQL.sub(/!DB_NAME!/,"'#{db}_development'")
118
- ar.sub! /!DB_PRODUCTION!/, MYSQL.sub(/!DB_NAME!/,"'#{db}_production'")
119
- ar.sub! /!DB_TEST!/, MYSQL.sub(/!DB_NAME!/,"'#{db}_test'")
120
- require_dependencies 'mysql', :version => "~> 2.8.1"
121
- when 'mysql', 'mysql2'
122
- ar.sub! /!DB_DEVELOPMENT!/, MYSQL2.sub(/!DB_NAME!/,"'#{db}_development'")
123
- ar.sub! /!DB_PRODUCTION!/, MYSQL2.sub(/!DB_NAME!/,"'#{db}_production'")
124
- ar.sub! /!DB_TEST!/, MYSQL2.sub(/!DB_NAME!/,"'#{db}_test'")
125
- require_dependencies 'mysql2'
126
- when 'postgres'
127
- ar.sub! /!DB_DEVELOPMENT!/, POSTGRES.sub(/!DB_NAME!/,"'#{db}_development'")
128
- ar.sub! /!DB_PRODUCTION!/, POSTGRES.sub(/!DB_NAME!/,"'#{db}_production'")
129
- ar.sub! /!DB_TEST!/, POSTGRES.sub(/!DB_NAME!/,"'#{db}_test'")
130
- require_dependencies 'pg'
131
- else
132
- ar.sub! /!DB_DEVELOPMENT!/, SQLITE.sub(/!DB_NAME!/,"Padrino.root('db', '#{db}_development.db')")
133
- ar.sub! /!DB_PRODUCTION!/, SQLITE.sub(/!DB_NAME!/,"Padrino.root('db', '#{db}_production.db')")
134
- ar.sub! /!DB_TEST!/, SQLITE.sub(/!DB_NAME!/,"Padrino.root('db', '#{db}_test.db')")
135
- require_dependencies 'sqlite3'
114
+
115
+ begin
116
+ case adapter ||= options[:adapter]
117
+ when 'mysql-gem'
118
+ ar.sub! /!DB_DEVELOPMENT!/, MYSQL.sub(/!DB_NAME!/,"'#{db}_development'")
119
+ ar.sub! /!DB_PRODUCTION!/, MYSQL.sub(/!DB_NAME!/,"'#{db}_production'")
120
+ ar.sub! /!DB_TEST!/, MYSQL.sub(/!DB_NAME!/,"'#{db}_test'")
121
+ require_dependencies 'mysql', :version => "~> 2.8.1"
122
+ when 'mysql', 'mysql2'
123
+ ar.sub! /!DB_DEVELOPMENT!/, MYSQL2.sub(/!DB_NAME!/,"'#{db}_development'")
124
+ ar.sub! /!DB_PRODUCTION!/, MYSQL2.sub(/!DB_NAME!/,"'#{db}_production'")
125
+ ar.sub! /!DB_TEST!/, MYSQL2.sub(/!DB_NAME!/,"'#{db}_test'")
126
+ require_dependencies 'mysql2'
127
+ when 'postgres'
128
+ ar.sub! /!DB_DEVELOPMENT!/, POSTGRES.sub(/!DB_NAME!/,"'#{db}_development'")
129
+ ar.sub! /!DB_PRODUCTION!/, POSTGRES.sub(/!DB_NAME!/,"'#{db}_production'")
130
+ ar.sub! /!DB_TEST!/, POSTGRES.sub(/!DB_NAME!/,"'#{db}_test'")
131
+ require_dependencies 'pg'
132
+ when 'sqlite'
133
+ ar.sub! /!DB_DEVELOPMENT!/, SQLITE.sub(/!DB_NAME!/,"Padrino.root('db', '#{db}_development.db')")
134
+ ar.sub! /!DB_PRODUCTION!/, SQLITE.sub(/!DB_NAME!/,"Padrino.root('db', '#{db}_production.db')")
135
+ ar.sub! /!DB_TEST!/, SQLITE.sub(/!DB_NAME!/,"Padrino.root('db', '#{db}_test.db')")
136
+ require_dependencies 'sqlite3'
137
+ else
138
+ say "Failed to generate `config/database.rb` for ORM adapter `#{options[:adapter]}`", :red
139
+ fail ArgumentError
140
+ end
141
+ rescue ArgumentError
142
+ adapter = ask("Please, choose a proper adapter:", :limited_to => %w[mysql mysql2 mysql-gem postgres sqlite])
143
+ retry
136
144
  end
145
+
137
146
  require_dependencies 'activerecord', :require => 'active_record', :version => ">= 3.1"
138
147
  create_file("config/database.rb", ar)
139
148
  middleware :connection_pool_management, CONNECTION_POOL_MIDDLEWARE
@@ -152,7 +161,19 @@ def create_model_file(name, options={})
152
161
  create_file(model_path, model_contents,:skip => true)
153
162
  end
154
163
 
164
+ if defined?(ActiveRecord::Migration) && ActiveRecord::Migration.respond_to?(:[])
165
+ AR_MIGRATION = (<<-MIGRATION) unless defined?(AR_MIGRATION)
166
+ class !FILECLASS! < ActiveRecord::Migration[#{ActiveRecord::Migration.current_version}]
167
+ def self.up
168
+ !UP!
169
+ end
155
170
 
171
+ def self.down
172
+ !DOWN!
173
+ end
174
+ end
175
+ MIGRATION
176
+ else
156
177
  AR_MIGRATION = (<<-MIGRATION) unless defined?(AR_MIGRATION)
157
178
  class !FILECLASS! < ActiveRecord::Migration
158
179
  def self.up
@@ -164,6 +185,7 @@ class !FILECLASS! < ActiveRecord::Migration
164
185
  end
165
186
  end
166
187
  MIGRATION
188
+ end
167
189
 
168
190
  AR_MODEL_UP_MG = (<<-MIGRATION).gsub(/^/,' ') unless defined?(AR_MODEL_UP_MG)
169
191
  create_table :!TABLE! do |t|
@@ -68,22 +68,31 @@ def setup_orm
68
68
  dm-timestamps
69
69
  dm-validations
70
70
  ).each { |dep| require_dependencies dep }
71
- require_dependencies case options[:adapter]
71
+
72
+ begin
73
+ case adapter ||= options[:adapter]
72
74
  when 'mysql', 'mysql2'
73
75
  dm.gsub!(/!DB_DEVELOPMENT!/,"\"mysql://root@localhost/#{db}_development\"")
74
76
  dm.gsub!(/!DB_PRODUCTION!/,"\"mysql://root@localhost/#{db}_production\"")
75
77
  dm.gsub!(/!DB_TEST!/,"\"mysql://root@localhost/#{db}_test\"")
76
- 'dm-mysql-adapter'
78
+ require_dependencies 'dm-mysql-adapter'
77
79
  when 'postgres'
78
80
  dm.gsub!(/!DB_DEVELOPMENT!/,"\"postgres://root@localhost/#{db}_development\"")
79
81
  dm.gsub!(/!DB_PRODUCTION!/,"\"postgres://root@localhost/#{db}_production\"")
80
82
  dm.gsub!(/!DB_TEST!/,"\"postgres://root@localhost/#{db}_test\"")
81
- 'dm-postgres-adapter'
82
- else
83
+ require_dependencies 'dm-postgres-adapter'
84
+ when 'sqlite'
83
85
  dm.gsub!(/!DB_DEVELOPMENT!/,"\"sqlite3://\" + Padrino.root('db', \"#{db}_development.db\")")
84
86
  dm.gsub!(/!DB_PRODUCTION!/,"\"sqlite3://\" + Padrino.root('db', \"#{db}_production.db\")")
85
87
  dm.gsub!(/!DB_TEST!/,"\"sqlite3://\" + Padrino.root('db', \"#{db}_test.db\")")
86
- 'dm-sqlite-adapter'
88
+ require_dependencies 'dm-sqlite-adapter'
89
+ else
90
+ say "Failed to generate `config/database.rb` for ORM adapter `#{options[:adapter]}`", :red
91
+ fail ArgumentError
92
+ end
93
+ rescue ArgumentError
94
+ adapter = ask("Please, choose a proper adapter:", :limited_to => %w[mysql mysql2 postgres sqlite])
95
+ retry
87
96
  end
88
97
 
89
98
  create_file("config/database.rb", dm)
@@ -111,28 +111,38 @@ MIDDLEWARE
111
111
  def setup_orm
112
112
  ar = MR
113
113
  db = @project_name.underscore
114
- case options[:adapter]
115
- when 'mysql-gem'
116
- ar.gsub! /!DB_DEVELOPMENT!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_development'")
117
- ar.gsub! /!DB_PRODUCTION!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_production'")
118
- ar.gsub! /!DB_TEST!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_test'")
119
- require_dependencies 'mysql', :version => "~> 2.8.1"
120
- when 'mysql', 'mysql2'
121
- ar.gsub! /!DB_DEVELOPMENT!/, MYSQL2.gsub(/!DB_NAME!/,"'#{db}_development'")
122
- ar.gsub! /!DB_PRODUCTION!/, MYSQL2.gsub(/!DB_NAME!/,"'#{db}_production'")
123
- ar.gsub! /!DB_TEST!/, MYSQL2.gsub(/!DB_NAME!/,"'#{db}_test'")
124
- require_dependencies 'mysql2'
125
- when 'postgres'
126
- ar.gsub! /!DB_DEVELOPMENT!/, POSTGRES.gsub(/!DB_NAME!/,"'#{db}_development'")
127
- ar.gsub! /!DB_PRODUCTION!/, POSTGRES.gsub(/!DB_NAME!/,"'#{db}_production'")
128
- ar.gsub! /!DB_TEST!/, POSTGRES.gsub(/!DB_NAME!/,"'#{db}_test'")
129
- require_dependencies 'pg'
130
- else
131
- ar.gsub! /!DB_DEVELOPMENT!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', '#{db}_development.db')")
132
- ar.gsub! /!DB_PRODUCTION!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', '#{db}_production.db')")
133
- ar.gsub! /!DB_TEST!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', '#{db}_test.db')")
134
- require_dependencies 'sqlite3'
114
+
115
+ begin
116
+ case adapter ||= options[:adapter]
117
+ when 'mysql-gem'
118
+ ar.gsub! /!DB_DEVELOPMENT!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_development'")
119
+ ar.gsub! /!DB_PRODUCTION!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_production'")
120
+ ar.gsub! /!DB_TEST!/, MYSQL.gsub(/!DB_NAME!/,"'#{db}_test'")
121
+ require_dependencies 'mysql', :version => "~> 2.8.1"
122
+ when 'mysql', 'mysql2'
123
+ ar.gsub! /!DB_DEVELOPMENT!/, MYSQL2.gsub(/!DB_NAME!/,"'#{db}_development'")
124
+ ar.gsub! /!DB_PRODUCTION!/, MYSQL2.gsub(/!DB_NAME!/,"'#{db}_production'")
125
+ ar.gsub! /!DB_TEST!/, MYSQL2.gsub(/!DB_NAME!/,"'#{db}_test'")
126
+ require_dependencies 'mysql2'
127
+ when 'postgres'
128
+ ar.gsub! /!DB_DEVELOPMENT!/, POSTGRES.gsub(/!DB_NAME!/,"'#{db}_development'")
129
+ ar.gsub! /!DB_PRODUCTION!/, POSTGRES.gsub(/!DB_NAME!/,"'#{db}_production'")
130
+ ar.gsub! /!DB_TEST!/, POSTGRES.gsub(/!DB_NAME!/,"'#{db}_test'")
131
+ require_dependencies 'pg'
132
+ when 'sqlite'
133
+ ar.gsub! /!DB_DEVELOPMENT!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', '#{db}_development.db')")
134
+ ar.gsub! /!DB_PRODUCTION!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', '#{db}_production.db')")
135
+ ar.gsub! /!DB_TEST!/, SQLITE.gsub(/!DB_NAME!/,"Padrino.root('db', '#{db}_test.db')")
136
+ require_dependencies 'sqlite3'
137
+ else
138
+ say "Failed to generate `config/database.rb` for ORM adapter `#{options[:adapter]}`", :red
139
+ fail ArgumentError
140
+ end
141
+ rescue ArgumentError
142
+ adapter = ask("Please, choose a proper adapter:", :limited_to => %w[mysql mysql2 mysql-gem postgres sqlite])
143
+ retry
135
144
  end
145
+
136
146
  require_dependencies 'mini_record'
137
147
  create_file('config/database.rb', ar)
138
148
  insert_hook('ActiveRecord::Base.auto_upgrade!', :after_load)
@@ -1,5 +1,4 @@
1
1
  SEQUEL = (<<-SEQUEL) unless defined?(SEQUEL)
2
- Sequel::Model.plugin(:schema)
3
2
  Sequel::Model.raise_on_save_failure = false # Do not throw exceptions on failure
4
3
  Sequel::Model.db = case Padrino.env
5
4
  when :development then Sequel.connect(!DB_DEVELOPMENT!, :loggers => [logger])
@@ -12,32 +11,38 @@ def setup_orm
12
11
  sequel = SEQUEL
13
12
  db = @project_name.underscore
14
13
  require_dependencies 'sequel'
15
- case options[:adapter]
16
- when 'mysql-gem'
17
- sequel.gsub!(/!DB_DEVELOPMENT!/, "\"mysql://localhost/#{db}_development\"")
18
- sequel.gsub!(/!DB_PRODUCTION!/, "\"mysql://localhost/#{db}_production\"")
19
- sequel.gsub!(/!DB_TEST!/,"\"mysql://localhost/#{db}_test\"")
20
- require_dependencies 'mysql', :version => "~> 2.8.1"
21
- 'mysql'
22
- when 'mysql', 'mysql2'
23
- sequel.gsub!(/!DB_DEVELOPMENT!/, "\"mysql2://localhost/#{db}_development\"")
24
- sequel.gsub!(/!DB_PRODUCTION!/, "\"mysql2://localhost/#{db}_production\"")
25
- sequel.gsub!(/!DB_TEST!/,"\"mysql2://localhost/#{db}_test\"")
26
- require_dependencies 'mysql2'
27
- 'mysql2'
28
- when 'postgres'
29
- sequel.gsub!(/!DB_DEVELOPMENT!/, "\"postgres://localhost/#{db}_development\"")
30
- sequel.gsub!(/!DB_PRODUCTION!/, "\"postgres://localhost/#{db}_production\"")
31
- sequel.gsub!(/!DB_TEST!/,"\"postgres://localhost/#{db}_test\"")
32
- require_dependencies 'pg'
33
- 'pg'
34
- else
35
- sequel.gsub!(/!DB_DEVELOPMENT!/,"\"sqlite://db/#{db}_development.db\"")
36
- sequel.gsub!(/!DB_PRODUCTION!/, "\"sqlite://db/#{db}_production.db\"")
37
- sequel.gsub!(/!DB_TEST!/, "\"sqlite://db/#{db}_test.db\"")
38
- require_dependencies 'sqlite3'
39
- 'sqlite3'
14
+
15
+ begin
16
+ case adapter ||= options[:adapter]
17
+ when 'mysql-gem'
18
+ sequel.gsub!(/!DB_DEVELOPMENT!/, "\"mysql://localhost/#{db}_development\"")
19
+ sequel.gsub!(/!DB_PRODUCTION!/, "\"mysql://localhost/#{db}_production\"")
20
+ sequel.gsub!(/!DB_TEST!/,"\"mysql://localhost/#{db}_test\"")
21
+ require_dependencies 'mysql', :version => "~> 2.8.1"
22
+ when 'mysql', 'mysql2'
23
+ sequel.gsub!(/!DB_DEVELOPMENT!/, "\"mysql2://localhost/#{db}_development\"")
24
+ sequel.gsub!(/!DB_PRODUCTION!/, "\"mysql2://localhost/#{db}_production\"")
25
+ sequel.gsub!(/!DB_TEST!/,"\"mysql2://localhost/#{db}_test\"")
26
+ require_dependencies 'mysql2'
27
+ when 'postgres'
28
+ sequel.gsub!(/!DB_DEVELOPMENT!/, "\"postgres://localhost/#{db}_development\"")
29
+ sequel.gsub!(/!DB_PRODUCTION!/, "\"postgres://localhost/#{db}_production\"")
30
+ sequel.gsub!(/!DB_TEST!/,"\"postgres://localhost/#{db}_test\"")
31
+ require_dependencies 'pg'
32
+ when 'sqlite'
33
+ sequel.gsub!(/!DB_DEVELOPMENT!/,"\"sqlite://db/#{db}_development.db\"")
34
+ sequel.gsub!(/!DB_PRODUCTION!/, "\"sqlite://db/#{db}_production.db\"")
35
+ sequel.gsub!(/!DB_TEST!/, "\"sqlite://db/#{db}_test.db\"")
36
+ require_dependencies 'sqlite3'
37
+ else
38
+ say "Failed to generate `config/database.rb` for ORM adapter `#{options[:adapter]}`", :red
39
+ fail ArgumentError
40
+ end
41
+ rescue ArgumentError
42
+ adapter = ask("Please, choose a proper adapter:", :limited_to => %w[mysql mysql2 mysql-gem postgres sqlite])
43
+ retry
40
44
  end
45
+
41
46
  create_file("config/database.rb", sequel)
42
47
  empty_directory('db/migrate')
43
48
  end
@@ -91,7 +91,7 @@ module Padrino
91
91
  choice = @_components[comp] = resolve_valid_choice(comp)
92
92
  execute_component_setup(comp, choice)
93
93
  end
94
- store_component_config('.components')
94
+ store_component_config('.components', :force => true)
95
95
  store_component_choice(:namespace, @project_name)
96
96
  store_component_choice(:migration_format, options[:migration_format])
97
97
  end
@@ -1,4 +1,5 @@
1
1
  require 'fileutils'
2
+ require 'open-uri'
2
3
 
3
4
  module Padrino
4
5
  module Generators
@@ -125,14 +126,18 @@ module Padrino
125
126
  when template_file =~ %r{^https?://} && template_file !~ /gist/
126
127
  template_file
127
128
  when template_file =~ /gist/ && template_file !~ /raw/
128
- raw_link, _ = *open(template_file).read.scan(/<a\s+href\s?\=\"(.*?)\"\>raw/)
129
+ raw_link, _ = *open(template_file) { |io| io.read.scan(/<a\s+href\s?\=\"(.*?)\"\>raw/) }
129
130
  raw_link ? "https://gist.github.com#{raw_link[0]}" : template_file
130
131
  when File.extname(template_file).empty? # referencing official plugin (i.e hoptoad)
131
132
  "https://raw.github.com/padrino/padrino-recipes/master/#{kind.to_s.pluralize}/#{template_file}_#{kind}.rb"
132
133
  else # local file on system
133
134
  File.expand_path(template_file)
134
135
  end
135
- self.apply(template_path) rescue say("The template at #{template_path} could not be found!", :red)
136
+ begin
137
+ self.apply(template_path)
138
+ rescue => error
139
+ say("The template at #{template_path} could not be loaded: #{error.message}", :red)
140
+ end
136
141
  end
137
142
  end
138
143
  end
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Padrino supports Ruby version 1.9 and later
3
+ # Padrino supports Ruby version 2.2.2 and later
4
4
  # ruby '<%= RUBY_VERSION.to_s %>'
5
5
 
6
6
  # Distribute your app as a gem
@@ -6,5 +6,3 @@ PadrinoTasks.use(:database)
6
6
  PadrinoTasks.use(<%= options[:orm].to_sym.inspect %>)
7
7
  <%- end -%>
8
8
  PadrinoTasks.init
9
-
10
- task :default => :test
@@ -8,7 +8,7 @@
8
8
  **/
9
9
 
10
10
  $(function(){
11
- $('form').on('submit', function(e) {
11
+ $(document).on('submit', 'form', function(e) {
12
12
  var element = $(this), message = element.data('confirm');
13
13
  if (message && !confirm(message)) { return false; }
14
14
  if (element.data('remote') == true) {
@@ -12,7 +12,7 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
12
12
  namespace :create do
13
13
  desc "Create all the local databases defined in config/database.yml"
14
14
  task :all => :skeleton do
15
- ActiveRecord::Base.configurations.each_value do |config|
15
+ with_all_databases do |config|
16
16
  # Skip entries that don't have a database key, such as the first entry here:
17
17
  #
18
18
  # defaults: &defaults
@@ -33,7 +33,9 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
33
33
 
34
34
  desc "Creates the database defined in config/database.yml for the current Padrino.env"
35
35
  task :create => :skeleton do
36
- create_database(ActiveRecord::Base.configurations.with_indifferent_access[Padrino.env])
36
+ with_database(Padrino.env) do |config|
37
+ create_database(config)
38
+ end
37
39
  end
38
40
 
39
41
  def create_database(config)
@@ -90,7 +92,7 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
90
92
  namespace :drop do
91
93
  desc "Drops all the local databases defined in config/database.yml"
92
94
  task :all => :skeleton do
93
- ActiveRecord::Base.configurations.each_value do |config|
95
+ with_all_databases do |config|
94
96
  # Skip entries that don't have a database key
95
97
  next unless config[:database]
96
98
  begin
@@ -105,11 +107,12 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
105
107
 
106
108
  desc "Drops the database for the current Padrino.env"
107
109
  task :drop => :skeleton do
108
- config = ActiveRecord::Base.configurations.with_indifferent_access[Padrino.env || :development]
109
- begin
110
- drop_database(config)
111
- rescue StandardError => e
112
- catch_error(:drop, e, config)
110
+ with_database(Padrino.env || :development) do |config|
111
+ begin
112
+ drop_database(config)
113
+ rescue StandardError => e
114
+ catch_error(:drop, e, config)
115
+ end
113
116
  end
114
117
  end
115
118
 
@@ -124,7 +127,15 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
124
127
  desc "Migrate the database through scripts in db/migrate and update db/schema.rb by invoking ar:schema:dump. Target specific version with MIGRATION_VERSION=x. Turn off output with VERBOSE=false."
125
128
  task :migrate => :skeleton do
126
129
  ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
127
- ActiveRecord::Migrator.migrate("db/migrate/", env_migration_version)
130
+
131
+ if less_than_active_record_5_2?
132
+ ActiveRecord::Migrator.migrate("db/migrate/", env_migration_version)
133
+ elsif less_than_active_record_6_0?
134
+ ActiveRecord::MigrationContext.new("db/migrate/").migrate(env_migration_version)
135
+ else
136
+ ActiveRecord::MigrationContext.new("db/migrate/", ActiveRecord::SchemaMigration).migrate(env_migration_version)
137
+ end
138
+
128
139
  Rake::Task["ar:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
129
140
  end
130
141
 
@@ -161,28 +172,30 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
161
172
 
162
173
  desc "Retrieves the charset for the current environment's database"
163
174
  task :charset => :skeleton do
164
- config = ActiveRecord::Base.configurations.with_indifferent_access[Padrino.env || :development]
165
- case config[:adapter]
166
- when 'mysql', 'mysql2', 'em_mysql2', 'jdbcmysql'
167
- ActiveRecord::Base.establish_connection(config)
168
- puts ActiveRecord::Base.connection.charset
169
- when 'postgresql'
170
- ActiveRecord::Base.establish_connection(config)
171
- puts ActiveRecord::Base.connection.encoding
172
- else
173
- puts 'Sorry, your database adapter is not supported yet, feel free to submit a patch.'
175
+ with_database(Padrino.env || :development) do |config|
176
+ case config[:adapter]
177
+ when 'mysql', 'mysql2', 'em_mysql2', 'jdbcmysql'
178
+ ActiveRecord::Base.establish_connection(config)
179
+ puts ActiveRecord::Base.connection.charset
180
+ when 'postgresql'
181
+ ActiveRecord::Base.establish_connection(config)
182
+ puts ActiveRecord::Base.connection.encoding
183
+ else
184
+ puts 'Sorry, your database adapter is not supported yet, feel free to submit a patch.'
185
+ end
174
186
  end
175
187
  end
176
188
 
177
189
  desc "Retrieves the collation for the current environment's database."
178
190
  task :collation => :skeleton do
179
- config = ActiveRecord::Base.configurations.with_indifferent_access[Padrino.env || :development]
180
- case config[:adapter]
181
- when 'mysql', 'mysql2', 'em_mysql2', 'jdbcmysql'
182
- ActiveRecord::Base.establish_connection(config)
183
- puts ActiveRecord::Base.connection.collation
184
- else
185
- puts 'sorry, your database adapter is not supported yet, feel free to submit a patch'
191
+ with_database(Padrino.env || :development) do |config|
192
+ case config[:adapter]
193
+ when 'mysql', 'mysql2', 'em_mysql2', 'jdbcmysql'
194
+ ActiveRecord::Base.establish_connection(config)
195
+ puts ActiveRecord::Base.connection.collation
196
+ else
197
+ puts 'sorry, your database adapter is not supported yet, feel free to submit a patch'
198
+ end
186
199
  end
187
200
  end
188
201
 
@@ -194,7 +207,14 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
194
207
  desc "Raises an error if there are pending migrations."
195
208
  task :abort_if_pending_migrations => :skeleton do
196
209
  if defined? ActiveRecord
197
- pending_migrations = ActiveRecord::Migrator.open(ActiveRecord::Migrator.migrations_paths).pending_migrations
210
+ pending_migrations =
211
+ if less_than_active_record_5_2?
212
+ ActiveRecord::Migrator.open(ActiveRecord::Migrator.migrations_paths).pending_migrations
213
+ elsif less_than_active_record_6_0?
214
+ ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths).open.pending_migrations
215
+ else
216
+ ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths, ActiveRecord::SchemaMigration).open.pending_migrations
217
+ end
198
218
 
199
219
  if pending_migrations.any?
200
220
  puts "You have #{pending_migrations.size} pending migrations:"
@@ -233,36 +253,37 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
233
253
  namespace :structure do
234
254
  desc "Dump the database structure to a SQL file."
235
255
  task :dump => :skeleton do
236
- config = ActiveRecord::Base.configurations.with_indifferent_access[Padrino.env]
237
- case config[:adapter]
238
- when "mysql", "mysql2", 'em_mysql2', "oci", "oracle", 'jdbcmysql'
239
- config = config.inject({}){|result, (key, value)| result[key.to_s] = value; result }
240
- ActiveRecord::Tasks::DatabaseTasks.structure_dump(config, resolve_structure_sql)
241
- when "postgresql"
242
- ENV['PGHOST'] = config[:host] if config[:host]
243
- ENV['PGPORT'] = config[:port].to_s if config[:port]
244
- ENV['PGPASSWORD'] = config[:password].to_s if config[:password]
245
- search_path = config[:schema_search_path]
246
- if search_path
247
- search_path = search_path.split(",").map{|search_path| "--schema=#{search_path.strip}" }.join(" ")
256
+ with_database(Padrino.env) do |config|
257
+ case config[:adapter]
258
+ when "mysql", "mysql2", 'em_mysql2', "oci", "oracle", 'jdbcmysql'
259
+ config = config.inject({}){|result, (key, value)| result[key.to_s] = value; result }
260
+ ActiveRecord::Tasks::DatabaseTasks.structure_dump(config, resolve_structure_sql)
261
+ when "postgresql"
262
+ ENV['PGHOST'] = config[:host] if config[:host]
263
+ ENV['PGPORT'] = config[:port].to_s if config[:port]
264
+ ENV['PGPASSWORD'] = config[:password].to_s if config[:password]
265
+ search_path = config[:schema_search_path]
266
+ if search_path
267
+ search_path = search_path.split(",").map{|search_path| "--schema=#{search_path.strip}" }.join(" ")
268
+ end
269
+ `pg_dump -U "#{config[:username]}" -s -x -O -f db/#{Padrino.env}_structure.sql #{search_path} #{config[:database]}`
270
+ raise "Error dumping database" if $?.exitstatus == 1
271
+ when "sqlite", "sqlite3"
272
+ dbfile = config[:database] || config[:dbfile]
273
+ `#{config[:adapter]} #{dbfile} .schema > db/#{Padrino.env}_structure.sql`
274
+ when "sqlserver"
275
+ `scptxfr /s #{config[:host]} /d #{config[:database]} /I /f db\\#{Padrino.env}_structure.sql /q /A /r`
276
+ `scptxfr /s #{config[:host]} /d #{config[:database]} /I /F db\ /q /A /r`
277
+ when "firebird"
278
+ set_firebird_env(config)
279
+ db_string = firebird_db_string(config)
280
+ sh "isql -a #{db_string} > #{Padrino.root}/db/#{Padrino.env}_structure.sql"
281
+ else
282
+ raise "Task not supported by '#{config[:adapter]}'."
248
283
  end
249
- `pg_dump -U "#{config[:username]}" -s -x -O -f db/#{Padrino.env}_structure.sql #{search_path} #{config[:database]}`
250
- raise "Error dumping database" if $?.exitstatus == 1
251
- when "sqlite", "sqlite3"
252
- dbfile = config[:database] || config[:dbfile]
253
- `#{config[:adapter]} #{dbfile} .schema > db/#{Padrino.env}_structure.sql`
254
- when "sqlserver"
255
- `scptxfr /s #{config[:host]} /d #{config[:database]} /I /f db\\#{Padrino.env}_structure.sql /q /A /r`
256
- `scptxfr /s #{config[:host]} /d #{config[:database]} /I /F db\ /q /A /r`
257
- when "firebird"
258
- set_firebird_env(config)
259
- db_string = firebird_db_string(config)
260
- sh "isql -a #{db_string} > #{Padrino.root}/db/#{Padrino.env}_structure.sql"
261
- else
262
- raise "Task not supported by '#{config[:adapter]}'."
263
284
  end
264
285
 
265
- if ActiveRecord::Base.connection.supports_migrations?
286
+ if !ActiveRecord::Base.connection.respond_to?(:supports_migrations?) || ActiveRecord::Base.connection.supports_migrations?
266
287
  File.open(resolve_structure_sql, "a"){|f| f << ActiveRecord::Base.connection.dump_schema_information }
267
288
  end
268
289
  end
@@ -357,13 +378,29 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
357
378
  def migrate_as(type)
358
379
  version = env_migration_version
359
380
  fail "MIGRATION_VERSION is required" unless version
360
- ActiveRecord::Migrator.run(type, "db/migrate/", version)
381
+
382
+ if less_than_active_record_5_2?
383
+ ActiveRecord::Migrator.run(type, "db/migrate/", version)
384
+ elsif less_than_active_record_6_0?
385
+ ActiveRecord::MigrationContext.new('db/migrate/').run(type, version)
386
+ else
387
+ ActiveRecord::MigrationContext.new('db/migrate/', ActiveRecord::SchemaMigration).run(type, version)
388
+ end
389
+
361
390
  dump_schema
362
391
  end
363
392
 
364
393
  def move_as(type)
365
394
  step = ENV['STEP'] ? ENV['STEP'].to_i : 1
366
- ActiveRecord::Migrator.send(type, 'db/migrate/', step)
395
+
396
+ if less_than_active_record_5_2?
397
+ ActiveRecord::Migrator.send(type, 'db/migrate/', step)
398
+ elsif less_than_active_record_6_0?
399
+ ActiveRecord::MigrationContext.new('db/migrate/').send(type, step)
400
+ else
401
+ ActiveRecord::MigrationContext.new('db/migrate/', ActiveRecord::SchemaMigration).send(type, step)
402
+ end
403
+
367
404
  dump_schema
368
405
  end
369
406
 
@@ -375,6 +412,40 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
375
412
  "#{Padrino.root}/db/#{Padrino.env}_structure.sql"
376
413
  end
377
414
 
415
+ def less_than_active_record_5_2?
416
+ ActiveRecord.version < Gem::Version.create("5.2.0")
417
+ end
418
+
419
+ def less_than_active_record_6_0?
420
+ ActiveRecord.version < Gem::Version.create("6.0.0")
421
+ end
422
+
423
+ def with_database(env_name)
424
+ if less_than_active_record_6_0?
425
+ config = ActiveRecord::Base.configurations.with_indifferent_access[env_name]
426
+
427
+ yield config
428
+ else
429
+ db_configs = ActiveRecord::Base.configurations.configs_for(env_name: env_name.to_s)
430
+
431
+ db_configs.each do |db_config|
432
+ yield db_config.config.with_indifferent_access
433
+ end
434
+ end
435
+ end
436
+
437
+ def with_all_databases
438
+ if less_than_active_record_6_0?
439
+ ActiveRecord::Base.configurations.each_value do |config|
440
+ yield config
441
+ end
442
+ else
443
+ ActiveRecord::Base.configurations.configs_for.each do |db_config|
444
+ yield db_config.config.with_indifferent_access
445
+ end
446
+ end
447
+ end
448
+
378
449
  task 'db:migrate' => 'ar:migrate'
379
450
  task 'db:create' => 'ar:create'
380
451
  task 'db:drop' => 'ar:drop'
@@ -50,7 +50,7 @@ if PadrinoTasks.load?(:datamapper, defined?(DataMapper))
50
50
 
51
51
  desc "Create the database"
52
52
  task :create => :environment do
53
- config = Utils.symbolize_keys(DataMapper.repository.adapter.options)
53
+ config = Padrino::Utils.symbolize_keys(DataMapper.repository.adapter.options)
54
54
  adapter = config[:adapter]
55
55
  user, password, host = config[:user], config[:password], config[:host]
56
56
 
@@ -67,7 +67,7 @@ if PadrinoTasks.load?(:datamapper, defined?(DataMapper))
67
67
 
68
68
  desc "Drop the database (postgres and mysql only)"
69
69
  task :drop => :environment do
70
- config = Utils.symbolize_keys(DataMapper.repository.adapter.options)
70
+ config = Padrino::Utils.symbolize_keys(DataMapper.repository.adapter.options)
71
71
  adapter = config[:adapter]
72
72
  user, password, host = config[:user], config[:password], config[:host]
73
73
 
data/padrino-gen.gemspec CHANGED
@@ -5,7 +5,6 @@ require File.expand_path("../../padrino-core/lib/padrino-core/version.rb", __FIL
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "padrino-gen"
8
- s.rubyforge_project = "padrino-gen"
9
8
  s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
10
9
  s.email = "padrinorb@gmail.com"
11
10
  s.summary = "Generators for easily creating and building padrino applications"
@@ -24,7 +23,7 @@ Gem::Specification.new do |s|
24
23
  s.rdoc_options = ["--charset=UTF-8"]
25
24
 
26
25
  s.add_dependency("padrino-core", Padrino.version)
27
- s.add_dependency("bundler", "~> 1.0")
26
+ s.add_dependency("bundler", ">= 1.0", "< 3")
28
27
  s.add_development_dependency("padrino-helpers", Padrino.version)
29
28
  s.add_development_dependency("padrino-mailer", Padrino.version)
30
29
  end
@@ -1,4 +1,5 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/helper')
2
+ require "rb-readline"
2
3
 
3
4
  describe "ComponentGenerator" do
4
5
  def setup
@@ -101,7 +101,8 @@ describe "PluginGenerator" do
101
101
  FakeWeb.register_uri :get, resolved_path, :status => 404
102
102
  plugin_gen = Padrino::Generators::Plugin.new([ template_file], ["-r=#{@apptmp}/sample_project"],{})
103
103
  plugin_gen.expects(:in_app_root?).returns(true).once
104
- plugin_gen.expects(:say).with("The template at #{resolved_path} could not be found!", :red).returns(true).once
104
+ # Use regex to ignore trailing whitespace in message
105
+ plugin_gen.expects(:say).with{ |message, color| (message =~ /The template at #{resolved_path} could not be loaded:.*404.*/) && (color == :red) }.returns(true).once
105
106
  capture_io { plugin_gen.invoke_all }
106
107
  end
107
108
  end
@@ -328,7 +328,7 @@ describe "ProjectGenerator" do
328
328
  end
329
329
 
330
330
  it 'should properly generate sqlite3' do
331
- out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=activerecord', '--adapter=sqlite3') }
331
+ out, err = capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}", '--orm=activerecord', '--adapter=sqlite') }
332
332
  assert_match_in_file(/gem 'sqlite3'/, "#{@apptmp}/sample_project/Gemfile")
333
333
  assert_match_in_file(/sample_project_development.db/, "#{@apptmp}/sample_project/config/database.rb")
334
334
  assert_match_in_file(%r{:adapter => 'sqlite3'}, "#{@apptmp}/sample_project/config/database.rb")
@@ -54,5 +54,12 @@ describe "TaskGenerator" do
54
54
  assert_match_in_file(/desc "This is a sample"/, file_path)
55
55
  assert_match_in_file(/task :demo_task => :environment do/, file_path)
56
56
  end
57
+
58
+ it 'should preserve spaces' do
59
+ capture_io { generate(:project, 'sample_project', "--root=#{@apptmp}") }
60
+ Padrino.bin_gen('task', 'DemoTask', "--namespace=Sample", "--description=This is a sample", "-r=#{@apptmp}/sample_project", :out => File::NULL)
61
+ file_path = "#{@apptmp}/sample_project/tasks/sample_demo_task.rake"
62
+ assert_match_in_file(/desc "This is a sample"/, file_path)
63
+ end
57
64
  end
58
65
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1.1
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
8
8
  - Nathan Esquenazi
9
9
  - Davide D'Agostino
10
10
  - Arthur Chiu
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-05-16 00:00:00.000000000 Z
14
+ date: 2021-04-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: padrino-core
@@ -19,58 +19,62 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.14.1.1
22
+ version: 0.15.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.14.1.1
29
+ version: 0.15.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: bundler
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ~>
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: !binary |-
37
- MS4w
36
+ version: '1.0'
37
+ - - "<"
38
+ - !ruby/object:Gem::Version
39
+ version: '3'
38
40
  type: :runtime
39
41
  prerelease: false
40
42
  version_requirements: !ruby/object:Gem::Requirement
41
43
  requirements:
42
- - - ~>
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '1.0'
47
+ - - "<"
43
48
  - !ruby/object:Gem::Version
44
- version: !binary |-
45
- MS4w
49
+ version: '3'
46
50
  - !ruby/object:Gem::Dependency
47
51
  name: padrino-helpers
48
52
  requirement: !ruby/object:Gem::Requirement
49
53
  requirements:
50
54
  - - '='
51
55
  - !ruby/object:Gem::Version
52
- version: 0.14.1.1
56
+ version: 0.15.1
53
57
  type: :development
54
58
  prerelease: false
55
59
  version_requirements: !ruby/object:Gem::Requirement
56
60
  requirements:
57
61
  - - '='
58
62
  - !ruby/object:Gem::Version
59
- version: 0.14.1.1
63
+ version: 0.15.1
60
64
  - !ruby/object:Gem::Dependency
61
65
  name: padrino-mailer
62
66
  requirement: !ruby/object:Gem::Requirement
63
67
  requirements:
64
68
  - - '='
65
69
  - !ruby/object:Gem::Version
66
- version: 0.14.1.1
70
+ version: 0.15.1
67
71
  type: :development
68
72
  prerelease: false
69
73
  version_requirements: !ruby/object:Gem::Requirement
70
74
  requirements:
71
75
  - - '='
72
76
  - !ruby/object:Gem::Version
73
- version: 0.14.1.1
77
+ version: 0.15.1
74
78
  description: Generators for easily creating and building padrino applications from
75
79
  the console
76
80
  email: padrinorb@gmail.com
@@ -80,9 +84,9 @@ extensions: []
80
84
  extra_rdoc_files:
81
85
  - README.rdoc
82
86
  files:
83
- - .document
84
- - .gitignore
85
- - .yardopts
87
+ - ".document"
88
+ - ".gitignore"
89
+ - ".yardopts"
86
90
  - LICENSE.txt
87
91
  - README.rdoc
88
92
  - Rakefile
@@ -202,25 +206,43 @@ homepage: http://www.padrinorb.com
202
206
  licenses:
203
207
  - MIT
204
208
  metadata: {}
205
- post_install_message:
209
+ post_install_message:
206
210
  rdoc_options:
207
- - --charset=UTF-8
211
+ - "--charset=UTF-8"
208
212
  require_paths:
209
213
  - lib
210
214
  required_ruby_version: !ruby/object:Gem::Requirement
211
215
  requirements:
212
- - - ! '>='
216
+ - - ">="
213
217
  - !ruby/object:Gem::Version
214
218
  version: '0'
215
219
  required_rubygems_version: !ruby/object:Gem::Requirement
216
220
  requirements:
217
- - - ! '>='
221
+ - - ">="
218
222
  - !ruby/object:Gem::Version
219
223
  version: 1.3.6
220
224
  requirements: []
221
- rubyforge_project: padrino-gen
222
- rubygems_version: 2.4.3
223
- signing_key:
225
+ rubygems_version: 3.0.8
226
+ signing_key:
224
227
  specification_version: 4
225
228
  summary: Generators for easily creating and building padrino applications
226
- test_files: []
229
+ test_files:
230
+ - test/fixtures/admin_template.rb
231
+ - test/fixtures/example_template.rb
232
+ - test/fixtures/git_template.rb
233
+ - test/fixtures/plugin_template.rb
234
+ - test/fixtures/rake_template.rb
235
+ - test/helper.rb
236
+ - test/test_app_generator.rb
237
+ - test/test_cli.rb
238
+ - test/test_component_generator.rb
239
+ - test/test_controller_generator.rb
240
+ - test/test_generator.rb
241
+ - test/test_helper_generator.rb
242
+ - test/test_mailer_generator.rb
243
+ - test/test_migration_generator.rb
244
+ - test/test_model_generator.rb
245
+ - test/test_plugin_generator.rb
246
+ - test/test_project_generator.rb
247
+ - test/test_sql_helpers.rb
248
+ - test/test_task_generator.rb