inline_forms 1.3.45 → 1.3.47

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.
@@ -1,9 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # copied from hobo and then modified. Some stuff is there because of that.
3
2
 
4
- require 'fileutils'
5
- require 'pathname'
6
- require 'rbconfig'
7
3
  require 'rvm'
8
4
 
9
5
  if not RVM.current
@@ -11,8 +7,10 @@ if not RVM.current
11
7
  exit 2
12
8
  end
13
9
 
10
+ # what is this?
14
11
  Signal.trap("INT") { puts; exit }
15
12
 
13
+ # require the version file
16
14
  src = File.join(File.dirname(__FILE__), "..")
17
15
  require "#{src}/lib/inline_forms/version.rb"
18
16
 
@@ -45,19 +43,26 @@ if !ARGV.empty? || app_name.nil? || !/^[a-zA-Z][0-9a-zA-Z_-]+/.match(app_name) |
45
43
  end
46
44
 
47
45
  puts "\nGenerating Rails app '#{app_name}'...\n"
48
- ruby_version = %x[rvm current]
49
46
  RVM.run "rails new #{app_name}"
50
47
 
51
- Dir.chdir(app_name)
52
- puts "\nWorking directory is now #{`pwd`}"
53
-
54
- puts "\nInstalling Gemfile...\n"
55
-
56
- gemfile_sources = "
48
+ puts "\nCreating and trusting .rvmrc...\n"
49
+ ruby_version = %x[rvm current]
50
+ system "echo rvm use #{ruby_version.chop}@#{app_name} --create > #{app_name}/.rvmrc"
51
+ system "cd #{app_name} && rvm rvmrc trust .rvmrc"
52
+
53
+ puts "\nChanging to '#{app_name}' with RVM...\n"
54
+ RVM.chdir(app_name) do
55
+ puts "\nWorking directory is now #{`pwd`}"
56
+ RVM.use_from_path! '.'
57
+ rvm_gemset = %x[rvm current]
58
+ puts "\nRVM gemset is now #{rvm_gemset}"
59
+
60
+ puts "\nInstalling Gemfile...\n"
61
+ gemfile_sources = "
57
62
  source 'http://rubygems.org'
58
63
 
59
- "
60
- gemfile_gems = "
64
+ "
65
+ gemfile_gems = "
61
66
 
62
67
  gem 'test-unit'
63
68
  gem 'rails'
@@ -81,8 +86,8 @@ gem 'unicorn'
81
86
  gem 'rvm'
82
87
  gem 'rvm-capistrano'
83
88
 
84
- "
85
- gemfile_development_group ="
89
+ "
90
+ gemfile_development_group ="
86
91
 
87
92
  # Include everything needed to run rake, tests, features, etc.
88
93
  group :development do
@@ -94,8 +99,8 @@ group :development do
94
99
  # gem 'rcov', '>= 0'
95
100
  end
96
101
 
97
- "
98
- gemfile_production_group ="
102
+ "
103
+ gemfile_production_group ="
99
104
  # these are just for production
100
105
  group :production do
101
106
  gem 'mysql2'
@@ -103,61 +108,54 @@ group :production do
103
108
  gem 'uglifier'
104
109
  end
105
110
 
106
- "
111
+ "
107
112
 
108
- File.open( 'Gemfile', 'w') {|f| f.write(gemfile_sources + gemfile_gems + gemfile_development_group + gemfile_production_group ) }
109
-
110
- puts "\nCreating and trusting .rvmrc...\n"
111
- system "echo rvm use #{ruby_version.chop}@#{app_name} --create > .rvmrc"
113
+ File.open( 'Gemfile', 'w') {|f| f.write(gemfile_sources + gemfile_gems + gemfile_development_group + gemfile_production_group ) }
112
114
 
113
115
 
