survey_generator 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/generators/survey/survey_generator.rb +8 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDQ0MDJiZjU2ODE2NmJhYTJmMmI0ZjU1NjNkMDI3N2QzYTdmOTk3Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjEzNmIwZmRlYjI4MGQ2MzhiZWQwZDBiNjQ1OWNmNzA0MTZiZmUzZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTA0NzI1YmQxNzYzZTMzNDEwOWNmMjY4NjU1Mzc3OTdjNmYwZTA4NTkyYzMz
|
10
|
+
ZDE3YjAyN2I2YjhlOWJmYTMwOTQ0MGY5NzJmNGZjMmI4ZjU0YTg4NWRiNmVl
|
11
|
+
NjdhOTg0YjViOTBkMTU0Yjk2MzM0MjQxYTJhOTNlNDZmYTg5NDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTRmNzRmMTNlYmYyODBiZjdkOTEyNzk0YmJiMjNhN2Q5YWVjZjlhMjllZDNi
|
14
|
+
N2FmYjAyZTM0YjZlMTMwNzU0NGRkMzBhYzBmMmVkNGFlNzAwYTRlYWZiNTI5
|
15
|
+
MmE5MWI3ZDg5MjFmZTI2MDIzZDMwMWVhZmYzNjJiYmE0OTgzZmU=
|
@@ -2,12 +2,12 @@ $:.unshift File.dirname(__FILE__)
|
|
2
2
|
|
3
3
|
class SurveyGenerator < Rails::Generators::Base
|
4
4
|
argument :model_path, :type => :string, :default => "#{Rails.root.to_s}/gen/models/survey_model.rb"
|
5
|
-
class_option :init, :type => :boolean, :default => false, :desc => "Performs all actions
|
6
|
-
class_option :dynamic, :type => :boolean, :default => true, :desc => "Generates dynamic part of model
|
7
|
-
class_option :static, :type => :boolean, :default => true, :desc => "Generates static part of model
|
8
|
-
class_option :gems, :type => :boolean, :default => false, :desc => "
|
9
|
-
class_option :migrate, :type => :boolean, :default => false, :desc => "
|
10
|
-
class_option :populate, :type => :boolean, :default => false, :desc => "
|
5
|
+
class_option :init, :type => :boolean, :default => false, :desc => "Performs all actions"
|
6
|
+
class_option :dynamic, :type => :boolean, :default => true, :desc => "Generates dynamic part of the model"
|
7
|
+
class_option :static, :type => :boolean, :default => true, :desc => "Generates static part of the model"
|
8
|
+
class_option :gems, :type => :boolean, :default => false, :desc => "Initializes the application"
|
9
|
+
class_option :migrate, :type => :boolean, :default => false, :desc => "Performs database migrations"
|
10
|
+
class_option :populate, :type => :boolean, :default => false, :desc => "Populates database with users"
|
11
11
|
|
12
12
|
def generate_survey
|
13
13
|
out "Initializing Survey on Rails (SoR)"
|
@@ -144,8 +144,7 @@ class SurveyGenerator < Rails::Generators::Base
|
|
144
144
|
File.open(model_path, 'r+') do |file|
|
145
145
|
file.puts("require 'rgen/model_builder'")
|
146
146
|
file.puts("require 'metamodels/survey_metamodel'")
|
147
|
-
file.puts("")
|
148
|
-
file.puts("MODEL = RGen::ModelBuilder.build(SurveyMetamodel) do")
|
147
|
+
file.puts("\nMODEL = RGen::ModelBuilder.build(SurveyMetamodel) do")
|
149
148
|
file.puts("end")
|
150
149
|
end
|
151
150
|
end
|
@@ -153,7 +152,7 @@ class SurveyGenerator < Rails::Generators::Base
|
|
153
152
|
def migrate
|
154
153
|
out "Performing database migrations"
|
155
154
|
|
156
|
-
rake "db:reset"
|
155
|
+
rake "db:reset" if File.exists?("#{Rails.root.to_s}/db/schema.rb")
|
157
156
|
rake "db:migrate"
|
158
157
|
end
|
159
158
|
|