survey_generator 0.2.94 → 0.2.95

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
- ZDFlMDNjMmYwZDJjMThlOWIyZmFiNjg2MmE4NTEwMjc1OGM1MWQ2Mg==
4
+ YmM5NTU1NzI1NWE5MjZiMzcwZTI1YzI0N2UzZjNlZDM5NTYzMzU4OQ==
5
5
  data.tar.gz: !binary |-
6
- NTFmZmMxYmFlZjFlZDAzYzM0NzhiNWYwNTU4MDRhNTZjMjE0ODJiMw==
6
+ ZGE4ZWNlZWM4NDcyOTkzZTM5NjE4MjZiZTUwYmQ2NjQ3YzlkZjJiNA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWVkMDQ1Yjc3OTI3MjM2YWQzZTVmMGQ5NGUwNGFjNjc0NWMyZDg2MjAzMmI1
10
- ZTg1NjIzMjE3NmZlMDQyMmViYjgxNzdlNDEyYzYyMDhkZmZmMTIzY2M5ZTQy
11
- YTJhYTk0MWY1MDI4ZjIwNGJiNTc0NWVkM2YzZjE5NzVhZTFlM2Q=
9
+ OTA4MTk5YmIyNDcyOGE1YWMwMDUzNmJhOTVhNDdhNWQ2YjAwZjk4ODAyN2M4
10
+ NzUzYTFiNmRkNzQyZDgxNTI4MDQ3YzNhM2VjN2JmMzRkZjJjYzM2Njg2OTli
11
+ ZGY4OTg3ZTRiM2U3Njc4Y2RjMDYzY2ExMmI3ZTQwYzlkNGE5NWI=
12
12
  data.tar.gz: !binary |-
13
- YWU2MDVjOTVkNjcyNWZmNTg3NWUzOTBjOTY3YTkwN2YyYzc2ZTE2YTRjNzVi
14
- ZjU3MWI5MDNlNjEyZjM1YjIzN2YzMDA0OTU3NWQxYTAwMzE3YzAyNDU2ZTVk
15
- ZjY0N2ExYWVlNmE4N2E1NTA2MzdiYTg3ZmUxYzk4ZjE5ZThlYTI=
13
+ MmM0MWFlYjI1MWJkZDU2NGQwMjcyYzA5ZGUxNjZmYzFjZTNlYjM3NGQ1ZGY1
14
+ ZWY0YTlmZDE5Mjg4MmI3ZGU0MDY2N2ZjMTQwNzFjMjliY2JlMzU0NzZlNDIz
15
+ NjU2ODc2YTMzZWU3ZGZkN2RjMWI4NTc3M2EzMjc5OWI2YmZlZjM=
@@ -8,30 +8,32 @@ class SurveyGenerator < Rails::Generators::Base
8
8
  class_option :populate, :type => :boolean, :default => false, :desc => "Populate database with users."
9
9
 
10
10
  def generate_survey
11
- init_gems if options.gems? or options.init?
12
-
13
- if File.exists? "#{model_path}.rb"
14
- require model_path
15
-
16
- if !(defined?(MODEL)).nil? && !MODEL.first.nil?
17
- puts "Generating ruby on rails source code for the defined survey."
18
-
19
- require 'metamodels/survey_metamodel'
11
+ if options.gems? or options.init?
12
+ init_gems
13
+ run 'rails g survey --migrate --populate' if options.init?
14
+ else
15
+ if File.exists? "#{model_path}.rb"
20
16
  require 'rgen/template_language'
21
17
  require 'rgen/array_extensions'
18
+ require 'metamodels/survey_metamodel'
19
+ require model_path
22
20
 
23
- tc = RGen::TemplateLanguage::DirectoryTemplateContainer.new(SurveyMetamodel, Rails.root.to_s)
24
- tc.load(File.dirname(__FILE__) + '/templates')
25
- tc.expand('main::root', for: MODEL.first)
26
-
27
- migrate if options.migrate? or options.init?
28
- populate if options.populate? or options.init?
21
+ if !(defined?(MODEL)).nil? && !MODEL.first.nil?
22
+ puts "Generating ruby on rails source code for the defined survey."
23
+
24
+ tc = RGen::TemplateLanguage::DirectoryTemplateContainer.new(SurveyMetamodel, Rails.root.to_s)
25
+ tc.load(File.dirname(__FILE__) + '/templates')
26
+ tc.expand('main::root', for: MODEL.first)
27
+
28
+ migrate if options.migrate? or options.init?
29
+ populate if options.populate? or options.init?
30
+ else
31
+ puts "Model is empty. Please define a survey first."
32
+ end
29
33
  else
30
- puts "Model is empty. Please define a survey first."
34
+ puts "Model file does not exist."
35
+ create_model_file
31
36
  end
32
- else
33
- puts "Model file does not exist."
34
- create_model_file
35
37
  end
36
38
  end
37
39
 
@@ -40,22 +42,22 @@ class SurveyGenerator < Rails::Generators::Base
40
42
  def init_gems
41
43
  puts " initializing application"
42
44
 
43
- #init_gemfile
45
+ init_gemfile
44
46
 
45
47
  #For all environments
46
- #gem 'rails', '3.2.13'
48
+ gem 'rails', '3.2.13'
47
49
  gem 'bootstrap-sass', '2.1'
48
50
  gem 'bcrypt-ruby', '3.0.1'
49
51
  gem 'faker', '1.0.1'
50
52
  gem 'will_paginate', '3.0.3'
51
53
  gem 'bootstrap-will_paginate', '0.0.6'
52
- #gem 'jquery-rails'
54
+ gem 'jquery-rails'
53
55
  gem 'rgen'
54
56
  gem 'survey_generator'
55
57
 
56
58
  #Group 'development' and 'test'
57
59
  gem_group :development, :test do
58
- #gem 'sqlite3'
60
+ gem 'sqlite3'
59
61
  gem 'rspec-rails', '2.11.0'
60
62
  end
61
63
 
@@ -72,11 +74,11 @@ class SurveyGenerator < Rails::Generators::Base
72
74
  gem 'pg', '0.12.2'
73
75
  end
74
76
 
75
- #gem_group :assets do
76
- # gem 'sass-rails','~> 3.2.3'
77
- # gem 'coffee-rails', '~> 3.2.1'
78
- # gem 'uglifier', '>= 1.0.3'
79
- #end
77
+ gem_group :assets do
78
+ gem 'sass-rails','~> 3.2.3'
79
+ gem 'coffee-rails', '~> 3.2.1'
80
+ gem 'uglifier', '>= 1.0.3'
81
+ end
80
82
 
81
83
  if File.exists? "#{Rails.root.to_s}/public/index.html"
82
84
  run "rm public/index.html"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: survey_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.94
4
+ version: 0.2.95
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dkemp04