114
- system "rvm rvmrc trust .rvmrc"
115
-
116
- RVM.use "#{ruby_version.chop}@#{app_name}"
117
-
118
- puts "\nRunning bundle...\n"
119
- RVM.run "bundle install"
120
-
121
- puts "\nDatabase setup: creating config/database.yml\n"
122
- development_stanza = "
116
+ puts "\nRunning bundle...\n"
117
+ system "bundle install"
118
+
119
+ puts "\nDatabase setup: creating config/database.yml\n"
120
+ development_stanza = "
123
121
  development:
124
122
  adapter: sqlite3
125
123
  database: db/development.sqlite3
126
124
  pool: 5
127
125
  timeout: 5000
128
- "
129
- production_stanza = "
126
+ "
127
+ production_stanza = "
130
128
  production:
131
129
  adapter: mysql2
132
130
  database: #{app_name}_p
133
131
  username: #{app_name}
134
132
  password: #{app_name}444
135
133
 
136
- "
137
- File.open( 'config/database.yml', 'w') {|f| f.write(development_stanza + production_stanza) }
138
-
139
- puts "\nDevise install..."
140
- RVM.run "bundle exec rails g devise:install"
141
- puts "\nDevise User model install with added name field..."
142
- RVM.run "bundle exec rails g devise User name:string"
143
- puts "\nInstall ckeditor..."
144
- RVM.run "bundle exec rails g ckeditor:install"
145
- puts "Create config file in app/assets/javascripts/ckeditor/config.js"
146
- FileUtils.mkdir_p 'app/assets/javascripts/ckeditor'
147
- system("cp #{src}/lib/app/assets/javascripts/ckeditor/config.js app/assets/javascripts/ckeditor")
148
- puts "Add remotipart to app/assets/javascripts/application.js..."
149
- system('echo >> app/assets/javascripts/application.js')
150
- system('echo "//= require jquery.remotipart" >> app/assets/javascripts/application.js')
151
- system('echo >> app/assets/javascripts/application.js')
152
- puts "Paper_trail install..."
153
- RVM.run "bundle exec rails g paper_trail:install"
154
-
155
-
156
- puts "Migrating Devise and Versions"
157
- system('bundle exec rake db:migrate')
158
-
159
- puts "Creating header in app/views/inline_forms/_header.html.erb...\n"
160
- header_src = "
134
+ "
135
+ File.open( 'config/database.yml', 'w') {|f| f.write(development_stanza + production_stanza) }
136
+
137
+ puts "\nDevise install..."
138
+ RVM.run "bundle exec rails g devise:install"
139
+ puts "\nDevise User model install with added name field..."
140
+ RVM.run "bundle exec rails g devise User name:string"
141
+ puts "\nInstall ckeditor..."
142
+ RVM.run "bundle exec rails g ckeditor:install"
143
+ puts "Create config file in app/assets/javascripts/ckeditor/config.js"
144
+ FileUtils.mkdir_p 'app/assets/javascripts/ckeditor'
145
+ system("cp #{src}/lib/app/assets/javascripts/ckeditor/config.js app/assets/javascripts/ckeditor")
146
+ puts "Add remotipart to app/assets/javascripts/application.js..."
147
+ system('echo >> app/assets/javascripts/application.js')
148
+ system('echo "//= require jquery.remotipart" >> app/assets/javascripts/application.js')
149
+ system('echo >> app/assets/javascripts/application.js')
150
+ puts "Paper_trail install..."
151
+ RVM.run "bundle exec rails g paper_trail:install"
152
+
153
+
154
+ puts "Migrating Devise and Versions"
155
+ system('bundle exec rake db:migrate')
156
+
157
+ puts "Creating header in app/views/inline_forms/_header.html.erb...\n"
158
+ header_src = "
161
159
  <div id='Header'>
162
160
  <div id='title'>
163
161
  #{app_name} v<%= inline_forms_version -%>
@@ -169,12 +167,12 @@ header_src = "
169
167
  <% end -%>
170
168
  <div style='clear: both;'></div>
171
169
  </div>
172
- "
173
- FileUtils.mkdir_p 'app/views/inline_forms'
174
- File.open( 'app/views/inline_forms/_header.html.erb', 'w') {|f| f.write(header_src) }
170
+ "
171
+ FileUtils.mkdir_p 'app/views/inline_forms'
172
+ File.open( 'app/views/inline_forms/_header.html.erb', 'w') {|f| f.write(header_src) }
175
173
 
