inline_forms 1.3.30 → 1.3.31
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/inline_forms +75 -74
- data/lib/inline_forms/version.rb +1 -1
- metadata +2 -2
data/bin/inline_forms
CHANGED
@@ -45,18 +45,19 @@ if !ARGV.empty? || app_name.nil? || !/^[a-zA-Z][0-9a-zA-Z_-]+/.match(app_name) |
|
|
45
45
|
end
|
46
46
|
|
47
47
|
puts "\nGenerating Rails app '#{app_name}'...\n"
|
48
|
+
ruby_version = %x[rvm current]
|
48
49
|
RVM.run "rails new #{app_name}"
|
49
50
|
|
50
|
-
|
51
|
-
|
51
|
+
Dir.chdir(app_name)
|
52
|
+
puts "\nWorking directory is now #{`pwd`}"
|
52
53
|
|
53
|
-
|
54
|
+
puts "\nInstalling Gemfile...\n"
|
54
55
|
|
55
|
-
|
56
|
+
gemfile_sources = "
|
56
57
|
source 'http://rubygems.org'
|
57
58
|
|
58
|
-
|
59
|
-
|
59
|
+
"
|
60
|
+
gemfile_gems = "
|
60
61
|
|
61
62
|
gem 'test-unit'
|
62
63
|
gem 'rails'
|
@@ -79,8 +80,8 @@ gem 'rails-i18n'
|
|
79
80
|
gem 'unicorn'
|
80
81
|
gem 'rvm-capistrano'
|
81
82
|
|
82
|
-
|
83
|
-
|
83
|
+
"
|
84
|
+
gemfile_development_group ="
|
84
85
|
|
85
86
|
# Include everything needed to run rake, tests, features, etc.
|
86
87
|
group :development do
|
@@ -92,8 +93,8 @@ group :development do
|
|
92
93
|
# gem 'rcov', '>= 0'
|
93
94
|
end
|
94
95
|
|
95
|
-
|
96
|
-
|
96
|
+
"
|
97
|
+
gemfile_production_group ="
|
97
98
|
# these are just for production
|
98
99
|
group :production do
|
99
100
|
gem 'mysql2'
|
@@ -101,60 +102,61 @@ group :production do
|
|
101
102
|
gem 'uglifier'
|
102
103
|
end
|
103
104
|
|
104
|
-
|
105
|
+
"
|
105
106
|
|
106
|
-
|
107
|
+
File.open( 'Gemfile', 'w') {|f| f.write(gemfile_sources + gemfile_gems + gemfile_development_group + gemfile_production_group ) }
|
107
108
|
|
108
|
-
|
109
|
-
|
110
|
-
RVM.run "rvm rvmrc trust .rvmrc"
|
109
|
+
puts "\nCreating and trusting .rvmrc...\n"
|
110
|
+
system "echo rvm use #{ruby_version.chop}@#{app_name} --create > .rvmrc"
|
111
111
|
|
112
|
-
end
|
113
|
-
RVM.chdir "#{app_name}" do
|
114
112
|
|
115
|
-
|
116
|
-
|
113
|
+
system "rvm rvmrc trust .rvmrc"
|
114
|
+
|
115
|
+
RVM.use "#{ruby_version.chop}@#{app_name}"
|
117
116
|
|
118
|
-
|
119
|
-
|
117
|
+
puts "\nRunning bundle...\n"
|
118
|
+
RVM.run "bundle install"
|
119
|
+
|
120
|
+
puts "\nDatabase setup: creating config/database.yml\n"
|
121
|
+
development_stanza = "
|
120
122
|
development:
|
121
123
|
adapter: sqlite3
|
122
124
|
database: db/development.sqlite3
|
123
125
|
pool: 5
|
124
126
|
timeout: 5000
|
125
|
-
|
126
|
-
|
127
|
+
"
|
128
|
+
production_stanza = "
|
127
129
|
production:
|
128
130
|
adapter: mysql2
|
129
131
|
database: #{app_name}_p
|
130
132
|
username: #{app_name}
|
131
133
|
password: #{app_name}444
|
132
134
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
135
|
+
"
|
136
|
+
File.open( 'config/database.yml', 'w') {|f| f.write(development_stanza + production_stanza) }
|
137
|
+
|
138
|
+
puts "\nDevise install..."
|
139
|
+
RVM.run "bundle exec rails g devise:install"
|
140
|
+
puts "\nDevise User model install with added name field..."
|
141
|
+
RVM.run "bundle exec rails g devise User name:string"
|
142
|
+
puts "\nInstall ckeditor..."
|
143
|
+
RVM.run "bundle exec rails g ckeditor:install"
|
144
|
+
puts "Create config file in app/assets/javascripts/ckeditor/config.js"
|
145
|
+
FileUtils.mkdir_p 'app/assets/javascripts/ckeditor'
|
146
|
+
system("cp #{src}/lib/app/assets/javascripts/ckeditor/config.js app/assets/javascripts/ckeditor")
|
147
|
+
puts "Add remotipart to app/assets/javascripts/application.js..."
|
148
|
+
system('echo >> app/assets/javascripts/application.js')
|
149
|
+
system('echo "//= require jquery.remotipart" >> app/assets/javascripts/application.js')
|
150
|
+
system('echo >> app/assets/javascripts/application.js')
|
151
|
+
puts "Paper_trail install..."
|
152
|
+
RVM.run "bundle exec rails g paper_trail:install"
|
153
|
+
|
154
|
+
|
155
|
+
puts "Migrating Devise and Versions"
|
156
|
+
system('bundle exec rake db:migrate')
|
157
|
+
|
158
|
+
puts "Creating header in app/views/inline_forms/_header.html.erb...\n"
|
159
|
+
header_src = "
|
158
160
|
<div id='Header'>
|
159
161
|
<div id='title'>
|
160
162
|
#{app_name} v<%= inline_forms_version -%>
|
@@ -166,12 +168,12 @@ production:
|
|
166
168
|
<% end -%>
|
167
169
|
<div style='clear: both;'></div>
|
168
170
|
</div>
|
169
|
-
|
170
|
-
|
171
|
-
|
171
|
+
"
|
172
|
+
FileUtils.mkdir_p 'app/views/inline_forms'
|
173
|
+
File.open( 'app/views/inline_forms/_header.html.erb', 'w') {|f| f.write(header_src) }
|
172
174
|
|
173
|
-
|
174
|
-
|
175
|
+
puts "Set application_name and _title in ApplicationHelper...\n"
|
176
|
+
app_helper = "
|
175
177
|
module ApplicationHelper
|
176
178
|
def application_name
|
177
179
|
#{app_name}
|
@@ -180,12 +182,12 @@ module ApplicationHelper
|
|
180
182
|
#{app_name}
|
181
183
|
end
|
182
184
|
end
|
183
|
-
|
184
|
-
|
185
|
+
"
|
186
|
+
File.open( 'app/helpers/application_helper.rb', 'w') {|f| f.write(app_helper) }
|
185
187
|
|
186
188
|
|
187
|
-
|
188
|
-
|
189
|
+
puts "Injecting precompile assets stuff in production.rb...\n"
|
190
|
+
precomp = "
|
189
191
|
\n
|
190
192
|
\n
|
191
193
|
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
@@ -193,27 +195,26 @@ end
|
|
193
195
|
config.assets.precompile += %w( inline_forms_application.js inline_forms_application.css devise.css )
|
194
196
|
end
|
195
197
|
\n"
|
196
|
-
|
198
|
+
File.open( 'config/environments/production.rb', 'a') {|f| f.write(precomp) }
|
197
199
|
|
198
|
-
|
199
|
-
|
200
|
-
|
200
|
+
puts "Capify...\n"
|
201
|
+
system('capify .')
|
202
|
+
system("cp #{src}/lib/generators/templates/deploy.rb config/deploy.rb")
|
201
203
|
|
202
|
-
|
203
|
-
|
204
|
+
puts "Unicorn Config...\n"
|
205
|
+
system("cp #{src}/lib/generators/templates/unicorn.rb config/unicorn.rb")
|
204
206
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
207
|
+
puts "Initializing git...\n"
|
208
|
+
system('git init')
|
209
|
+
system('echo >> .gitignore')
|
210
|
+
system('echo "nbproject" >> .gitignore')
|
211
|
+
system('echo "public/uploads" >> .gitignore')
|
212
|
+
system('echo >> .gitignore')
|
213
|
+
system('git add .')
|
214
|
+
system('git commit -a -m " * Initial"')
|
213
215
|
|
214
|
-
|
215
|
-
|
216
|
+
puts "\n\nDone! Now make your tables with 'rails g inline_forms ...\n"
|
217
|
+
puts "\nDon't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n\n"
|
216
218
|
|
217
219
|
|
218
220
|
|
219
|
-
end
|
data/lib/inline_forms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.31
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec-rails
|