survey_on_rails 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTg4MzA1NzRjNzExNGUxNDI3MjM4MmEwMDk0ODRkYTIzZTBhZDc4Zg==
4
+ NGFlOWE4M2ZmMzk2YWZmYTU1M2RkMDdjNDk3Y2QyNzcwMmQ3MjI3YQ==
5
5
  data.tar.gz: !binary |-
6
- Zjc2MjliYzdkNjkyNjYzZTU3NWNmYTdjOGUxMDI0ZjQyNDQyYzZjMA==
6
+ OTRiMWMyNmVkNDU2ZWJkMjRlYTM4ZWVjNzc4ZmUxN2I0ZDljODg1Mw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjA1OWFkZTEzZjVkMzdmNTI1ZWY0MmJjNDNiNjM0NDE2YzVlNjZjMmZhY2U4
10
- NjA4ZTEwNWVmOTAzODcyMTc5Y2M1Y2JkYTM2ZmU0N2RjMjQwZmU5NmY5MDQ4
11
- MTE2MjU1NGM1Y2FjMjAwZjBkYWM2NDdjMjlmNGQ1MTc1MzA4OTk=
9
+ OWE0ZDZiM2E4NmZlMDk0MzQwMjdmOTVlM2Y1N2Q2NWQ4ZTA1ZDU1NjA5NGMx
10
+ YmM4NmQ2YTI3ZTRmZTM5MWQ3ZTFhZGUzYWIxNjk0ZGZhNzU2MmI5NDQwZGUz
11
+ ZDFjY2M1N2FkOTQ3MGQyNTI5ZGE1YjlkYTA3YWM3YzY5Mzc4ZmM=
12
12
  data.tar.gz: !binary |-
13
- MTUyMjM2MGRhZTRmMzkwZWU3YjBjZDNlODc1MmNmM2UxM2QxZjVmMDExMDAy
14
- MzIyMjcyMTJhOTBkMTk2MTBjYmVjMzE4OWQ1MzUwMjY0NTVjNWIxOGIyNTE3
15
- MzBlOGQ3MmQxOWEzMTlkMmM5NTc0MThjMWFmMGIyZjliZDA5NTg=
13
+ ZTcxOTEwNzk0YTBiZWMzYmE0ZDVkNmQ2YWY5ZjYwNWE5ZTI3MTM0MDY4ZjI2
14
+ ZGYyYWIzMzg1NTUxYmU3YTZhNTEyZjJlNTQ5OWJmNjM1M2U2OTFlOTM5MGQy
15
+ MjVlNGZlMTMwMDY4OTYxNjQ0Njg5NGM4MGQwYzhkNDMyZWE5MDE=
@@ -0,0 +1,6 @@
1
+ run 'gem install survey_on_rails'
2
+ run 'gem install rgen'
3
+ gem 'survey_on_rails'
4
+ gem 'rgen'
5
+ run 'bundle install'
6
+ run 'rails g survey --init'
@@ -97,6 +97,7 @@ class SurveyGenerator < Rails::Generators::Base
97
97
  file_name = "Gemfile"
98
98
  File.new(file_name) unless File.exists?(file_name)
99
99
  File.open(file_name, 'r+') do |file|
100
+ file.truncate(0)
100
101
  file.puts("source 'https://rubygems.org'")
101
102
 
102
103
  file.puts("\n#For all environments")
@@ -160,6 +161,7 @@ class SurveyGenerator < Rails::Generators::Base
160
161
 
161
162
  if create_file(model_path)
162
163
  File.open(model_path, 'r+') do |file|
164
+ file.truncate(0)
163
165
  file.puts("Dir[File.dirname(__FILE__) + '/*.rb'].each { |file| require file }")
164
166
  file.puts("\nAPPLICATION = SurveyOnRails::Builder::build do")
165
167
  file.puts("\tapplication do")
@@ -174,6 +176,7 @@ class SurveyGenerator < Rails::Generators::Base
174
176
  model_file_path = "#{model_directory}/model.rb"
175
177
  if create_file(model_file_path)
176
178
  File.open(model_file_path, 'r+') do |file|
179
+ file.truncate(0)
177
180
  file.puts("SURVEYS = SurveyOnRails::Builder::build do")
178
181
  file.puts("end")
179
182
  end
@@ -182,6 +185,7 @@ class SurveyGenerator < Rails::Generators::Base
182
185
  style_file_path = "#{model_directory}/styles.rb"
183
186
  if create_file(style_file_path)
184
187
  File.open(style_file_path, 'r+') do |file|
188
+ file.truncate(0)
185
189
  file.puts("STYLES = SurveyOnRails::Builder::build do")
186
190
  file.puts("end")
187
191
  end
@@ -190,6 +194,7 @@ class SurveyGenerator < Rails::Generators::Base
190
194
  static_file_path = "#{model_directory}/static.rb"
191
195
  if create_file(static_file_path)
192
196
  File.open(static_file_path, 'r+') do |file|
197
+ file.truncate(0)
193
198
  file.puts("STATIC_PAGES = SurveyOnRails::Builder::build do")
194
199
  file.puts("end")
195
200
 
@@ -208,6 +213,7 @@ class SurveyGenerator < Rails::Generators::Base
208
213
  view_file_path = "#{model_directory}/view.rb"
209
214
  if create_file(view_file_path)
210
215
  File.open(view_file_path, 'r+') do |file|
216
+ file.truncate(0)
211
217
  file.puts("FORMS = SurveyOnRails::Builder::build do")
212
218
  file.puts("end")
213
219
  end
@@ -218,7 +224,7 @@ class SurveyGenerator < Rails::Generators::Base
218
224
  out "Performing database migrations"
219
225
  generate_static
220
226
 
221
- rake "db:reset" if File.exists?("#{Rails.root.to_s}/db/schema.rb")
227
+ rake "db:reset"
222
228
  rake "db:migrate"
223
229
  end
224
230
 
@@ -3,6 +3,7 @@
3
3
  <% define 'static' do %>
4
4
  <% file "config/routes.rb" do %>
5
5
  <% expand 'start' %>
6
+ root 'sessions#new'
6
7
  <% expand 'end', :indent => indent %>
7
8
  <% end %>
8
9
  <% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: survey_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Kemper
@@ -90,6 +90,7 @@ files:
90
90
  - lib/generators/survey/USAGE
91
91
  - lib/survey_on_rails/utils/builder.rb
92
92
  - lib/survey_on_rails/utils/string.rb
93
+ - lib/app_template.rb
93
94
  - lib/survey_on_rails.rb
94
95
  homepage: https://github.com/Dkemp04/Generator
95
96
  licenses: []