176
- puts "Set application_name and _title in ApplicationHelper...\n"
177
- app_helper = "
174
+ puts "Set application_name and _title in ApplicationHelper...\n"
175
+ app_helper = "
178
176
  module ApplicationHelper
179
177
  def application_name
180
178
  #{app_name}
@@ -183,13 +181,13 @@ module ApplicationHelper
183
181
  #{app_name}
184
182
  end
185
183
  end
186
- "
187
- File.open( 'app/helpers/application_helper.rb', 'w') {|f| f.write(app_helper) }
184
+ "
185
+ File.open( 'app/helpers/application_helper.rb', 'w') {|f| f.write(app_helper) }
188
186
 
189
187
 
190
188
 
191
- puts "Overwriting application_controller...\n"
192
- app_cont = "
189
+ puts "Overwriting application_controller...\n"
190
+ app_cont = "
193
191
  class ApplicationController < ActionController::Base
194
192
  protect_from_forgery
195
193
 
@@ -201,11 +199,11 @@ class ApplicationController < ActionController::Base
201
199
  # redirect_to new_user_session_path, :alert => exception.message
202
200
  # end
203
201
  end
204
- "
205
- File.open( 'app/controllers/application_controller.rb', 'w+') {|f| f.write(app_cont) }
202
+ "
203
+ File.open( 'app/controllers/application_controller.rb', 'w+') {|f| f.write(app_cont) }
206
204
 
207
- puts "Injecting precompile assets stuff in production.rb...\n"
208
- precomp = "
205
+ puts "Injecting precompile assets stuff in production.rb...\n"
206
+ precomp = "
209
207
  \n
210
208
  \n
211
209
  # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
@@ -225,26 +223,26 @@ precomp = "
225
223
  }
226
224
  end
227
225
  \n"
228
- File.open( 'config/environments/production.rb', 'a') {|f| f.write(precomp) }
226
+ File.open( 'config/environments/production.rb', 'a') {|f| f.write(precomp) }
229
227
 
230
- puts "Capify...\n"
231
- system('capify .')
232
- system("cp #{src}/lib/generators/templates/deploy.rb config/deploy.rb")
228
+ puts "Capify...\n"
229
+ system('capify .')
230
+ system("cp #{src}/lib/generators/templates/deploy.rb config/deploy.rb")
233
231
 
234
- puts "Unicorn Config...\n"
235
- system("cp #{src}/lib/generators/templates/unicorn.rb config/unicorn.rb")
232
+ puts "Unicorn Config...\n"
233
+ system("cp #{src}/lib/generators/templates/unicorn.rb config/unicorn.rb")
236
234
 
237
- puts "Initializing git...\n"
238
- system('git init')
239
- system('echo >> .gitignore')
240
- system('echo "nbproject" >> .gitignore')
241
- system('echo "public/uploads" >> .gitignore')
242
- system('echo >> .gitignore')
243
- system('git add .')
244
- system('git commit -a -m " * Initial"')
245
-
246
- puts "\n\nDone! Now make your tables with 'rails g inline_forms ...\n"
247
- puts "\nDon't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n\n"
235
+ puts "Initializing git...\n"
236
+ system('git init')
237
+ system('echo >> .gitignore')
238
+ system('echo "nbproject" >> .gitignore')
239
+ system('echo "public/uploads" >> .gitignore')
240
+ system('echo >> .gitignore')
241
+ system('git add .')
242
+ system('git commit -a -m " * Initial"')
248
243
 
244
+ puts "\n\nDone! Now make your tables with 'rails g inline_forms ...\n"
245
+ puts "\nDon't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete public/index.html\n\n"
249
246
 
247
+ end
250
248
 
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "1.3.45"
3
+ VERSION = "1.3.47"
4
4
  end
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.45
4
+ version: 1.3.47
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-07-14 00:00:00.000000000 Z
12
+ date: 2012-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rvm