inline_forms 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/inline_forms +23 -32
- data/bin/inline_forms_installer_core.rb +97 -54
- data/lib/inline_forms/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDg5MWUzOTM1NTUxYzE3NGFhOTAxZmQwYWMwZjFjZjczYjBhOTY2OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODAyMDJjYTBjZGIyYWQ5ZDVmNzYxMGZjYmFkYmU3MzVkN2IwNTA5OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTNiNmUzYzZmNmRiYzNhYjM2OGI4NGVjMTM1YmJlZjNjZmM0YTcyOWVmMzJl
|
10
|
+
MGNjNDQ4ZTgyNTJhZGIzZGUxMTg2YzIwZGM0NzFjODRhYzFjMjM4NGEzYTc0
|
11
|
+
ODJkNDZmOGUzNzI2ZWM4MTVlZjk1Y2FkMjYyYjdjZDA1ZDdkM2I=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWQwZmYyODhlYTI5NjU0Zjg2NDAwNDk3ZTBjODY5NDM5NTQzM2M3ZjMzYjIw
|
14
|
+
NTE1MmQzNTg4NDQwNDI0M2QxMGQyOTQzOTM5MmQ4MjM3YzU5ZWJiMjE0Nzll
|
15
|
+
MzY0MTA4OTRiZjMxM2E3YjA0NWJmYmUxYzk4NTdjMjIwNTJkZGI=
|
data/bin/inline_forms
CHANGED
@@ -14,12 +14,8 @@ module InlineForms
|
|
14
14
|
end
|
15
15
|
desc "create APP", "create an application with inline_forms v#{VERSION}"
|
16
16
|
DATABASE_OPTIONS = %w(sqlite mysql)
|
17
|
-
method_option :database, :aliases => "-d", :
|
18
|
-
|
19
|
-
|
20
|
-
method_option :dry, :type => :boolean, :desc => 'dry run. Do not do most things. Only useful for development of inline_forms'
|
21
|
-
# TODO ROYTJE Remove ALL dry run code. We don't do dry runs anymore.
|
22
|
-
method_option :example, :type => :boolean, :desc => 'install the example app. incompatible with --dry and uses sqlite as development database'
|
17
|
+
method_option :database, :aliases => "-d", :banner => DATABASE_OPTIONS.join('|'), :desc => 'specify development database'
|
18
|
+
method_option :example, :type => :boolean, :desc => 'install the example app. uses sqlite as development database'
|
23
19
|
method_option :email, :aliases => "-e", :default => "admin@example.com", :desc => 'specify admin email'
|
24
20
|
method_option :password, :aliases => "-p", :default => "admin999", :desc => 'specify admin password'
|
25
21
|
method_option :runtest, :aliases => "\-\-run-test", :default => false, :desc => 'run tests'
|
@@ -34,18 +30,21 @@ module InlineForms
|
|
34
30
|
options[:runtest]
|
35
31
|
end
|
36
32
|
|
37
|
-
def self.dry_run?
|
38
|
-
options[:dry]
|
39
|
-
end
|
40
|
-
|
41
33
|
def self.install_example?
|
42
34
|
options[:example]
|
43
35
|
end
|
44
36
|
|
45
37
|
def self.database
|
46
|
-
|
38
|
+
@database ||= options[:database]
|
39
|
+
return @database if DATABASE_OPTIONS.include?(@database)
|
40
|
+
say "No Database specified please choose one database #{DATABASE_OPTIONS.join(' | ')}", :red
|
41
|
+
# if the database is not set ask user which database to use
|
42
|
+
while ! DATABASE_OPTIONS.include?(@database)
|
43
|
+
@database = ask "Database: "
|
44
|
+
return @database if DATABASE_OPTIONS.include?(@database)
|
45
|
+
end
|
47
46
|
end
|
48
|
-
|
47
|
+
|
49
48
|
def self.using_sqlite?
|
50
49
|
database == 'sqlite'
|
51
50
|
end
|
@@ -58,18 +57,11 @@ module InlineForms
|
|
58
57
|
options[:password]
|
59
58
|
end
|
60
59
|
|
61
|
-
if install_example? && dry_run?
|
62
|
-
say "--example and --dry-run can not be used together", :red
|
63
|
-
exit 1
|
64
|
-
end
|
65
|
-
|
66
60
|
if install_example? && !using_sqlite?
|
67
61
|
say "--example can only be used with an sqlite development database", :red
|
68
62
|
exit 1
|
69
63
|
end
|
70
64
|
|
71
|
-
say "This is a dry run. I hope you know what you are doing...", :red if dry_run?
|
72
|
-
|
73
65
|
say "Creating #{app_name} with inline_forms v#{VERSION} and development database #{database}...", :green
|
74
66
|
|
75
67
|
regex = /\A[0-9a-zA-Z][0-9a-zA-Z_-]+[0-9a-zA-Z]\Z/
|
@@ -83,9 +75,6 @@ module InlineForms
|
|
83
75
|
exit 1
|
84
76
|
end
|
85
77
|
|
86
|
-
# TODO: optioneel, detecteren dat er RVM er is als het niet zo is dan zonder RVM instaleren
|
87
|
-
# Maybe via the method.options (THOR)??
|
88
|
-
# using_rvm = false # for testing purpose only need to do this another way.
|
89
78
|
require 'rvm'
|
90
79
|
# if RVM is detected and the user has not disabled using rvm via command than use rvm else without
|
91
80
|
if RVM.current && !options[:skiprvm]
|
@@ -95,25 +84,28 @@ module InlineForms
|
|
95
84
|
ruby_version = (%x[rvm current]).gsub(/@.*/,'')
|
96
85
|
# Create a ruby rvm-file version based on the version detected
|
97
86
|
create_file "#{app_name}/.ruby-version", ruby_version
|
98
|
-
# Creat a ruby-gemset rvm-file based on the version detected
|
87
|
+
# Creat a ruby-gemset rvm-file based on the version detected
|
99
88
|
create_file "#{app_name}/.ruby-gemset", app_name
|
100
89
|
else
|
101
90
|
# Let the user know that he is installing inline_forms without RVM
|
102
91
|
say "Installing inline_forms without RVM", :green
|
103
92
|
end
|
104
93
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
#
|
111
|
-
options.each do | k,v |
|
94
|
+
say "Installing with #{options[:database]}", :green
|
95
|
+
|
96
|
+
# Creates the app directory
|
97
|
+
empty_directory(app_name)
|
98
|
+
|
99
|
+
# puts all options in environment to app_template
|
100
|
+
options.each do | k,v |
|
112
101
|
ENV[k] = v.to_s
|
113
102
|
end
|
103
|
+
|
114
104
|
ENV['using_sqlite'] = using_sqlite?.to_s
|
105
|
+
ENV['database'] = database
|
115
106
|
ENV['install_example'] = install_example?.to_s
|
116
107
|
ENV['ruby_version'] = ruby_version
|
108
|
+
ENV['inline_forms_version'] = VERSION
|
117
109
|
|
118
110
|
app_template_file = File.join(File.dirname(__FILE__), 'inline_forms_app_template.rb')
|
119
111
|
|
@@ -121,8 +113,7 @@ module InlineForms
|
|
121
113
|
say "Rails could not create the app '#{app_name}', maybe because it is a reserved word...", :red # TODO ROYTJE MAKE ERROR MESSAGE MORE RELEVANT # Rails could not create the app 'MyApp', maybe because it is a reserved word..
|
122
114
|
exit 1
|
123
115
|
end
|
124
|
-
end
|
125
116
|
end
|
126
117
|
Creator.start
|
127
118
|
end
|
128
|
-
end
|
119
|
+
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
GENERATOR_PATH = File.dirname(File.expand_path(__FILE__)) + '/../'
|
2
|
+
|
3
|
+
create_file 'Gemfile', "# created by inline_forms #{ENV['inline_forms_version']}\n"
|
2
4
|
|
3
5
|
add_source 'https://rubygems.org'
|
4
6
|
|
@@ -53,7 +55,7 @@ gem_group :assets do
|
|
53
55
|
gem 'sass-rails', '~> 3.2.3'
|
54
56
|
gem 'coffee-rails', '~> 3.2.1'
|
55
57
|
gem 'compass-rails' # you need this or you get an err
|
56
|
-
end
|
58
|
+
end
|
57
59
|
|
58
60
|
say "- Running bundle..."
|
59
61
|
run "bundle install"
|
@@ -90,19 +92,69 @@ END_DATABASEYML
|
|
90
92
|
say "- Devise install..."
|
91
93
|
run "bundle exec rails g devise:install"
|
92
94
|
|
93
|
-
|
94
|
-
|
95
|
-
say "- Devise User model install with added name and locale field..."
|
96
|
-
run "bundle exec rails g devise User name:string locale_id:integer"
|
95
|
+
say "- Create Devise route and add path_prefix..."
|
97
96
|
|
98
|
-
|
99
|
-
|
100
|
-
insert_into_file "config/routes.rb", <<-ROUTE.strip_heredoc, :after => "devise_for :users, :path_prefix => 'auth'\n"
|
97
|
+
route <<-ROUTE.strip_heredoc
|
98
|
+
devise_for :users, :path_prefix => 'auth'
|
101
99
|
resources :users do
|
102
100
|
post 'revert', :on => :member
|
103
|
-
|
101
|
+
end
|
104
102
|
ROUTE
|
105
103
|
|
104
|
+
say "- Create devise migration file"
|
105
|
+
|
106
|
+
sleep 1 # to get unique migration number
|
107
|
+
create_file "db/migrate/" +
|
108
|
+
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
109
|
+
"_" +
|
110
|
+
"devise_create_users.rb", <<-DEVISE_MIGRATION.strip_heredoc
|
111
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
112
|
+
|
113
|
+
def change
|
114
|
+
create_table(:users) do |t|
|
115
|
+
## Database authenticatable
|
116
|
+
t.string :email, null: false, default: ""
|
117
|
+
t.string :encrypted_password, null: false, default: ""
|
118
|
+
|
119
|
+
## Recoverable
|
120
|
+
t.string :reset_password_token
|
121
|
+
t.datetime :reset_password_sent_at
|
122
|
+
|
123
|
+
## Rememberable
|
124
|
+
t.datetime :remember_created_at
|
125
|
+
|
126
|
+
## Trackable
|
127
|
+
t.integer :sign_in_count, default: 0, null: false
|
128
|
+
t.datetime :current_sign_in_at
|
129
|
+
t.datetime :last_sign_in_at
|
130
|
+
t.string :current_sign_in_ip
|
131
|
+
t.string :last_sign_in_ip
|
132
|
+
|
133
|
+
## Confirmable
|
134
|
+
# t.string :confirmation_token
|
135
|
+
# t.datetime :confirmed_at
|
136
|
+
# t.datetime :confirmation_sent_at
|
137
|
+
# t.string :unconfirmed_email # Only if using reconfirmable
|
138
|
+
|
139
|
+
## Lockable
|
140
|
+
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
141
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
142
|
+
# t.datetime :locked_at
|
143
|
+
|
144
|
+
t.string :name
|
145
|
+
t.integer :locale_id
|
146
|
+
|
147
|
+
t.timestamps
|
148
|
+
end
|
149
|
+
|
150
|
+
add_index :users, :email, unique: true
|
151
|
+
add_index :users, :reset_password_token, unique: true
|
152
|
+
# add_index :users, :confirmation_token, unique: true
|
153
|
+
# add_index :users, :unlock_token, unique: true
|
154
|
+
end
|
155
|
+
end
|
156
|
+
DEVISE_MIGRATION
|
157
|
+
|
106
158
|
say "- Create User Controller..."
|
107
159
|
create_file "app/controllers/users_controller.rb", <<-USERS_CONTROLLER.strip_heredoc
|
108
160
|
class UsersController < InlineFormsController
|
@@ -110,8 +162,7 @@ create_file "app/controllers/users_controller.rb", <<-USERS_CONTROLLER.strip_her
|
|
110
162
|
end
|
111
163
|
USERS_CONTROLLER
|
112
164
|
|
113
|
-
say "-
|
114
|
-
remove_file "app/models/user.rb" # the one that 'devise:install' created
|
165
|
+
say "- Create User Model..."
|
115
166
|
create_file "app/models/user.rb", <<-USER_MODEL.strip_heredoc
|
116
167
|
class User < ActiveRecord::Base
|
117
168
|
|
@@ -134,7 +185,7 @@ create_file "app/models/user.rb", <<-USER_MODEL.strip_heredoc
|
|
134
185
|
|
135
186
|
belongs_to :locale
|
136
187
|
has_and_belongs_to_many :roles
|
137
|
-
|
188
|
+
|
138
189
|
# validations
|
139
190
|
validates :name, :presence => true
|
140
191
|
|
@@ -201,7 +252,7 @@ append_to_file "db/seeds.rb", "Locale.create({ id: 1, name: 'en', title: 'Englis
|
|
201
252
|
say "- Create roles"
|
202
253
|
generate "inline_forms", "Role name:string description:text users:has_and_belongs_to_many _enabled:yes _presentation:\#{name}"
|
203
254
|
sleep 1 # to get unique migration number
|
204
|
-
create_file "db/migrate/" +
|
255
|
+
create_file "db/migrate/" +
|
205
256
|
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
206
257
|
"_" +
|
207
258
|
"inline_forms_create_join_table_user_role.rb", <<-ROLES_MIGRATION.strip_heredoc
|
@@ -213,7 +264,7 @@ create_file "db/migrate/" +
|
|
213
264
|
end
|
214
265
|
execute 'INSERT INTO roles_users VALUES (1,1);'
|
215
266
|
end
|
216
|
-
|
267
|
+
|
217
268
|
def self.down
|
218
269
|
drop_table roles_users
|
219
270
|
end
|
@@ -222,14 +273,9 @@ ROLES_MIGRATION
|
|
222
273
|
|
223
274
|
append_to_file "db/seeds.rb", "Role.create({ id: 1, name: 'superadmin', description: 'Super Admin can access all.' }, without_protection: true)\n"
|
224
275
|
|
225
|
-
# TODO ROYTJE This above is all that: Devise creates a model. That is a migration, a test, a route and a model. We delete the model, the route, and the test probably too. Is there another way to just create the migration instead of all the stuff that we are going to delete anyway !?
|
226
|
-
|
227
276
|
say "- Install ckeditor..."
|
228
277
|
generate "ckeditor:install --backend=carrierwave"
|
229
278
|
|
230
|
-
# TODO ROYTJE urgent, get ckeditor to work with carrierwave (the normal carrierwave, not -db)
|
231
|
-
# Thanks for fixing ROYTJE! +1
|
232
|
-
|
233
279
|
say "- Mount Ckeditor::Engine to routes..."
|
234
280
|
route "mount Ckeditor::Engine => '/ckeditor'"
|
235
281
|
|
@@ -242,24 +288,24 @@ insert_into_file "app/assets/javascripts/application.js",
|
|
242
288
|
:before => "//= require_tree .\n"
|
243
289
|
|
244
290
|
say "- Create ckeditor config.js"
|
245
|
-
copy_file File.join(
|
291
|
+
copy_file File.join(GENERATOR_PATH, 'lib/app/assets/javascripts/ckeditor/config.js'), "app/assets/javascripts/ckeditor/config.js"
|
246
292
|
|
247
293
|
say "- Add remotipart to application.js..."
|
248
294
|
insert_into_file "app/assets/javascripts/application.js", "//= require jquery.remotipart\n", :before => "//= require_tree .\n"
|
249
295
|
|
250
296
|
say "- Paper_trail install..."
|
251
|
-
generate "paper_trail:install" # TODO One day, we need some management tools so we can actually SEE the versions, restore them etc.
|
297
|
+
generate "paper_trail:install" # TODO One day, we need some management tools so we can actually SEE the versions, restore them etc.
|
252
298
|
|
253
299
|
say "- Installaing ZURB Foundation..."
|
254
300
|
generate "foundation:install", "-f"
|
255
301
|
|
256
302
|
# Create Translations
|
257
|
-
say "- Generate models and tables and views for translations..." # TODO Translations need to be done in inline_forms, and then generate a yml file, perhaps
|
303
|
+
say "- Generate models and tables and views for translations..." # TODO Translations need to be done in inline_forms, and then generate a yml file, perhaps
|
258
304
|
generate "inline_forms", "InlineFormsLocale name:string inline_forms_translations:belongs_to _enabled:yes _presentation:\#{name}"
|
259
305
|
generate "inline_forms", "InlineFormsKey name:string inline_forms_translations:has_many inline_forms_translations:associated _enabled:yes _presentation:\#{name}"
|
260
306
|
generate "inline_forms", "InlineFormsTranslation inline_forms_key:belongs_to inline_forms_locale:dropdown value:text interpolations:text is_proc:boolean _presentation:\#{value}"
|
261
307
|
sleep 1 # to get unique migration number
|
262
|
-
create_file "db/migrate/" +
|
308
|
+
create_file "db/migrate/" +
|
263
309
|
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
264
310
|
"_" +
|
265
311
|
"inline_forms_create_view_for_translations.rb", <<-VIEW_MIGRATION.strip_heredoc
|
@@ -281,7 +327,6 @@ create_file "db/migrate/" +
|
|
281
327
|
end
|
282
328
|
VIEW_MIGRATION
|
283
329
|
|
284
|
-
|
285
330
|
say "- Migrating Database (only when using sqlite)"
|
286
331
|
run "bundle exec rake db:migrate" if ENV['using_sqlite'] == 'true'
|
287
332
|
|
@@ -335,9 +380,9 @@ create_file "app/controllers/application_controller.rb", <<-END_APPCONTROLLER.st
|
|
335
380
|
sign_out :user if user_signed_in?
|
336
381
|
redirect_to new_user_session_path, :alert => exception.message
|
337
382
|
end
|
338
|
-
|
383
|
+
|
339
384
|
ActionView::CompiledTemplates::MODEL_TABS = %w()
|
340
|
-
|
385
|
+
|
341
386
|
# Uncomment next line if you want I18n (based on subdomain)
|
342
387
|
# before_filter :set_locale
|
343
388
|
|
@@ -383,7 +428,7 @@ create_file "app/models/ability.rb", <<-END_ABILITY.strip_heredoc
|
|
383
428
|
END_ABILITY
|
384
429
|
|
385
430
|
say "- Generating test files", :green
|
386
|
-
|
431
|
+
|
387
432
|
create_file "spec/spec_helper.rb", <<-END_TEST_HELPER.strip_heredoc
|
388
433
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
389
434
|
ENV["RAILS_ENV"] ||= 'development' # this need to be changed to test ???
|
@@ -392,12 +437,12 @@ create_file "spec/spec_helper.rb", <<-END_TEST_HELPER.strip_heredoc
|
|
392
437
|
require 'rspec/rails'
|
393
438
|
require 'rspec/autorun'
|
394
439
|
require 'carrierwave/test/matchers'
|
395
|
-
|
396
|
-
|
440
|
+
|
441
|
+
|
397
442
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
398
443
|
# in spec/support/ and its subdirectories.
|
399
444
|
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
400
|
-
|
445
|
+
|
401
446
|
RSpec.configure do |config|
|
402
447
|
config.include FactoryGirl::Syntax::Methods
|
403
448
|
# ## Mock Framework
|
@@ -407,20 +452,20 @@ create_file "spec/spec_helper.rb", <<-END_TEST_HELPER.strip_heredoc
|
|
407
452
|
# config.mock_with :mocha
|
408
453
|
# config.mock_with :flexmock
|
409
454
|
# config.mock_with :rr
|
410
|
-
|
455
|
+
|
411
456
|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
412
457
|
config.fixture_path = Rails.root + "/spec/fixtures"
|
413
|
-
|
458
|
+
|
414
459
|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
415
460
|
# examples within a transaction, remove the following line or assign false
|
416
461
|
# instead of true.
|
417
462
|
config.use_transactional_fixtures = true
|
418
|
-
|
463
|
+
|
419
464
|
# If true, the base class of anonymous controllers will be inferred
|
420
465
|
# automatically. This will be the default behavior in future versions of
|
421
466
|
# rspec-rails.
|
422
467
|
config.infer_base_class_for_anonymous_controllers = false
|
423
|
-
|
468
|
+
|
424
469
|
# Run specs in random order to surface order dependencies. If you find an
|
425
470
|
# order dependency and want to debug it, you can fix the order by providing
|
426
471
|
# the seed, which is printed after each run.
|
@@ -430,23 +475,23 @@ create_file "spec/spec_helper.rb", <<-END_TEST_HELPER.strip_heredoc
|
|
430
475
|
END_TEST_HELPER
|
431
476
|
|
432
477
|
say 'copy test image into rspec folder'
|
433
|
-
copy_file File.join(
|
478
|
+
copy_file File.join(GENERATOR_PATH,'lib/otherstuff/fixtures/rails.png'), "spec/fixtures/images/rails.png"
|
434
479
|
say '- Creating factory_girl file'
|
435
480
|
create_file "spec/factories/inline_forms.rb", <<-END_FACTORY_GIRL.strip_heredoc
|
436
481
|
FactoryGirl.define do
|
437
482
|
factory :apartment do
|
438
483
|
name "Luxe House in Bandabou 147A" #string
|
439
|
-
title "A dream house in a dream place" # string
|
484
|
+
title "A dream house in a dream place" # string
|
440
485
|
description "A beatiful House at the edge of the <strong>sea</strong>" #text
|
441
486
|
end
|
442
487
|
factory :large_text do
|
443
488
|
name "Luxe House in Bandabou 147A" #string
|
444
|
-
title "A dream house in a dream place" # string
|
489
|
+
title "A dream house in a dream place" # string
|
445
490
|
description "A beatiful House at the edge of the <strong>sea</strong>" #text
|
446
491
|
end
|
447
492
|
end
|
448
493
|
END_FACTORY_GIRL
|
449
|
-
remove_file 'spec/factories/users.rb'
|
494
|
+
remove_file 'spec/factories/users.rb'
|
450
495
|
remove_file 'spec/models/user_spec.rb'
|
451
496
|
|
452
497
|
# environments/production.rb
|
@@ -455,18 +500,18 @@ remove_file 'spec/models/user_spec.rb'
|
|
455
500
|
# insert_into_file "config/environments/production.rb",
|
456
501
|
# " config.assets.precompile += %w(inline_forms_application.js inline_forms_application.css devise.css)\n",
|
457
502
|
# :after => " # config.assets.precompile += %w( search.js )\n"
|
458
|
-
|
459
|
-
|
503
|
+
|
504
|
+
|
460
505
|
# add stuff to application.css
|
461
506
|
say "- Injecting stylesheets into app/assets/stylesheets/application.css..."
|
462
507
|
insert_into_file "app/assets/stylesheets/application.css",
|
463
508
|
"*= require devise\n*= require inline_forms\n",
|
464
509
|
:before => "*= require_self\n"
|
465
|
-
|
466
|
-
|
510
|
+
|
511
|
+
|
467
512
|
# devise mailer stuff
|
468
513
|
say "- Injecting devise mailer stuff in environments/production.rb..."
|
469
|
-
# strip_heredoc_with_indent(2) became strip_heredoc(2), but only in rails 4... :-(
|
514
|
+
# strip_heredoc_with_indent(2) became strip_heredoc(2), but only in rails 4... :-(
|
470
515
|
insert_into_file "config/environments/production.rb", <<-DEVISE_MAILER_STUFF.strip_heredoc, :before => "end\n"
|
471
516
|
# for devise
|
472
517
|
config.action_mailer.default_url_options = { :protocol => 'https', :host => 'YOURHOSTNAME' }
|
@@ -485,21 +530,24 @@ say "- Setting config.assets.compile to true in environments/production.rb (need
|
|
485
530
|
#insert_into_file "#{app_name}/config/environments/production.rb", "config.assets.compile = false\n", :before => "end\n" if dry_run?
|
486
531
|
gsub_file "config/environments/production.rb", /config.assets.compile = false/, "config.assets.compile = true"
|
487
532
|
|
533
|
+
|
534
|
+
|
535
|
+
|
488
536
|
# capify
|
489
537
|
say "- Capify..."
|
490
538
|
run 'capify .'
|
491
539
|
remove_file "config/deploy.rb" # remove the file capify created!
|
492
|
-
copy_file File.join(
|
493
|
-
# TODO: ROYJE isn't there a better way to find the path?
|
540
|
+
copy_file File.join(GENERATOR_PATH,'lib/generators/templates/deploy.rb'), "config/deploy.rb"
|
494
541
|
|
495
542
|
# Unicorn
|
496
543
|
say "- Unicorn Config..."
|
497
|
-
copy_file File.join(
|
544
|
+
copy_file File.join(GENERATOR_PATH,'lib/generators/templates/unicorn.rb'), "config/unicorn.rb"
|
545
|
+
|
498
546
|
|
499
547
|
# Git
|
500
548
|
say "- Initializing git..."
|
501
549
|
run 'git init'
|
502
|
-
|
550
|
+
|
503
551
|
insert_into_file ".gitignore", <<-GITIGNORE.strip_heredoc, :after => "/tmp\n"
|
504
552
|
# netbeans
|
505
553
|
nbproject
|
@@ -529,11 +577,7 @@ if ENV['install_example'] == 'true'
|
|
529
577
|
end
|
530
578
|
END_EXAMPLE_TEST
|
531
579
|
|
532
|
-
|
533
|
-
# if ENV['runtest'] == 'true' # Not Dry
|
534
|
-
# run "rspec"
|
535
|
-
# end
|
536
|
-
run "rspec" if ENV['runtest'] # Drier!
|
580
|
+
run "rspec" if ENV['runtest']
|
537
581
|
|
538
582
|
# done!
|
539
583
|
say "\nDone! Now point your browser to http://localhost:3000/apartments !", :yellow
|
@@ -546,5 +590,4 @@ else
|
|
546
590
|
say "\nDone! Now make your tables with 'bundle exec rails g inline_forms ...", :yellow
|
547
591
|
end
|
548
592
|
|
549
|
-
|
550
593
|
#say "- Don't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n"
|
data/lib/inline_forms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ace Suares
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rvm
|