jinda 0.7.0.4 → 0.7.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e005b8c5e10b6bea34554b5539ecd3b6d9e8ef8f5077d7dccff000523b59f04c
4
- data.tar.gz: 5f92f912934ae5936edd5ab9a6b2bc0dd5ba4a497e13b78ec89ebc3f35f8c9eb
3
+ metadata.gz: c2dab3c1ee5e525bfce90630e720c8e45cd79da38196853f29df66db25d50526
4
+ data.tar.gz: af80a165a501ceffb2e150dbf3b1ecdb2647d14ebef721ef3392364deb1bfdaf
5
5
  SHA512:
6
- metadata.gz: 2ed46b40d167ec06f330f745982dde313379e44049b3cd752db9913818ff4b92042ffe730a53e62231fac887b80ac467987a291c9dd8b1891eb0a2fee354c944
7
- data.tar.gz: 7bb1ddc0a2d39f131020e5bb18ec6f58e97d9f251c5f1df10f3dae5577a56115ebdbbc8f8f57d5c838d4172227bf616d15d535d7bc772c2fed01a0bacc52b5db
6
+ metadata.gz: e01c9a5848758ba074e0e78b0cfdf3b917a47aeacca3b64e31338cc6a48eff49b10f36dbe9cce21a12caffcddb0429d00dad2b7b0e328459acd44b0581d809dd
7
+ data.tar.gz: f5e7603baf72c5f85f413daf9ce47ec66e14d465ac0444e9006153d6e76626262bbefdfee06526dbe8619a317b722e3e4e60f7dbf59e77e31b57bbb30fad06f4
data/README.md CHANGED
@@ -15,7 +15,7 @@ Rails Application Generator using Freemind
15
15
  These versions works for sure but others may do.
16
16
 
17
17
  * Ruby 2.7.1
18
- * Rails 6.0.3
18
+ * Rails 6.1.0
19
19
  * MongoDB 6
20
20
  * Freemind 1.0.1
21
21
 
@@ -40,7 +40,7 @@ app without ActiveRecord
40
40
 
41
41
  ## Add jinda to your Gemfile:
42
42
 
43
- gem 'jinda', '~> 0.7.0.1'
43
+ gem 'jinda'
44
44
 
45
45
  For Development (most updated)
46
46
 
@@ -62,8 +62,6 @@ Then run bundle again to install additional gems added by jinda
62
62
 
63
63
  $ bundle
64
64
 
65
- (or run all with "sh install.sh" )
66
-
67
65
  configure mongoid, omniauth
68
66
 
69
67
  $ rails generate jinda:config
@@ -18,9 +18,12 @@ module JindaRunConcern
18
18
  # Check if help file available for this form
19
19
  ###############################################################################################
20
20
  @help = File.read(fhelp) if File.exists?(fhelp)
21
- f= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.erb"
22
- if File.file?(f)
23
- @ui= File.read(f)
21
+ f1= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.erb"
22
+ f2= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.haml"
23
+ if File.file?(f1)
24
+ @ui= File.read(f1)
25
+ elsif File.file?(f2)
26
+ @ui= File.read(f2)
24
27
  else
25
28
  # flash[:notice]= "Error: Can not find the view file for this controller"
26
29
  ma_log "Error: Can not find the view file for this controller"
@@ -20,7 +20,7 @@
20
20
  %b Recently tested with:
21
21
  %ul
22
22
  %li Rubygems 2.7.1
23
- %li Rails 6.0.3
23
+ %li Rails 6.1.0
24
24
  %div.col-lg-4.col-md-4.col-xs-12
25
25
  %div.small-box.bg-yellow
26
26
  %div.inner
@@ -43,7 +43,6 @@ module Jinda
43
43
  end
44
44
  end
45
45
 
46
-
47
46
  desc "Set up mongoid config"
48
47
  def setup_mongoid
49
48
  generate "mongoid:config"
@@ -5,68 +5,141 @@ module Jinda
5
5
  def self.source_root
