railties 3.2.14.rc2 → 3.2.14
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/CHANGELOG.md
CHANGED
data/lib/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railties
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 19
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
9
|
- 14
|
10
|
-
|
11
|
-
- 2
|
12
|
-
version: 3.2.14.rc2
|
10
|
+
version: 3.2.14
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- David Heinemeier Hansson
|
@@ -17,7 +15,7 @@ autorequire:
|
|
17
15
|
bindir: bin
|
18
16
|
cert_chain: []
|
19
17
|
|
20
|
-
date: 2013-07-
|
18
|
+
date: 2013-07-22 00:00:00 -03:00
|
21
19
|
default_executable:
|
22
20
|
dependencies:
|
23
21
|
- !ruby/object:Gem::Dependency
|
@@ -96,14 +94,12 @@ dependencies:
|
|
96
94
|
requirements:
|
97
95
|
- - "="
|
98
96
|
- !ruby/object:Gem::Version
|
99
|
-
hash:
|
97
|
+
hash: 19
|
100
98
|
segments:
|
101
99
|
- 3
|
102
100
|
- 2
|
103
101
|
- 14
|
104
|
-
|
105
|
-
- 2
|
106
|
-
version: 3.2.14.rc2
|
102
|
+
version: 3.2.14
|
107
103
|
type: :runtime
|
108
104
|
name: activesupport
|
109
105
|
version_requirements: *id005
|
@@ -114,14 +110,12 @@ dependencies:
|
|
114
110
|
requirements:
|
115
111
|
- - "="
|
116
112
|
- !ruby/object:Gem::Version
|
117
|
-
hash:
|
113
|
+
hash: 19
|
118
114
|
segments:
|
119
115
|
- 3
|
120
116
|
- 2
|
121
117
|
- 14
|
122
|
-
|
123
|
-
- 2
|
124
|
-
version: 3.2.14.rc2
|
118
|
+
version: 3.2.14
|
125
119
|
type: :runtime
|
126
120
|
name: actionpack
|
127
121
|
version_requirements: *id006
|
@@ -430,7 +424,6 @@ files:
|
|
430
424
|
- lib/rails/generators/actions.rb
|
431
425
|
- lib/rails/generators/active_model.rb
|
432
426
|
- lib/rails/generators/app_base.rb
|
433
|
-
- lib/rails/generators/app_base.rb.orig
|
434
427
|
- lib/rails/generators/base.rb
|
435
428
|
- lib/rails/generators/css/assets/assets_generator.rb
|
436
429
|
- lib/rails/generators/css/assets/templates/stylesheet.css
|
@@ -550,7 +543,6 @@ files:
|
|
550
543
|
- lib/rails/generators/rails/resource/USAGE
|
551
544
|
- lib/rails/generators/rails/resource_route/resource_route_generator.rb
|
552
545
|
- lib/rails/generators/rails/scaffold/scaffold_generator.rb
|
553
|
-
- lib/rails/generators/rails/scaffold/scaffold_generator.rb.orig
|
554
546
|
- lib/rails/generators/rails/scaffold/templates/scaffold.css
|
555
547
|
- lib/rails/generators/rails/scaffold/USAGE
|
556
548
|
- lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb
|
@@ -653,14 +645,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
653
645
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
654
646
|
none: false
|
655
647
|
requirements:
|
656
|
-
- - "
|
648
|
+
- - ">="
|
657
649
|
- !ruby/object:Gem::Version
|
658
|
-
hash:
|
650
|
+
hash: 3
|
659
651
|
segments:
|
660
|
-
-
|
661
|
-
|
662
|
-
- 1
|
663
|
-
version: 1.3.1
|
652
|
+
- 0
|
653
|
+
version: "0"
|
664
654
|
requirements: []
|
665
655
|
|
666
656
|
rubyforge_project:
|
@@ -1,300 +0,0 @@
|
|
1
|
-
require 'digest/md5'
|
2
|
-
require 'securerandom'
|
3
|
-
require 'active_support/core_ext/string/strip'
|
4
|
-
require 'rails/version' unless defined?(Rails::VERSION)
|
5
|
-
require 'rbconfig'
|
6
|
-
require 'open-uri'
|
7
|
-
require 'uri'
|
8
|
-
|
9
|
-
module Rails
|
10
|
-
module Generators
|
11
|
-
class AppBase < Base # :nodoc:
|
12
|
-
DATABASES = %w( mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver )
|
13
|
-
JDBC_DATABASES = %w( jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc )
|
14
|
-
DATABASES.concat(JDBC_DATABASES)
|
15
|
-
|
16
|
-
attr_accessor :rails_template
|
17
|
-
add_shebang_option!
|
18
|
-
|
19
|
-
argument :app_path, type: :string
|
20
|
-
|
21
|
-
def self.add_shared_options_for(name)
|
22
|
-
class_option :template, type: :string, aliases: '-m',
|
23
|
-
desc: "Path to some #{name} template (can be a filesystem path or URL)"
|
24
|
-
|
25
|
-
class_option :skip_gemfile, type: :boolean, default: false,
|
26
|
-
desc: "Don't create a Gemfile"
|
27
|
-
|
28
|
-
class_option :skip_bundle, type: :boolean, aliases: '-B', default: false,
|
29
|
-
desc: "Don't run bundle install"
|
30
|
-
|
31
|
-
class_option :skip_git, type: :boolean, aliases: '-G', default: false,
|
32
|
-
desc: 'Skip .gitignore file'
|
33
|
-
|
34
|
-
class_option :skip_keeps, type: :boolean, default: false,
|
35
|
-
desc: 'Skip source control .keep files'
|
36
|
-
|
37
|
-
class_option :skip_active_record, type: :boolean, aliases: '-O', default: false,
|
38
|
-
desc: 'Skip Active Record files'
|
39
|
-
|
40
|
-
class_option :skip_sprockets, type: :boolean, aliases: '-S', default: false,
|
41
|
-
desc: 'Skip Sprockets files'
|
42
|
-
|
43
|
-
class_option :database, type: :string, aliases: '-d', default: 'sqlite3',
|
44
|
-
desc: "Preconfigure for selected database (options: #{DATABASES.join('/')})"
|
45
|
-
|
46
|
-
class_option :javascript, type: :string, aliases: '-j', default: 'jquery',
|
47
|
-
desc: 'Preconfigure for selected JavaScript library'
|
48
|
-
|
49
|
-
class_option :skip_javascript, type: :boolean, aliases: '-J', default: false,
|
50
|
-
desc: 'Skip JavaScript files'
|
51
|
-
|
52
|
-
class_option :dev, type: :boolean, default: false,
|
53
|
-
desc: "Setup the #{name} with Gemfile pointing to your Rails checkout"
|
54
|
-
|
55
|
-
class_option :edge, type: :boolean, default: false,
|
56
|
-
desc: "Setup the #{name} with Gemfile pointing to Rails repository"
|
57
|
-
|
58
|
-
class_option :skip_test_unit, type: :boolean, aliases: '-T', default: false,
|
59
|
-
desc: 'Skip Test::Unit files'
|
60
|
-
|
61
|
-
class_option :rc, type: :string, default: false,
|
62
|
-
desc: "Path to file containing extra configuration options for rails command"
|
63
|
-
|
64
|
-
class_option :no_rc, type: :boolean, default: false,
|
65
|
-
desc: 'Skip loading of extra configuration options from .railsrc file'
|
66
|
-
|
67
|
-
class_option :help, type: :boolean, aliases: '-h', group: :rails,
|
68
|
-
desc: 'Show this help message and quit'
|
69
|
-
end
|
70
|
-
|
71
|
-
def initialize(*args)
|
72
|
-
@original_wd = Dir.pwd
|
73
|
-
super
|
74
|
-
convert_database_option_for_jruby
|
75
|
-
end
|
76
|
-
|
77
|
-
protected
|
78
|
-
|
79
|
-
def builder
|
80
|
-
@builder ||= begin
|
81
|
-
builder_class = get_builder_class
|
82
|
-
builder_class.send(:include, ActionMethods)
|
83
|
-
builder_class.new(self)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def build(meth, *args)
|
88
|
-
builder.send(meth, *args) if builder.respond_to?(meth)
|
89
|
-
end
|
90
|
-
|
91
|
-
def create_root
|
92
|
-
self.destination_root = File.expand_path(app_path, destination_root)
|
93
|
-
valid_const?
|
94
|
-
|
95
|
-
empty_directory '.'
|
96
|
-
set_default_accessors!
|
97
|
-
FileUtils.cd(destination_root) unless options[:pretend]
|
98
|
-
end
|
99
|
-
|
100
|
-
def apply_rails_template
|
101
|
-
apply rails_template if rails_template
|
102
|
-
rescue Thor::Error, LoadError, Errno::ENOENT => e
|
103
|
-
raise Error, "The template [#{rails_template}] could not be loaded. Error: #{e}"
|
104
|
-
end
|
105
|
-
|
106
|
-
def set_default_accessors!
|
107
|
-
self.rails_template = case options[:template]
|
108
|
-
when /^https?:\/\//
|
109
|
-
options[:template]
|
110
|
-
when String
|
111
|
-
File.expand_path(options[:template], Dir.pwd)
|
112
|
-
else
|
113
|
-
options[:template]
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def database_gemfile_entry
|
118
|
-
options[:skip_active_record] ? "" :
|
119
|
-
<<-GEMFILE.strip_heredoc.chomp
|
120
|
-
# Use #{options[:database]} as the database for ActiveRecord
|
121
|
-
gem '#{gem_for_database}'
|
122
|
-
GEMFILE
|
123
|
-
end
|
124
|
-
|
125
|
-
def include_all_railties?
|
126
|
-
!options[:skip_active_record] && !options[:skip_test_unit] && !options[:skip_sprockets]
|
127
|
-
end
|
128
|
-
|
129
|
-
def comment_if(value)
|
130
|
-
options[value] ? '# ' : ''
|
131
|
-
end
|
132
|
-
|
133
|
-
def rails_gemfile_entry
|
134
|
-
if options.dev?
|
135
|
-
<<-GEMFILE.strip_heredoc
|
136
|
-
gem 'rails', path: '#{Rails::Generators::RAILS_DEV_PATH}'
|
137
|
-
gem 'arel', github: 'rails/arel'
|
138
|
-
GEMFILE
|
139
|
-
elsif options.edge?
|
140
|
-
<<-GEMFILE.strip_heredoc
|
141
|
-
gem 'rails', github: 'rails/rails'
|
142
|
-
gem 'arel', github: 'rails/arel'
|
143
|
-
GEMFILE
|
144
|
-
else
|
145
|
-
<<-GEMFILE.strip_heredoc
|
146
|
-
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
147
|
-
gem 'rails', '#{Rails::VERSION::STRING}'
|
148
|
-
GEMFILE
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
def gem_for_database
|
153
|
-
# %w( mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql )
|
154
|
-
case options[:database]
|
155
|
-
when "oracle" then "ruby-oci8"
|
156
|
-
when "postgresql" then "pg"
|
157
|
-
when "frontbase" then "ruby-frontbase"
|
158
|
-
when "mysql" then "mysql2"
|
159
|
-
when "sqlserver" then "activerecord-sqlserver-adapter"
|
160
|
-
when "jdbcmysql" then "activerecord-jdbcmysql-adapter"
|
161
|
-
when "jdbcsqlite3" then "activerecord-jdbcsqlite3-adapter"
|
162
|
-
when "jdbcpostgresql" then "activerecord-jdbcpostgresql-adapter"
|
163
|
-
when "jdbc" then "activerecord-jdbc-adapter"
|
164
|
-
else options[:database]
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
def convert_database_option_for_jruby
|
169
|
-
if defined?(JRUBY_VERSION)
|
170
|
-
case options[:database]
|
171
|
-
when "oracle" then options[:database].replace "jdbc"
|
172
|
-
when "postgresql" then options[:database].replace "jdbcpostgresql"
|
173
|
-
when "mysql" then options[:database].replace "jdbcmysql"
|
174
|
-
when "sqlite3" then options[:database].replace "jdbcsqlite3"
|
175
|
-
end
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
def assets_gemfile_entry
|
180
|
-
return if options[:skip_sprockets]
|
181
|
-
|
182
|
-
gemfile = if options.dev? || options.edge?
|
183
|
-
<<-GEMFILE.strip_heredoc
|
184
|
-
# Use edge version of sprockets-rails
|
185
|
-
gem 'sprockets-rails', github: 'rails/sprockets-rails'
|
186
|
-
|
187
|
-
# Use SCSS for stylesheets
|
188
|
-
gem 'sass-rails', github: 'rails/sass-rails'
|
189
|
-
|
190
|
-
<<<<<<< HEAD
|
191
|
-
# Use Uglifier as compressor for JavaScript assets
|
192
|
-
gem 'uglifier', '~> 1.3'
|
193
|
-
=======
|
194
|
-
# To use Uglifier as compressor for JavaScript assets
|
195
|
-
gem 'uglifier', '>= 1.3.0'
|
196
|
-
>>>>>>> parent of 5758387... sprockets 2.9.x doesn't work with uglifier 2.0 yet.
|
197
|
-
GEMFILE
|
198
|
-
else
|
199
|
-
<<-GEMFILE.strip_heredoc
|
200
|
-
# Use SCSS for stylesheets
|
201
|
-
gem 'sass-rails', '~> 4.0.0.beta1'
|
202
|
-
|
203
|
-
<<<<<<< HEAD
|
204
|
-
# Use Uglifier as compressor for JavaScript assets
|
205
|
-
gem 'uglifier', '~> 1.3'
|
206
|
-
=======
|
207
|
-
# To use Uglifier as compressor for JavaScript assets
|
208
|
-
gem 'uglifier', '>= 1.3.0'
|
209
|
-
>>>>>>> parent of 5758387... sprockets 2.9.x doesn't work with uglifier 2.0 yet.
|
210
|
-
GEMFILE
|
211
|
-
end
|
212
|
-
|
213
|
-
if options[:skip_javascript]
|
214
|
-
gemfile += <<-GEMFILE
|
215
|
-
#{coffee_gemfile_entry}
|
216
|
-
#{javascript_runtime_gemfile_entry}
|
217
|
-
GEMFILE
|
218
|
-
end
|
219
|
-
|
220
|
-
gemfile.gsub(/^[ \t]+/, '')
|
221
|
-
end
|
222
|
-
|
223
|
-
def coffee_gemfile_entry
|
224
|
-
if options.dev? || options.edge?
|
225
|
-
<<-GEMFILE
|
226
|
-
# Use CoffeeScript for .js.coffee assets and views
|
227
|
-
gem 'coffee-rails', github: 'rails/coffee-rails'
|
228
|
-
GEMFILE
|
229
|
-
else
|
230
|
-
<<-GEMFILE
|
231
|
-
# Use CoffeeScript for .js.coffee assets and views
|
232
|
-
gem 'coffee-rails', '~> 4.0.0.beta1'
|
233
|
-
GEMFILE
|
234
|
-
end
|
235
|
-
end
|
236
|
-
|
237
|
-
def javascript_gemfile_entry
|
238
|
-
unless options[:skip_javascript]
|
239
|
-
<<-GEMFILE.gsub(/^[ \t]+/, '')
|
240
|
-
#{coffee_gemfile_entry}
|
241
|
-
#{javascript_runtime_gemfile_entry}
|
242
|
-
# Use #{options[:javascript]} as the JavaScript library
|
243
|
-
gem '#{options[:javascript]}-rails'
|
244
|
-
|
245
|
-
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
246
|
-
gem 'turbolinks'
|
247
|
-
GEMFILE
|
248
|
-
end
|
249
|
-
end
|
250
|
-
|
251
|
-
def javascript_runtime_gemfile_entry
|
252
|
-
runtime = if defined?(JRUBY_VERSION)
|
253
|
-
"gem 'therubyrhino'"
|
254
|
-
else
|
255
|
-
"# gem 'therubyracer', platforms: :ruby"
|
256
|
-
end
|
257
|
-
<<-GEMFILE
|
258
|
-
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
259
|
-
#{runtime}
|
260
|
-
GEMFILE
|
261
|
-
end
|
262
|
-
|
263
|
-
def bundle_command(command)
|
264
|
-
say_status :run, "bundle #{command}"
|
265
|
-
|
266
|
-
# We are going to shell out rather than invoking Bundler::CLI.new(command)
|
267
|
-
# because `rails new` loads the Thor gem and on the other hand bundler uses
|
268
|
-
# its own vendored Thor, which could be a different version. Running both
|
269
|
-
# things in the same process is a recipe for a night with paracetamol.
|
270
|
-
#
|
271
|
-
# We use backticks and #print here instead of vanilla #system because it
|
272
|
-
# is easier to silence stdout in the existing test suite this way. The
|
273
|
-
# end-user gets the bundler commands called anyway, so no big deal.
|
274
|
-
#
|
275
|
-
# We unset temporary bundler variables to load proper bundler and Gemfile.
|
276
|
-
#
|
277
|
-
# Thanks to James Tucker for the Gem tricks involved in this call.
|
278
|
-
_bundle_command = Gem.bin_path('bundler', 'bundle')
|
279
|
-
|
280
|
-
require 'bundler'
|
281
|
-
Bundler.with_clean_env do
|
282
|
-
print `"#{Gem.ruby}" "#{_bundle_command}" #{command}`
|
283
|
-
end
|
284
|
-
end
|
285
|
-
|
286
|
-
def run_bundle
|
287
|
-
bundle_command('install') unless options[:skip_gemfile] || options[:skip_bundle] || options[:pretend]
|
288
|
-
end
|
289
|
-
|
290
|
-
def empty_directory_with_keep_file(destination, config = {})
|
291
|
-
empty_directory(destination, config)
|
292
|
-
keep_file(destination)
|
293
|
-
end
|
294
|
-
|
295
|
-
def keep_file(destination)
|
296
|
-
create_file("#{destination}/.keep") unless options[:skip_keeps]
|
297
|
-
end
|
298
|
-
end
|
299
|
-
end
|
300
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'rails/generators/rails/resource/resource_generator'
|
2
|
-
|
3
|
-
module Rails
|
4
|
-
module Generators
|
5
|
-
class ScaffoldGenerator < ResourceGenerator #metagenerator
|
6
|
-
remove_hook_for :resource_controller
|
7
|
-
remove_class_option :actions
|
8
|
-
|
9
|
-
<<<<<<< HEAD
|
10
|
-
class_option :stylesheets, :type => :boolean, :desc => "Generate Stylesheets"
|
11
|
-
class_option :stylesheet_engine, :desc => "Engine for Stylesheets"
|
12
|
-
=======
|
13
|
-
class_option :stylesheets, type: :boolean, desc: "Generate Stylesheets"
|
14
|
-
class_option :stylesheet_engine, desc: "Engine for Stylesheets"
|
15
|
-
class_option :assets, :type => :boolean
|
16
|
-
class_option :resource_route, :type => :boolean
|
17
|
-
>>>>>>> d664409... Merge pull request #10448 from arunagw/bug-fix-scaffold-generator-master
|
18
|
-
|
19
|
-
hook_for :scaffold_controller, :required => true
|
20
|
-
|
21
|
-
hook_for :assets do |assets|
|
22
|
-
invoke assets, [controller_name]
|
23
|
-
end
|
24
|
-
|
25
|
-
hook_for :stylesheet_engine do |stylesheet_engine|
|
26
|
-
invoke stylesheet_engine, [controller_name] if options[:stylesheets] && behavior == :invoke
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|