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 +4 -4
- data/README.md +2 -4
- data/app/assets/stylesheets/images/gears.png +0 -0
- data/app/controllers/concerns/jinda_run_concern.rb +6 -3
- data/app/views/jinda/index.html.haml +1 -1
- data/lib/generators/jinda/config_generator.rb +0 -1
- data/lib/generators/jinda/install_generator.rb +159 -133
- data/lib/generators/jinda/installer/gemfiles-org/custom_gems.rb +8 -0
- data/lib/generators/jinda/installer/gemfiles-org/dev_gems.rb +20 -0
- data/lib/generators/jinda/installer/gemfiles-org/runtime_gems.rb +30 -0
- data/lib/generators/jinda/installer/gemfiles-org/todo.md +3 -0
- data/lib/generators/jinda/installer/gems_install.rb +132 -0
- data/lib/generators/jinda/installer/test.rb +6 -0
- data/lib/generators/jinda/templates/README.md +2 -2
- data/lib/generators/jinda/templates/app/controllers/comments_controller.rb +31 -0
- data/lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb +3 -1
- data/lib/generators/jinda/templates/app/controllers/jinda_org/users_controller.rb +1 -0
- data/lib/generators/jinda/templates/app/models/comment.rb +2 -1
- data/lib/generators/jinda/templates/app/views/articles/_report.haml +8 -5
- data/lib/generators/jinda/templates/app/views/articles/show.html.haml +52 -36
- data/lib/generators/jinda/templates/app/views/users/user/enter_user.html.erb +2 -0
- data/lib/jinda/themes.rb +166 -154
- data/lib/jinda/version.rb +1 -1
- data/lib/tasks/jinda.rake +14 -5
- metadata +10 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2dab3c1ee5e525bfce90630e720c8e45cd79da38196853f29df66db25d50526
|
4
|
+
data.tar.gz: af80a165a501ceffb2e150dbf3b1ecdb2647d14ebef721ef3392364deb1bfdaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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'
|
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
|
Binary file
|
@@ -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
|
-
|
22
|
-
|
23
|
-
|
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"
|
@@ -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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|
-
|
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
|
-
|
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", :
|
83
|
-
inside("app/controllers") {(File.file? "articles_controller.rb") ? ( say "Please merge existing jinda_org/articles_controller.rb after this installation", :
|
84
|
-
inside("app/controllers") {(File.file? "comments_controller.rb") ? ( say "Please merge existing jinda_org/comments_controller.rb after this installation", :
|
85
|
-
inside("app/controllers") {(File.file? "docs_controller.rb") ? ( say "Please merge existing jinda_org/docs_controller.rb after this installation", :
|
86
|
-
inside("app/controllers") {(File.file? "identities_controller.rb") ? ( say "Please merge existing jinda_org/identities_controller.rb after this installation", :
|
87
|
-
inside("app/controllers") {(File.file? "application_controller.rb") ? ( say "Pleas merge existing jinda_org/application_controller.rb after this installation", :
|
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", :
|
91
|
-
inside("app/controllers") {(File.file? "password_resets.rb") ? ( say "Please merge existing jinda_org/password_resets.rb after this installation", :
|
92
|
-
inside("app/controllers") {(File.file? "sessions_controller.rb") ? ( say "Please merge existing jinda_org/sessions_controller.rb after this installation", :
|
93
|
-
inside("app/controllers") {(File.file? "users_controller.rb") ? ( say "Please merge existing jinda_org/users_controller.rb after this installation", :
|
94
|
-
inside("app/controllers") {(File.file? "sitemap_controller.rb") ? ( say "Please merge existing jinda_org/sitemap_controller.rb after this installation", :
|
95
|
-
inside("app/controllers") {(File.file? "notes_controller.rb") ? ( say "Please merge existing jinda_org/notes_controller.rb after this installation", :
|
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
|
-
|
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
|
-
|
197
|
-
|
198
|
-
#
|
199
|
-
#
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
|
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
|
-
|
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,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
|
+
]
|