6
6
  File.dirname(__FILE__) + "/templates"
7
7
  end
8
-
9
8
  def setup_gems
10
- gem 'maruku', '~> 0.7.3'
11
- gem 'rouge'
12
- gem 'normalize-rails'
13
- gem 'font-awesome-rails'
14
- gem 'font-awesome-sass', '~> 5.12.0'
15
- gem 'mongoid-paperclip', require: 'mongoid_paperclip'
16
- gem 'meta-tags'
17
- gem 'jquery-turbolinks', '2.1.0'
18
- gem 'mongo', '2.11.3'
19
- gem 'bson', '4.4.2'
20
- gem 'mongoid', '7.1.0.rc0'
21
- gem 'turbolinks_render'
22
- gem 'nokogiri', '~> 1.11.0'
23
- gem 'haml', '~> 5.1', '>= 5.1.2'
24
- gem 'haml-rails', '~> 2.0.1'
25
- gem 'mail'
26
- gem 'prawn'
27
- gem 'redcarpet'
28
- gem 'bcrypt'
29
- gem 'oauth2', '1.4.4'
30
- gem 'omniauth', '1.9.1'
31
- gem 'omniauth-oauth2', '1.6.0'
32
- gem 'omniauth-identity', '~> 1.1.1'
33
- gem 'omniauth-facebook', '6.0.0'
34
- gem 'omniauth-google-oauth2', '0.8.0'
35
- gem 'dotenv-rails', '2.7.5'
36
- gem 'cloudinary', '1.13.2'
37
- gem 'kaminari', '1.2.0'
38
- gem 'kaminari-mongoid', '1.0.1'
39
- gem 'jquery-rails', '4.3.5'
40
- gem_group :development, :test do
41
- gem 'shoulda'
42
- gem 'rspec'
43
- gem 'rspec-rails'
44
- gem 'better_errors'
45
- gem 'binding_of_caller'
46
- gem 'pry-byebug'
47
- gem 'factory_bot_rails'
48
- gem 'database_cleaner'
49
- gem 'guard'
50
- gem 'guard-rspec'
51
- gem 'guard-minitest'
52
- gem 'capybara'
53
- gem 'selenium-webdriver'
54
- gem 'rb-fsevent'
55
- gem 'valid_attribute'
56
- gem 'faker'
9
+ # define required gems: jinda_gem, jinda_dev_gem
10
+ jinda_gem =
11
+ [
12
+ ["bson", "4.4.2"],
13
+ ["maruku", "~> 0.7.3"],
14
+ ["bcrypt"],
15
+ ["rouge"],
16
+ ["normalize-rails"],
17
+ ["font-awesome-rails"],
18
+ ["font-awesome-sass", "~> 5.12.0"],
19
+ ["meta-tags"],
20
+ ["jquery-turbolinks", "2.1.0"],
21
+ ["mongo", "2.11.3"],
22
+ ["turbolinks_render"],
23
+ ["haml-rails", "~> 2.0.1"],
24
+ ["haml", "~> 5.1", ">= 5.1.2"],
25
+ ["mail"],
26
+ ["prawn"],
27
+ ["redcarpet"],
28
+ ["oauth2", "1.4.4"],
29
+ ["omniauth", "1.9.1"],
30
+ ["omniauth-oauth2", "1.6.0"],
31
+ ["omniauth-identity", "~> 1.1.1"],
32
+ ["omniauth-facebook", "6.0.0"],
33
+ ["omniauth-google-oauth2", "0.8.0"],
34
+ ["dotenv-rails"],
35
+ ["cloudinary", "1.13.2"],
36
+ ["kaminari", "1.2.0"],
37
+ ["jquery-rails", "4.3.5"]
38
+ ]
39
+
40
+ jinda_custom =
41
+ [
42
+ ["mongoid-paperclip", require: "mongoid_paperclip"],
43
+ ["kaminari-mongoid", "1.0.1"],
44
+ ["nokogiri", "~> 1.11.0"],
45
+ ["mongoid", git: "git@github.com:kul1/mongoid.git"]
46
+ ]
47
+
48
+ jinda_dev_gem =
49
+ [
50
+ ["shoulda"],
51
+ ["rspec"],
52
+ ["rspec-rails"],
53
+ ["better_errors"],
54
+ ["binding_of_caller"],
55
+ ["pry-byebug"],
56
+ ["factory_bot_rails"],
57
+ ["database_cleaner"],
58
+ ["guard"],
59
+ ["guard-rspec"],
60
+ ["guard-minitest"],
61
+ ["capybara"],
62
+ ["selenium-webdriver"],
63
+ ["rb-fsevent"],
64
+ ["valid_attribute"],
65
+ ["faker"]
66
+ ]
67
+
68
+ # Check each jinda_gem and create new array if found one otherwise just create.
69
+ # Open Gemfile add gem if not exist
70
+ jinda_gem.each do |g|
71
+ unless (%x(gem list -e --no-versions #{g[0]})) == "#{g[0]}\n"
72
+ if g.count == 2
73
+ gem g[0], g[1]
74
+ else
75
+ gem g[0]
76
+ end
77
+ else
78
+ if g.count == 2
79
+ xgem_0 = %x(gem list -e #{g[0]})
80
+ unless xgem_0.include?(("#{g[1]}").gsub(/[~> ]/, ''))
81
+ say " Found existing #{xgem_0} in Gemfile or System, Please edit Gemfile", :red
82
+ gem g[0], g[1]
83
+ else
84
+ say " Checking #{g[0]} found Ver. #{g[1]} already exist in Gemfile", :green
85
+ end
86
+ end
87
+ say " SKIP adding #{g[0]} in Gemfile", :yellow
88
+ end
57
89
  end
58
- end
59
90
 
91
+ # create list of gem in sub-group dev and test
92
+ jinda_dev_new = Array.new
93
+ jinda_dev_gem.each do |g|
94
+ unless (%x(gem list -e --no-versions #{g[0]})) == "#{g[0]}\n"
95
+ jinda_dev_new << g
96
+ else
97
+ say " #{g[0]} already exist in Gemfile", :yellow
98
+ end
99
+ end
100
+ unless jinda_dev_new.count == 0
101
+ gem_group :development, :test do
102
+ jinda_dev_new.each do |n|
103
+ if n.count == 1
104
+ gem n[0]
105
+ else
106
+ gem n[0], n[1]
107
+ end
108
+ end
109
+ end
110
+ end
111
+
112
+ # create list of custom gem
113
+ jinda_custom_new = Array.new
114
+ jinda_custom.each do |g|
115
+ unless (%x(gem list -e --no-versions #{g[0]})) == "#{g[0]}\n"
116
+ jinda_custom_new << g
117
+ else
118
+ say " #{g[0]} already exist in Gemfile", :yellow
119
+ end
120
+ end
121
+ unless jinda_custom_new.count == 0
122
+ jinda_custom_new.each do |c|
123
+ say " Checking if #{c[0]} already exist in Gemfile", :yellow
124
+ if c.count == 1
125
+ gem c[0]
126
+ else
127
+ gem c[0], c[1]
128
+ end
129
+ end
130
+ end
131
+
132
+ end
60
133
  def setup_app
61
134
  # inside("public") { run "FileUtils.mv index.html index.html.bak" }
62
- inside("db") {(File.file? "seeds.rb") ? (FileUtils.mv "seeds.rb", "seeds.rb.bak") : ( say "no seeds.rb", :green)}
135
+ inside("db") {(File.file? "seeds.rb") ? (FileUtils.mv "seeds.rb", "seeds.rb.bak") : ( say "no seeds.rb", :green)}
63
136
  inside("app/views/layouts") {(File.file? "application.html.erb") ? (FileUtils.mv 'application.html.erb', 'application.html.erb.bak') : ( say "no app/views/layout/ application.html.erb", :blue )}
64
137
  inside("app/controllers") {(File.file? "application_controller.rb") ? (FileUtils.mv 'application_controller.rb', 'application_controller.rb.bak' ) : ( say "no app/controller/application_controller.rb, :blue ")}
65
138
  inside("app/helpers") {(File.file? "application_helper.rb") ? (FileUtils.mv 'application_helper.rb', 'application_helper.rb.bak') : ( say "no app/helpers/application_helper.rb", :blue)}
66
139
  inside("app/assets/javascripts") {(File.file? 'application.js') ? (FileUtils.mv 'application.js', 'application.js.bak') : ( say "no application.js", :blue)}
67
140
  inside("app/assets/stylesheets") {(File.file? "application.css") ? (FileUtils.mv 'application.css', 'application.css.bak') : ( say "no application.css", :blue)}
68
141
  inside("config/initializers") {(File.file? "omniauth.rb") ? (FileUtils.mv 'omniauth.rb', 'omniauth.rb.bak') : (say "no omniauth.rb", :blue)}
69
- # inside("config/initializers") {(File.file? "mongoid.rb") ? (FileUtils.mv 'mongoid.rb', 'mongoid.rb.bak') : (say "no mongoid.rb")}
142
+ inside("config/initializers") {(File.file? "mongoid.rb") ? (FileUtils.mv 'mongoid.rb', 'mongoid.rb.bak') : (say "no mongoid.rb")}
70
143
  inside("app/assets/config") {(File.file? "manifest.js") ? (FileUtils.mv "manifest.js", "manifest.js-rails") : (puts "backup to manifest.js-rails")}
71
144
  directory "app"
72
145
  directory "spec"
@@ -79,79 +152,32 @@ module Jinda
79
152
  # inside("app/assets/javascripts") {(File.file? "application.js") ? ( say "Please include application-org.js in application.js", :red) : (FileUtils.mv 'application-org.js', 'application.js')}
80
153
  # inside("app/assets/stylesheets") {(File.file? "application.css") ? ( say "Please include application-org.css in application.css", :red) : (FileUtils.mv 'application-org.css', 'application.css')}
81
154
  # inside("app/assets/stylesheets") {(File.file? "application.css.scss") ? ( say "Please include application-org.css.scss in application.css.scss", :red) : (FileUtils.mv 'application-org.css.scss', 'application.css.scss')}
82
- inside("app/controllers") {(File.file? "admins_controller.rb") ? ( say "Please merge existing jinda_org/admins_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/admins_controller.rb', 'admins_controller.rb')}
83
- inside("app/controllers") {(File.file? "articles_controller.rb") ? ( say "Please merge existing jinda_org/articles_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/articles_controller.rb', 'articles_controller.rb')}
84
- inside("app/controllers") {(File.file? "comments_controller.rb") ? ( say "Please merge existing jinda_org/comments_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/comments_controller.rb', 'comments_controller.rb')}
85
- inside("app/controllers") {(File.file? "docs_controller.rb") ? ( say "Please merge existing jinda_org/docs_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/docs_controller.rb', 'docs_controller.rb')}
86
- inside("app/controllers") {(File.file? "identities_controller.rb") ? ( say "Please merge existing jinda_org/identities_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/identities_controller.rb', 'identities_controller.rb')}
87
- inside("app/controllers") {(File.file? "application_controller.rb") ? ( say "Pleas merge existing jinda_org/application_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/application_controller.rb', 'application_controller.rb')}
155
+ inside("app/controllers") {(File.file? "admins_controller.rb") ? ( say " Please merge existing jinda_org/admins_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/admins_controller.rb', 'admins_controller.rb')}
156
+ inside("app/controllers") {(File.file? "articles_controller.rb") ? ( say " Please merge existing jinda_org/articles_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/articles_controller.rb', 'articles_controller.rb')}
157
+ inside("app/controllers") {(File.file? "comments_controller.rb") ? ( say " Please merge existing jinda_org/comments_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/comments_controller.rb', 'comments_controller.rb')}
158
+ inside("app/controllers") {(File.file? "docs_controller.rb") ? ( say " Please merge existing jinda_org/docs_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/docs_controller.rb', 'docs_controller.rb')}
159
+ inside("app/controllers") {(File.file? "identities_controller.rb") ? ( say " Please merge existing jinda_org/identities_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/identities_controller.rb', 'identities_controller.rb')}
160
+ inside("app/controllers") {(File.file? "application_controller.rb") ? ( say " Pleas merge existing jinda_org/application_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/application_controller.rb', 'application_controller.rb')}
88
161
  ## Moved to Engine
89
- # inside("app/controllers") {(File.file? "jinda_controller.rb") ? ( say "Please merge existing jinda_org/jinda_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/jinda_controller.rb', 'jinda_controller.rb')}
90
- inside("app/controllers") {(File.file? "password_resets_controller.rb") ? ( say "Please merge existing jinda_org/password_resets_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/password_resets_controller.rb', 'password_resets_controller.rb')}
91
- inside("app/controllers") {(File.file? "password_resets.rb") ? ( say "Please merge existing jinda_org/password_resets.rb after this installation", :red) : (FileUtils.mv 'jinda_org/password_resets.rb', 'password_resets.rb')}
92
- inside("app/controllers") {(File.file? "sessions_controller.rb") ? ( say "Please merge existing jinda_org/sessions_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/sessions_controller.rb', 'sessions_controller.rb')}
93
- inside("app/controllers") {(File.file? "users_controller.rb") ? ( say "Please merge existing jinda_org/users_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/users_controller.rb', 'users_controller.rb')}
94
- inside("app/controllers") {(File.file? "sitemap_controller.rb") ? ( say "Please merge existing jinda_org/sitemap_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/sitemap_controller.rb', 'sitemap_controller.rb')}
95
- inside("app/controllers") {(File.file? "notes_controller.rb") ? ( say "Please merge existing jinda_org/notes_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/notes_controller.rb', 'notes_controller.rb')}
162
+ # inside("app/controllers") {(File.file? "jinda_controller.rb") ? ( say " Please merge existing jinda_org/jinda_controller.rb after this installation", :red) : (FileUtils.mv 'jinda_org/jinda_controller.rb', 'jinda_controller.rb')}
163
+ inside("app/controllers") {(File.file? "password_resets_controller.rb") ? ( say " Please merge existing jinda_org/password_resets_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/password_resets_controller.rb', 'password_resets_controller.rb')}
164
+ inside("app/controllers") {(File.file? "password_resets.rb") ? ( say " Please merge existing jinda_org/password_resets.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/password_resets.rb', 'password_resets.rb')}
165
+ inside("app/controllers") {(File.file? "sessions_controller.rb") ? ( say " Please merge existing jinda_org/sessions_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/sessions_controller.rb', 'sessions_controller.rb')}
166
+ inside("app/controllers") {(File.file? "users_controller.rb") ? ( say " Please merge existing jinda_org/users_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/users_controller.rb', 'users_controller.rb')}
167
+ inside("app/controllers") {(File.file? "sitemap_controller.rb") ? ( say " Please merge existing jinda_org/sitemap_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/sitemap_controller.rb', 'sitemap_controller.rb')}
168
+ inside("app/controllers") {(File.file? "notes_controller.rb") ? ( say " Please merge existing jinda_org/notes_controller.rb after this installation", :yellow) : (FileUtils.mv 'jinda_org/notes_controller.rb', 'notes_controller.rb')}
96
169
  end
97
170
  # routes created each line as reversed order in routes
98
171
  # Moved routes to Engine
99
172
  def setup_routes
100
- # route "end"
101
- # route " end"
102
- # route " namespace :v1 do resources :notes, :only => [:index] end"
103
- # route " namespace :api do"
104
- # route "post '/api/v1/notes' => 'api/v1/notes#create', as: 'api_v1_notes'"
105
- # route "get '/api/v1/notes/my' => 'api/v1/notes#my'"
106
- # route "\# api"
107
173
  route "root :to => 'jinda#index'"
108
- # route "resources :jinda, :only => [:index, :new]"
109
- # route "resources :password_resets"
110
- # route "resources :sessions"
111
- # route "resources :identities"
112
- # route "resources :users"
113
- # route "resources :docs"
114
- # route "resources :notes"
115
- # route "resources :comments"
116
- # route "resources :articles do resources :comments end"
117
- # route "get '/jinda/document/:id' => 'jinda#document'"
118
- # route "get '/notes/destroy/:id' => 'notes#destroy'"
119
- # route "get '/notes/my/destroy/:id' => 'notes#destroy'"
120
- # route "get '/docs/my/destroy' => 'docs#destroy'"
121
- # route "get '/notes/my' => 'notes/my'"
122
- # route "get '/docs/my' => 'docs/my'"
123
- # route "get '/articles/edit' => 'articles/edit'"
124
- # route "get '/articles/show' => 'articles/show'"
125
- # route "get '/articles/my/destroy' => 'articles#destroy'"
126
- # route "get '/articles/my' => 'articles#my'"
127
- # route "get '/logout' => 'sessions#destroy', :as => 'logout'"
128
- # route "get '/auth/failure' => 'sessions#destroy'"
129
- # route "get '/auth/:provider/callback' => 'sessions#create'"
130
- # route "post '/auth/:provider/callback' => 'sessions#create'"
131
- # route "\# end jinda method routes"
132
- # route "post '/jinda/end_output' => 'jinda#end_output'"
133
- # route "post '/jinda/end_form' => 'jinda#end_form'"
134
- # route "post '/jinda/pending' => 'jinda#index'"
135
- # route "post '/jinda/init' => 'jinda#init'"
136
- # route "jinda_methods.each do \|aktion\| get \"/jinda/\#\{aktion\}\" => \"jinda#\#\{aktion\}\" end"
137
- # route "jinda_methods += ['error_logs', 'notice_logs', 'cancel', 'run_output', 'end_output']"
138
- # route "jinda_methods += ['run_redirect', 'run_direct_to','run_if']"
139
- # route "jinda_methods += ['init', 'run', 'run_mail', 'document', 'run_do', 'run_form', 'end_form']"
140
- # route "jinda_methods = ['pending', 'status', 'search', 'doc', 'doc_print', 'logs', 'ajax_notice']"
141
- # route "\# start jiinda method routes"
142
- end
174
+ end
143
175
 
144
176
  def setup_env
145
177
  FileUtils.mv "README.md", "README.md.bak"
146
178
  create_file 'README.md', ''
147
- # FileUtils.mv 'install.sh', 'install.sh'
148
- # inject_into_file 'config/application.rb', :after => 'require "active_resource/railtie"' do
149
- # inject_into_file 'config/application.rb', :after => 'require "rails"' do
150
- # "\nrequire 'rexml/document'\n"+
151
- # "\nrequire 'mongoid/railtie'\n"
152
- # end
153
179
  application do
154
- %q{
180
+ %q{
155
181
  # Jinda default
156
182
  config.generators do |g|
157
183
  g.orm :mongoid
@@ -174,10 +200,10 @@ module Jinda
174
200
  # :enable_starttls_auto => true }
175
201
  # config.action_mailer.raise_delivery_errors = true
176
202
  # config.action_mailer.perform_deliveries = true
177
- }
203
+ }
178
204
  end
179
205
  initializer "jinda.rb" do
180
- %q{# encoding: utf-8
206
+ %q{# encoding: utf-8
181
207
  MM = "#{Rails.root}/app/jinda/index.mm"
182
208
  DEFAULT_TITLE = 'Jinda'
183
209
  DEFAULT_HEADER = 'Jinda'
@@ -190,25 +216,26 @@ NEXT = "Next >"
190
216
  IMAGE_LOCATION = "upload"
191
217
  # for debugging
192
218
  # DONT_SEND_MAIL = true
193
- }
219
+ }
194
220
  end
195
-
196
- initializer "mongoid.rb" do
197
- %q{# encoding: utf-8
198
- #
199
- # Mongoid 6 follows the new pattern of AR5 requiring a belongs_to relation to always require its parent
200
- # belongs_to` will now trigger a validation error by default if the association is not present.
201
- # You can turn this off on a per-association basis with `optional: true`.
202
- # (Note this new default only applies to new Rails apps that will be generated with
203
- # `config.active_record.belongs_to_required_by_default = true` in initializer.)
204
- #
205
- Mongoid::Config.belongs_to_required_by_default = false
206
- }
221
+ # Move mongoid.rb to jinda:config
222
+ # To avoid repeate install jinda:install crash
223
+ initializer "mongoid.rb" do
224
+ %q{# encoding: utf-8
225
+ #
226
+ # Mongoid 6 follows the new pattern of AR5 requiring a belongs_to relation to always require its parent
227
+ # belongs_to` will now trigger a validation error by default if the association is not present.
228
+ # You can turn this off on a per-association basis with `optional: true`.
229
+ # (Note this new default only applies to new Rails apps that will be generated with
230
+ # `config.active_record.belongs_to_required_by_default = true` in initializer.)
231
+ #
232
+ Mongoid::Config.belongs_to_required_by_default = false
233
+ }
207
234
  end
208
235
 
209
236
  inject_into_file 'config/environment.rb', :after => "initialize!" do
210
237
  "\n\n# hack to fix cloudinary error https://github.com/archiloque/rest-client/issues/141" +
211
- "\nclass Hash\n remove_method :read\nrescue\nend"
238
+ "\nclass Hash\n remove_method :read\nrescue\nend"
212
239
  end
213
240
  inject_into_file 'config/environments/development.rb', :after => 'config.action_mailer.raise_delivery_errors = false' do
214
241
  "\n config.action_mailer.default_url_options = { :host => 'localhost:3000' }"
@@ -218,16 +245,15 @@ Mongoid::Config.belongs_to_required_by_default = false
218
245
  "\n config.assets.compile = true"
219
246
  end
220
247
  inject_into_file 'config/initializers/assets.rb', :after => '# Precompile additional assets.
221
- ' do
222
- "Rails.application.config.assets.precompile += %w( sarabun.css )" +
223
- "\nRails.application.config.assets.precompile += %w( disable_enter_key.js )\n"
248
+ ' do
249
+ "Rails.application.config.assets.precompile += %w( sarabun.css )" +
250
+ "\nRails.application.config.assets.precompile += %w( disable_enter_key.js )\n"
224
251
  end
225
252
  end
226
253
 
227
254
  def finish
228
255
  say "\n"
229
256
  say "Jinda gem ready for next configuration install.\n"
230
- say " (or short cut with sh install.sh)\n"
231
257
  say "Normally you will use the following command:\n"
232
258
  say "----------------------------------------\n"
233
259
  say "bundle install\n"
@@ -0,0 +1,8 @@
1
+ @custom_gems = Array.new
2
+ @custom_gems =
3
+ [
4
+ ["mongoid-paperclip", require: "mongoid_paperclip"],
5
+ ["kaminari-mongoid", "1.0.1"],
6
+ ["nokogiri", "~> 1.11.0"]
7
+ # ["mongoid", git: "git@github.com:kul1/mongoid-jinda.git"]
8
+ ]
@@ -0,0 +1,20 @@
1
+ @dev_gems = Array.new
2
+ @dev_gems =
3
+ [
4
+ ["shoulda"],
5
+ ["rspec"],
6
+ ["rspec-rails"],
7
+ ["better_errors"],
8
+ ["binding_of_caller"],
9
+ ["pry-byebug"],
10
+ ["factory_bot_rails"],
11
+ ["database_cleaner"],
12
+ ["guard"],
13
+ ["guard-rspec"],
14
+ ["guard-minitest"],
15
+ ["capybara"],
16
+ ["selenium-webdriver"],
17
+ ["rb-fsevent"],
18
+ ["valid_attribute"],
19
+ ["faker"]
20
+ ]