jinda 0.3.5 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/lib/generators/jinda/config_generator.rb +102 -96
  4. data/lib/generators/jinda/install_generator.rb +63 -44
  5. data/lib/generators/jinda/rspec_generator.rb +1 -1
  6. data/lib/generators/jinda/templates/README.md +173 -0
  7. data/lib/generators/jinda/templates/app/assets/javascripts/{application.js → application-org.js} +0 -0
  8. data/lib/generators/jinda/templates/app/assets/stylesheets/{application.css → application-org.css} +0 -0
  9. data/lib/generators/jinda/templates/app/assets/stylesheets/{application.css.scss → application-org.css.scss} +0 -0
  10. data/lib/generators/jinda/templates/app/controllers/{admins_controller.rb → jinda_org/admins_controller.rb} +0 -0
  11. data/lib/generators/jinda/templates/app/controllers/{application_controller.rb → jinda_org/application_controller.rb} +0 -0
  12. data/lib/generators/jinda/templates/app/controllers/{articles_controller.rb → jinda_org/articles_controller.rb} +0 -0
  13. data/lib/generators/jinda/templates/app/controllers/{comments_controller.rb → jinda_org/comments_controller.rb} +0 -0
  14. data/lib/generators/jinda/templates/app/controllers/{devs_controller.rb → jinda_org/devs_controller.rb} +0 -0
  15. data/lib/generators/jinda/templates/app/controllers/{identities_controller.rb → jinda_org/identities_controller.rb} +0 -0
  16. data/lib/generators/jinda/templates/app/controllers/{jinda_controller.rb → jinda_org/jinda_controller.rb} +0 -0
  17. data/lib/generators/jinda/templates/app/controllers/{password_resets.rb → jinda_org/password_resets.rb} +0 -0
  18. data/lib/generators/jinda/templates/app/controllers/{password_resets_controller.rb → jinda_org/password_resets_controller.rb} +0 -0
  19. data/lib/generators/jinda/templates/app/controllers/{sessions_controller.rb → jinda_org/sessions_controller.rb} +4 -0
  20. data/lib/generators/jinda/templates/app/controllers/{sitemap_controller.rb → jinda_org/sitemap_controller.rb} +0 -0
  21. data/lib/generators/jinda/templates/app/controllers/{users_controller.rb → jinda_org/users_controller.rb} +0 -0
  22. data/lib/generators/jinda/templates/app/jinda/template/view.html.erb +22 -18
  23. data/lib/generators/jinda/templates/app/models/jinda/doc.rb +18 -27
  24. data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +5 -5
  25. data/lib/generators/jinda/templates/{cloudinary.yml → config/cloudinary.yml} +0 -0
  26. data/lib/generators/jinda/templates/{seeds.rb → db/seeds.rb} +1 -1
  27. data/lib/generators/jinda/templates/{.env → dot/dot.env} +0 -0
  28. data/lib/jinda/ template/view.html.erb +27 -0
  29. data/lib/jinda/app/jinda/template/view.html.erb +27 -0
  30. data/lib/jinda/version.rb +1 -1
  31. metadata +25 -114
  32. data/lib/generators/jinda/templates/app/assets/config/manifest.js +0 -3
  33. data/lib/generators/jinda/templates/app/helpers/application_helper.rb.bak +0 -2
  34. data/lib/generators/jinda/templates/app/jobs/application_job.rb +0 -2
  35. data/lib/generators/jinda/templates/dot.rspec +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9a75e9044c742215b4a88279c71bf994b083791e8b2968307cd9fd1272cd630
4
- data.tar.gz: 45b023769cd651c2b20310f01298d9477705604ea2b0dfece5312f7abcff11c6
3
+ metadata.gz: c493bb3f9ec9c0d77fe441c37484ea0a345cb39eb0dc196bf52e1eee46414adf
4
+ data.tar.gz: 6cbaad855b865abda8351eea97336b322a0e9a9652b3a3ae8d1e8b51e6c6b89a
5
5
  SHA512:
6
- metadata.gz: 884f1007b8642e2e42d01b66811444279c4c9b01f1cb52e1baa9833f2677883a89c046172b459db665c3d86b97a9f57bc416b015e382f6d62ff2b6c640039f59
7
- data.tar.gz: e91ce213262754eaee44bcc6270113bf66429f4232c9380622eb0060eae31a976fa711a45999e2dd7bad665de7b9e3aa242f24a120637f88c301cefb2931d256
6
+ metadata.gz: 344e5084a67024897045c73004309f873a406dfee3e6a563779df47d432c1238abc8432f6eeae80ec3c9569cf36943be14f0bc4f00aefb72a49d6690835d6856
7
+ data.tar.gz: 260da9dd4da82cccba3bbcf58b8b78a75d536c29e45d912c4def129539e98c3825b1b86058c16dc4d3210d0da44ad239438fdfbc393f78b0c4492f324d18a88f
data/README.md CHANGED
@@ -15,8 +15,8 @@ Rails Application Generator using Freemind
15
15
 
16
16
  These versions works for sure but others may do.
17
17
 
18
- * Ruby 2.5.0
19
- * Rails 5.2.3
18
+ * Ruby 2.6.3
19
+ * Rails 6.0.0
20
20
  * MongoDB 6
21
21
  * Freemind 1.0.1
22
22
 
@@ -32,11 +32,11 @@ These versions works for sure but others may do.
32
32
  Supposed we want to create ecommerce web site, first create a Rails
33
33
  app without ActiveRecord
34
34
 
35
- $ rails new YOURAPP -BOT
35
+ $ rails new YOURAPP -BOTJ
36
36
 
37
37
  ## Add jinda to your Gemfile:
38
38
 
39
- gem 'jinda', '~> 0.3.5'
39
+ gem 'jinda', '~> 0.4.0'
40
40
 
41
41
  For Development (most updated)
42
42
 
@@ -1,103 +1,109 @@
1
1
  module Jinda
2
- module Generators
3
- class ConfigGenerator < Rails::Generators::Base
4
- def self.source_root
5
- File.dirname(__FILE__) + "/templates"
6
- end
7
- desc "Backup Files"
8
- def backup_files
9
- st=" "
10
- inside("config/initializers") {(File.file? "omniauth.rb") ? (run "mv omniauth.rb omniauth.rb.bak") : (puts "new omniauth.rb created")}
11
- inside("config/initializers") {(File.file? "mongoid.rb") ? (run "mv mongoid.rb omniauth.rb.bak") : (puts "new mongoid.rb created")}
12
- (File.file? ".env") ? (run "cp .env .env-bak") : (puts "backup .env")
13
- end
2
+ module Generators
3
+ class ConfigGenerator < Rails::Generators::Base
4
+ def self.source_root
5
+ File.dirname(__FILE__) + "/templates"
6
+ end
7
+ desc "Backup Files"
8
+ def backup_files
9
+ st=" "
10
+ # inside("config/initializers") {(File.file? "omniauth.rb") ? (FileUtils.mv "omniauth.rb", "omniauth.rb.bak") : (puts "new omniauth.rb created")}
11
+ # inside("config/initializers") {(File.file? "mongoid.rb") ? (FileUtils.mv "mongoid.rb", "omniauth.rb.bak") : (puts "new mongoid.rb created")}
12
+ (File.file? ".env") ? (FileUtils.mv ".env", ".env-bak") : (puts "backup .env")
13
+ end
14
14
 
15
- desc "gen_image_store"
16
- def gen_image_store
17
- copy_file "cloudinary.yml","config/cloudinary.yml"
18
- copy_file ".env",".env"
19
- copy_file "dot.rspec",".rspec"
20
- empty_directory "upload" # create upload directory just in case
21
- end
22
- desc "Set up omniauth config"
23
- def setup_omniauth
24
- # gem 'bcrypt-ruby', '~> 3.0.0'
25
- # gem 'omniauth-identity'
26
- initializer "omniauth.rb" do
27
- %q{
28
- Rails.application.config.middleware.use OmniAuth::Builder do
29
- provider :identity,
30
- :fields => [:code, :email],
31
- :on_failed_registration=> lambda { |env|
32
- IdentitiesController.action(:new).call(env)
33
- }
34
- provider :facebook, ENV['FACEBOOK_API'], ENV['FACEBOOK_KEY']
35
- provider :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET']
36
- end
37
- }
38
- end
39
- end
40
- # gem 'ckeditor', github: 'galetahub/ckeditor'
41
- # rails generate ckeditor:install --orm=mongoid --backend=paperclip
42
- desc "Set up setup_ckeditor config"
43
- def setup_ckeditor
44
- initializer "ckeditor.rb" do
45
- %q{# gem 'ckeditor', github: 'galetahub/ckeditor'
46
- Ckeditor.setup do |config|
47
- require 'ckeditor/orm/mongoid'
48
- end
49
- }
50
- end
51
- end
15
+ desc "gen_image_store"
16
+ def gen_image_store
17
+ # FileUtils.cp "cloudinary.yml","config/cloudinary.yml"
18
+ # FileUtils.cp "dot.env",".env"
19
+ # FileUtils.cp "dot.rspec",".rspec"
20
+ empty_directory "upload" # create upload directory just in case
21
+ end
22
+ desc "Set up omniauth config"
23
+ def setup_omniauth
24
+ # gem 'bcrypt-ruby', '~> 3.0.0'
25
+ # gem 'omniauth-identity'
26
+ initializer "omniauth.rb" do
27
+ %q{
28
+ Rails.application.config.middleware.use OmniAuth::Builder do
29
+ provider :identity,
30
+ :fields => [:code, :email],
31
+ :on_failed_registration=> lambda { |env|
32
+ IdentitiesController.action(:new).call(env)
33
+ }
34
+ provider :facebook, ENV['FACEBOOK_API'], ENV['FACEBOOK_KEY']
35
+ provider :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET']
36
+ end
52
37
 
53
- desc "Set up mongoid config"
54
- def setup_mongoid
55
- generate "mongoid:config"
56
- inject_into_file 'config/mongoid.yml', :after => ' # raise_not_found_error: true' do
57
- "\n raise_not_found_error: false"
58
- end
38
+ # https://stackoverflow.com/questions/11461084/handle-omniautherror-invalid-credentials-for-identity-login
39
+ OmniAuth.config.on_failure = Proc.new { |env|
40
+ OmniAuth::FailureEndpoint.new(env).redirect_to_failure
41
+ }
42
+
43
+ }
44
+ end
45
+ end
59
46
 
60
- inject_into_file 'config/mongoid.yml', :after => ' # belongs_to_required_by_default: true' do
61
- "\n belongs_to_required_by_default: false"
62
- end
63
- inject_into_file 'config/mongoid.yml', :after => ' # app_name: MyApplicationName' do
64
- "\n\nproduction:" +
65
- "\n clients:" +
66
- "\n default:" +
67
- "\n uri: <%= ENV['MONGODB_URI'] %>" +
68
- "\n options:" +
69
- "\n raise_not_found_error: false" +
70
- "\n belongs_to_required_by_default: false\n"
71
- end
72
- end
47
+ # gem 'ckeditor', github: 'galetahub/ckeditor'
48
+ # rails generate ckeditor:install --orm=mongoid --backend=paperclip
49
+ desc "Set up setup_ckeditor config"
50
+ def setup_ckeditor
51
+ initializer "ckeditor.rb" do
52
+ %q{# gem 'ckeditor', github: 'galetahub/ckeditor'
53
+ Ckeditor.setup do |config|
54
+ require 'ckeditor/orm/mongoid'
55
+ end
56
+ }
57
+ end
58
+ end
73
59
 
74
- def finish
75
- puts " configured omniauth.\n"
76
- puts " configured setup_ckeditor.\n"
77
- puts " configured Mongoid.\n"
78
- puts "\n"
79
- puts " To set user/password as admin/secret run:\n"
80
- puts "-----------------------------------------\n"
81
- puts "rails jinda:seed\n"
82
- puts "-----------------------------------------\n"
83
- puts " To test with rspec run:"
84
- puts "-----------------------------------------\n"
85
- puts "rspec\n"
86
- puts "-----------------------------------------\n"
87
- puts " To config rspec run:"
88
- puts "rails g jinda:rspec\n"
89
- puts "run $chromediver for Capybara & Chrome\n"
90
- puts "-----------------------------------------\n"
91
- puts " To config minitest run:"
92
- puts "-----------------------------------------\n"
93
- puts "rails g jinda:minitest\n"
94
- puts "-----------------------------------------\n"
95
- puts " To login with facebook"
96
- puts "-----------------------------------------\n"
97
- puts "Please config. in .env or restore from .env-bak \n"
98
- puts "-----------------------------------------\n"
99
- end
60
+ desc "Set up mongoid config"
61
+ def setup_mongoid
62
+ generate "mongoid:config"
63
+ inject_into_file 'config/mongoid.yml', :after => ' # raise_not_found_error: true' do
64
+ "\n raise_not_found_error: false"
65
+ end
66
+
67
+ inject_into_file 'config/mongoid.yml', :after => ' # belongs_to_required_by_default: true' do
68
+ "\n belongs_to_required_by_default: false"
69
+ end
70
+ inject_into_file 'config/mongoid.yml', :after => ' # app_name: MyApplicationName' do
71
+ "\n\nproduction:" +
72
+ "\n clients:" +
73
+ "\n default:" +
74
+ "\n uri: <%= ENV['MONGODB_URI'] %>" +
75
+ "\n options:" +
76
+ "\n raise_not_found_error: false" +
77
+ "\n belongs_to_required_by_default: false\n"
78
+ end
79
+ end
80
+
81
+ def finish
82
+ puts " configured omniauth.\n"
83
+ puts " configured setup_ckeditor.\n"
84
+ puts " configured Mongoid.\n"
85
+ puts "\n"
86
+ puts " To set user/password as admin/secret run:\n"
87
+ puts "-----------------------------------------\n"
88
+ puts "rails jinda:seed\n"
89
+ puts "-----------------------------------------\n"
90
+ puts " To test with rspec run:"
91
+ puts "-----------------------------------------\n"
92
+ puts "rspec\n"
93
+ puts "-----------------------------------------\n"
94
+ puts " To config rspec run:"
95
+ puts "rails g jinda:rspec\n"
96
+ puts "run $chromediver for Capybara & Chrome\n"
97
+ puts "-----------------------------------------\n"
98
+ puts " To config minitest run:"
99
+ puts "-----------------------------------------\n"
100
+ puts "rails g jinda:minitest\n"
101
+ puts "-----------------------------------------\n"
102
+ puts " To login with facebook"
103
+ puts "-----------------------------------------\n"
104
+ puts "Please config. in .env or restore from .env-bak \n"
105
+ puts "-----------------------------------------\n"
106
+ end
107
+ end
100
108
  end
101
- end
102
109
  end
103
-
@@ -12,13 +12,12 @@ module Jinda
12
12
  gem 'normalize-rails'
13
13
  gem 'font-awesome-sass', '~> 4.7.0'
14
14
  gem 'ckeditor', github: 'galetahub/ckeditor'
15
-
16
15
  gem 'mongoid-paperclip', require: 'mongoid_paperclip'
17
16
  gem 'meta-tags'
18
17
  gem 'jquery-turbolinks'
19
- gem 'mongo', '~> 2.2'
18
+ gem 'mongo', '~> 2.5.1'
20
19
  gem 'bson', '~> 4.0'
21
- gem 'mongoid', github: 'mongodb/mongoid'
20
+ gem 'mongoid', git: 'https://github.com/mongodb/mongoid.git', branch: 'master'
22
21
  gem 'nokogiri' # use for jinda/doc
23
22
  gem 'haml', git: 'https://github.com/haml/haml'
24
23
  gem 'haml-rails'
@@ -29,6 +28,7 @@ module Jinda
29
28
  gem 'omniauth-identity'
30
29
  gem 'omniauth-facebook'
31
30
  gem 'omniauth-google-oauth2'
31
+ gem 'omniauth-rails_csrf_protection'
32
32
  gem 'dotenv-rails'
33
33
  gem 'cloudinary'
34
34
  gem 'kaminari'
@@ -54,17 +54,38 @@ module Jinda
54
54
  end
55
55
 
56
56
  def setup_app
57
- # inside("public") { run "mv index.html index.html.bak" }
58
- inside("app/views/layouts") {(File.file? "application.html.erb") ? (run "mv application.html.erb application.html.erb.bak" ) : ( puts "no app/views/layout/ application.html.erb")}
59
- inside("app/controllers") {(File.file? "application_controller.rb") ? (run "mv application_controller.rb application_controller.rb.bak" ) : ( puts "no app/controller/application_controller.rb")}
60
- inside("app/helpers") {(File.file? "application_helper.rb") ? (run "mv application_helper.rb application_helper.rb.bak") : ( puts "no app/helpers/application_helper.rb")}
61
- inside("app/assets/javascripts") {(File.file? "javascripts.js") ? (run "mv javascripts.js javascripts.js.bak") : ( puts "no javascript.js")}
62
- inside("app/assets/stylesheets") {(File.file? "javascripts.css") ? (run "mv javascripts.css javascripts.css.bak") : ( puts "no javascript.css")}
63
- inside("config/initializers") {(File.file? "omniauth.rb") ? (run "mv omniauth.rb omniauth.rb.bak") : (puts "new omniauth.rb created")}
64
- inside("config/initializers") {(File.file? "mongoid.rb") ? (run "mv mongoid.rb omniauth.rb.bak") : (puts "new mongoid.rb created")}
65
- inside("config/initializers") {(File.file? "ckeditor.rb") ? (run "mv ckeditor.rb ckeditor.rb.bak") : (puts "new ckeditor.rb created")}
57
+ # inside("public") { run "FileUtils.mv index.html index.html.bak" }
58
+ inside("db") {(File.file? "seeds.rb") ? (FileUtils.mv "seeds.rb", "seeds.rb.bak") : ( say "no seeds.rb", :green)}
59
+ 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 )}
60
+ 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 ")}
61
+ 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)}
62
+ inside("app/assets/javascripts") {(File.file? "javascripts.js") ? (FileUtils.mv 'javascripts.js', 'javascripts.js.bak') : ( say "no javascript.js", :blue)}
63
+ inside("app/assets/stylesheets") {(File.file? "application.css") ? (FileUtils.mv 'application.css', 'application.css.bak') : ( say "no application.css", :blue)}
64
+ inside("config/initializers") {(File.file? "omniauth.rb") ? (FileUtils.mv 'omniauth.rb', 'omniauth.rb.bak') : (say "no omniauth.rb", :blue)}
65
+ # inside("config/initializers") {(File.file? "mongoid.rb") ? (FileUtils.mv 'mongoid.rb', 'mongoid.rb.bak') : (say "no mongoid.rb")}
66
+ # inside("config/initializers") {(File.file? "ckeditor.rb") ? (FileUtils.mv 'ckeditor.rb ckeditor.rb.bak') : (say "no ckeditor.rb ")}
66
67
  directory "app"
67
68
  directory "spec"
69
+ directory "db"
70
+ directory "config"
71
+ directory "dot"
72
+ #
73
+ # CHECK IF EXISTING CODE THEN REQUIRED MANUAL MIGRATION
74
+ # If no javascripts.js or css (New application), then can use javascript.js or css from org files.
75
+ 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')}
76
+ 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')}
77
+ 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')}
78
+ 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')}
79
+ 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')}
80
+ 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')}
81
+ 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')}
82
+ 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')}
83
+ 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')}
84
+ 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')}
85
+ 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')}
86
+ 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')}
87
+ 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')}
88
+ 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')}
68
89
  end
69
90
  # routes created each line as reversed order button up in routes
70
91
  def setup_routes
@@ -78,6 +99,7 @@ module Jinda
78
99
  route "get '/articles/my/destroy' => 'articles#destroy'"
79
100
  route "get '/articles/my' => 'articles/my'"
80
101
  route "get '/logout' => 'sessions#destroy', :as => 'logout'"
102
+ route "get '/auth/failure' => 'sessions#destroy'"
81
103
  route "get '/auth/:provider/callback' => 'sessions#create'"
82
104
  route "post '/auth/:provider/callback' => 'sessions#create'"
83
105
  route "\# end jinda method routes"
@@ -92,13 +114,14 @@ module Jinda
92
114
  end
93
115
 
94
116
  def setup_env
95
- run "mv README.md README.md.bak"
117
+ FileUtils.mv "README.md", "README.md.bak"
96
118
  create_file 'README.md', ''
97
- copy_file 'install.sh', 'install.sh'
98
- inject_into_file 'config/application.rb', :after => 'require "active_resource/railtie"' do
99
- "\nrequire 'mongoid/railtie'\n"
100
- "\nrequire 'rexml/document'\n"
101
- end
119
+ # FileUtils.mv 'install.sh', 'install.sh'
120
+ # inject_into_file 'config/application.rb', :after => 'require "active_resource/railtie"' do
121
+ # inject_into_file 'config/application.rb', :after => 'require "rails"' do
122
+ # "\nrequire 'rexml/document'\n"+
123
+ # "\nrequire 'mongoid/railtie'\n"
124
+ # end
102
125
  application do
103
126
  %q{
104
127
  # Jinda default
@@ -110,19 +133,19 @@ module Jinda
110
133
  end
111
134
 
112
135
  # config time zone
113
- config.time_zone = "Central Time (US & Canada)"
136
+ # config.time_zone = "Central Time (US & Canada)"
114
137
 
115
138
  # gmail config
116
- config.action_mailer.delivery_method = :smtp
117
- config.action_mailer.smtp_settings = {
118
- :address => "smtp.gmail.com",
119
- :port => 587,
120
- :user_name => 'user@gmail.com',
121
- :password => 'secret',
122
- :authentication => 'plain',
123
- :enable_starttls_auto => true }
124
- config.action_mailer.raise_delivery_errors = true
125
- config.action_mailer.perform_deliveries = true
139
+ # config.action_mailer.delivery_method = :smtp
140
+ # config.action_mailer.smtp_settings = {
141
+ # :address => "smtp.gmail.com",
142
+ # :port => 587,
143
+ # :user_name => 'user@gmail.com',
144
+ # :password => 'secret',
145
+ # :authentication => 'plain',
146
+ # :enable_starttls_auto => true }
147
+ # config.action_mailer.raise_delivery_errors = true
148
+ # config.action_mailer.perform_deliveries = true
126
149
  }
127
150
  end
128
151
  initializer "jinda.rb" do
@@ -133,7 +156,7 @@ DEFAULT_HEADER = 'Jinda'
133
156
  DEFAULT_DESCRIPTION = 'Rails Application Generator'
134
157
  DEFAULT_KEYWORDS = %w[Jinda Rails ruby Generator]
135
158
  GMAP = false
136
- ADSENSE = true
159
+ # ADSENSE = true
137
160
  NEXT = "Next >"
138
161
  # comment IMAGE_LOCATION to use cloudinary (specify params in config/cloudinary.yml)
139
162
  IMAGE_LOCATION = "upload"
@@ -171,22 +194,18 @@ Mongoid::Config.belongs_to_required_by_default = false
171
194
  "\nRails.application.config.assets.precompile += %w( disable_enter_key.js )\n"
172
195
  end
173
196
  end
174
- def gen_user
175
- # copy_file "seeds.rb","db/seeds.rb"
176
- end
177
-
178
197
 
179
198
  def finish
180
- puts "\n"
181
- puts "Jinda gem ready for next configuration install.\n"
182
- puts " (or short cut with sh install.sh)\n"
183
- puts "Normally you will use the following command:\n"
184
- puts "----------------------------------------\n"
185
- puts "bundle install\n"
186
- puts "rails generate jinda:config\n"
187
- puts "rake jinda:seed\n"
188
- puts
189
- puts "----------------------------------------\n"
199
+ say "\n"
200
+ say "Jinda gem ready for next configuration install.\n"
201
+ say " (or short cut with sh install.sh)\n"
202
+ say "Normally you will use the following command:\n"
203
+ say "----------------------------------------\n"
204
+ say "bundle install\n"
205
+ say "rails generate jinda:config\n"
206
+ say "rake jinda:seed\n"
207
+ say
208
+ say "----------------------------------------\n"
190
209
  end
191
210
  end
192
211
  end
@@ -11,7 +11,7 @@ module Jinda
11
11
  empty_directory "spec/support"
12
12
  empty_directory "spec/model"
13
13
  empty_directory "spec/routing"
14
- run "mv .rspec .rspec.bak"
14
+ copy_file ".rspec", ".rspec.bak"
15
15
  run "guard init"
16
16
  copy_file ".rspec",".rspec"
17
17
  end
@@ -0,0 +1,173 @@
1
+ # Jinda
2
+ Rails Application Generator using Freemind
3
+
4
+ * [jinda](https://github.com/kul1/jinda)
5
+ - ![jinda-screen](https://user-images.githubusercontent.com/3953832/41832753-0143339a-7813-11e8-9ef9-c1601443c604.png)
6
+
7
+ ## Additional Extension themes also available at
8
+ * [jinda_adminlte](https://github.com/kul1/jinda_adminlte)
9
+ - ![j18-screen](https://user-images.githubusercontent.com/3953832/34298172-faa7e962-e6e1-11e7-93e2-19dfd4ab42af.png)
10
+
11
+ * [jinda_adminbsb](https://github.com/kul1/jinda_adminbsb)
12
+ - ![jinda-bsb](https://user-images.githubusercontent.com/3953832/34320779-bb0980d2-e7c6-11e7-855c-fafc23487ba5.png)
13
+
14
+ ## Prerequisites
15
+
16
+ These versions works for sure but others may do.
17
+
18
+ * Ruby 2.5.5
19
+ * Rails 5.2.3
20
+ * MongoDB 6
21
+ * Freemind 1.0.1
22
+
23
+ ## Convention
24
+
25
+ * database is MongoDB
26
+ * images stored in upload directory, unset IMAGE_LOCATION in `initializer/jinda.rb` to use Cloudinary
27
+ * mail use Gmail SMTP, config in `config/application.rb`
28
+ * authentication use omniauth-identity
29
+
30
+ ## Sample Application
31
+
32
+ Supposed we want to create ecommerce web site, first create a Rails
33
+ app without ActiveRecord
34
+
35
+ $ rails new YOURAPP -BOTJ
36
+
37
+ ## Add jinda to your Gemfile:
38
+
39
+ gem 'jinda', '~> 0.3.9'
40
+
41
+ For Development (most updated)
42
+
43
+ gem 'jinda', github:'kul1/jinda'
44
+
45
+ depend on your operating system, you may need to uncomment
46
+
47
+ gem 'therubyracer', :platforms => :ruby
48
+
49
+ install gems
50
+
51
+ $ bundle
52
+
53
+ generate jinda application
54
+
55
+ $ rails generate jinda:install
56
+
57
+ Then run bundle again to install additional gems added by jinda
58
+
59
+ $ bundle
60
+
61
+ (or run all with "sh install.sh" )
62
+
63
+ configure mongoid, omniauth
64
+
65
+ $ rails generate jinda:config
66
+
67
+ Please make sure mongod is running then create admin user
68
+
69
+ $ rails jinda:seed
70
+
71
+ now the application is ready, start it as any Rails application
72
+
73
+ $ rails server
74
+
75
+ go to http://localhost:3000, click *Sign In* on the left menu, and enter user name `admin` and password `secret`
76
+
77
+ ![login](https://user-images.githubusercontent.com/3953832/41832924-d868f8f0-7813-11e8-93bb-19c0357cf604.png)
78
+
79
+ Now open file `app/jinda/index.mm` using Freemind
80
+
81
+ ![index mm](https://user-images.githubusercontent.com/3953832/34680350-7906fbe8-f45e-11e7-8df5-969b4c735c6e.png)
82
+
83
+ The 3 main branches are
84
+
85
+ * models - this defines all the models to use in the application
86
+ * services - this defines services which will be come the menu on the left of the screen. There will be 2 levels; the first sub branch is the main menu (modules) and the second sub branch is the sub menu (services)
87
+ * roles - this defines role for all users
88
+
89
+ ### models
90
+
91
+ Fiirst, we need to create some product so we click on models we'll see 2 models person and address. These are sample only. You can delete them or modify them however you want. We'll take a look at them first
92
+
93
+ ![models](https://user-images.githubusercontent.com/3953832/34681380-50b27dd6-f461-11e7-8472-3a14d76e0f16.png)
94
+
95
+ The first sub branch (e.g. person) is the model name. According to Rails convention, this should be a singular word. The next sub branch are columns in the database. Let's take a look at each:
96
+
97
+ * `fname` - this create a column (field) called fname which is a String by default
98
+ * `sex: integer` - this create a column called sex, it is integer so must be explicity defined. The next sub branch (1: male) is disregarded by Jinda so we can put whatever we want. Here I just put some reminder.
99
+ * `belongs_to :address` - here we have ![pen](https://cloud.githubusercontent.com/assets/3953832/25600038/3a4ffb66-2f0b-11e7-9f03-b875e550eefe.png)
100
+ icon. this means whatever text on this line will be added as is to the model Jinda generates. You use this to specify anything you want such as association, index, remarks in code, etc. according to mongoid gem. To draw the icon, rest mouse on the branch and hit &ltAlt-I&gt.
101
+ * `dob: date` - use any type that mongoid provides.
102
+ * `photo` - for file field, just use String here. Jinda will receive the binary file and store in file system or cloudinary then generate a url link to it.
103
+
104
+ In this example we just want a product model, so delete the person and address model and add a product branch like so
105
+
106
+ ![freemind1](https://user-images.githubusercontent.com/3953832/34680349-78f1eea6-f45e-11e7-8e43-50d9025bb449.png)
107
+
108
+ Save the mind map then run:
109
+
110
+ rake jinda:update
111
+
112
+ This will create file `app/models/product.rb`. In this file, note the comment lines `# jinda begin` and ` # jinda end`. Everything inside these comments will get overwritten when you change the models branch in the mind map so if you need to put anything inside here, use the mind map instead. You can add anything outside these comment lines which will be preserved when doing jinda:update.
113
+
114
+ ### services
115
+
116
+ Next we'll add some product into the database, we'll first take a look at the services branch, which already has 3 sub branches; users, admins, and devs. Unlike models person and address branches, these branches are actively used by the system so I recommend that you leave them alone. Let's open the users branch
117
+
118
+ ![image](https://cloud.githubusercontent.com/assets/3953832/25599895/ecf46466-2f09-11e7-82aa-81ade6b9cd83.png)
119
+
120
+ The text `users:User` on the sub branch has these implications:
121
+
122
+ * `users` correspond to `app/controllers/users_controller.rb` which already exist when you do rails generate jinda:install. New branch will create new controller if not exist. In Jinda term, this will be called module.
123
+ * `User` will create entry in main menu on the left of the screen. You don't see it in the screenshot above because it's controlled by the sub branch `role:m` which means this menu only available for login member. If you already signed in as admin, you should see it now.
124
+
125
+ The next sub branches has the following:
126
+
127
+ * `role: m` - means that this module (menu) is available only to user who has role m (if you open the role branch now will see that role m is member). All registered user has role m by default. User who is not log on would not be able to access this module.
128
+ * `link:info: /users` - means that this is a link, the format is link: *submenu label* : *url* where submenu label is the text to show in the submenu and url is the link to go to, in this case, it woud go to http://localhost:3000/users which will perform index action of UsersController.
129
+ * `user:edit` the branch that do not start with role:, rule:, nor link: will be a Jinda service. You will then specify the sequence of the execution as in this example there are 3 sub branches - enter_user, update_user, and rule:login? Let's take a look at them:
130
+
131
+ * `enter_user:edit` - the first step is to display a form to input user information, this is accompanied by icon ![image](https://cloud.githubusercontent.com/assets/3953832/25599946/47c32cf6-2f0a-11e7-80a8-2c02c6294c9a.png)
132
+ which means user interface screen. and will correspond to a view file `app/views/users/user/enter_user.html.erb` where `/users` comes from the module name (the sub branch of services), `/user` comes from the service name (the sub branch of users), and `enter_user.html.erb` comes from the first part of this branch. The `edit` after the colon is just a description of this step. This branch also has sub branch `rule:login? && own_xmain?` which specify rule for this step that the user must be login and can continue this task if he is the one who started it. *task* in here means each instance of service.
133
+ * `update_user` - this icon ![image](https://cloud.githubusercontent.com/assets/3953832/25599976/87b69ad2-2f0a-11e7-9aba-1bd4e9546d3e.png) means to execute method update_user within `users_controller.rb`
134
+
135
+ Armed with this knowledge, we are ready to add new product into our application like so:
136
+
137
+ ![add_enter](https://cloud.githubusercontent.com/assets/3953832/25600158/582d1fbe-2f0c-11e7-9bde-01a195a45b6c.png)
138
+
139
+
140
+ To generate controller and views we save this mind map and run
141
+
142
+ rake jinda:update
143
+
144
+ open file `app/views/products/add/enter.html.erb` you'll see some sample view already in there but commented. edit the file so it look like this
145
+
146
+
147
+ ![product_enter](https://cloud.githubusercontent.com/assets/3953832/25600363/e5cc8282-2f0d-11e7-81f7-273c9bdc1a63.png)
148
+
149
+
150
+ Note that we do not specify form_tag and submit_tag, these will be supplied by Jinda.
151
+
152
+ then open file `app/controllers/products_controller.rb` and add `create` method as follow. The method name has to be correspond to the ![bookmark](http://songrit.googlecode.com/files/bookmark.png) branch.
153
+
154
+ ![products_controller](http://songrit.googlecode.com/files/products_controller.png)
155
+
156
+ ## Testing
157
+
158
+ run following command:
159
+
160
+ rails generate jinda:rspec
161
+ guard init
162
+ guard
163
+
164
+ ![rspec](https://user-images.githubusercontent.com/3953832/34680352-7931d426-f45e-11e7-9f40-8b85b94c61bf.png)
165
+
166
+
167
+ ## Contributing
168
+
169
+ 1. Fork it
170
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
171
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
172
+ 4. Push to the branch (`git push origin my-new-feature`)
173
+ 5. Create new Pull Request
@@ -4,6 +4,10 @@ class SessionsController < ApplicationController
4
4
  @title= 'Sign In'
5
5
  end
6
6
 
7
+ def failure
8
+ redirect_to login_path, alert: "Authentication failed, please try again."
9
+ end
10
+
7
11
  # to refresh the page, must know BEFOREHAND that the action needs refresh
8
12
  # then use attribute 'data-ajax'=>'false'
9
13
  # see app/views/sessions/new.html.erb for sample
@@ -1,23 +1,27 @@
1
- <%#
2
- doc = Doc.new :issue_on=> Date.today, :process_at => Time.now
1
+ <%
2
+ doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
3
3
  %>
4
- <%#= fields_for doc do |f| %>
5
- <%#= f.label :rnum, "Reference number" %>
6
- <%#= f.text_field :rnum %>
4
+ <%= fields_for doc do |f| %>
5
+
6
+ <%= f.select :x, [["SELECTION 1", 1], ["SELECTION 2", 2], ["SELECTION 3", 3]] %>
7
+
8
+
9
+ <%= f.label :x, "Reference number" %>
10
+ <%= f.text_field :x %>
7
11
  <!--div>
8
- <%#= f.label :confidential, "Confidentiality" , :class=>"ui-input-text" %>
9
- <%#= f.select :confidential, [['normal',0],['secret',1],['top secret',2]],{},"data-native-menu"=>"false" %>
12
+ <%= f.label :w, "Confidential" , :class=>"ui-input-text" %>
13
+ <%= f.select :w, [['normal',0],['secret',1],['top secret',2]],{},"data-native-menu"=>"false" %>
10
14
  </div-->
11
- <%#= f.label :issue_on, "Dated" %>
12
- <%#= f.date_field :issue_on, "blackDays"=>[0,6] %>
13
- <%#= f.label :summary, "Summary" %>
14
- <%#= f.text_area :summary, :cols=>50, :rows=>6 %>
15
- <%#= f.label :dscan, "Attached document" %>
16
- <%#= f.file_field :dscan %>
17
- <%# end %>
18
- <%#= label_tag :hotel, "Ungroup field" %>
19
- <%#= text_field_tag :hotel %>
15
+ <%= f.label :issue_on, "Dated" %>
16
+ <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
17
+ <%= f.label :y, "Summary" %>
18
+ <%= f.text_area :summary, :cols=>50, :rows=>6 %>
19
+ <%= f.label :dscan, "Attached document" %>
20
+ <%= f.file_field :dscan %>
21
+ <% end %>
22
+ <%= label_tag :z, "Ungroup field" %>
23
+ <%= text_field_tag :z %>
20
24
  <!--div>
21
- <%#= label_tag :done1, "Logic field", :class=>"ui-input-text" %>
22
- <%#= select_tag :done1, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
25
+ <%= label_tag :yes, "Logic field", :class=>"ui-input-text" %>
26
+ <%= select_tag :yes, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
23
27
  </div-->
@@ -1,31 +1,22 @@
1
- # -*- encoding : utf-8 -*-
1
+ # encoding: utf-8
2
2
  class Jinda::Doc
3
3
  include Mongoid::Document
4
+ # jinda begin
4
5
  include Mongoid::Timestamps
5
- field :name, :type => String
6
- field :filename, :type => String
7
- field :content_type, :type => String
8
- field :data_text, :type => String
9
- field :url, :type => String
10
- field :basename, :type => String
11
- field :cloudinary, :type => Boolean
12
- belongs_to :xmain, :class_name => "Jinda::Xmain"
13
- belongs_to :runseq, :class_name => "Jinda::Runseq"
14
- belongs_to :user, :class_name => "Jinda::User"
15
- belongs_to :service, :class_name => "Jinda::Service"
16
- field :ip, :type => String
17
- field :ma_display, :type => Boolean
18
- field :ma_secured, :type => Boolean
19
-
20
- def self.search(q, page, per_page=PER_PAGE)
21
- paginate :per_page=>per_page, :page => page, :conditions =>
22
- ["content_type=? AND data_text LIKE ? AND (ma_secured=? OR ma_user_id=?)",
23
- "output", "%#{q}%", false, session[:user_id] ],
24
- :order=>'ma_xmain_id DESC', :select=>'DISTINCT ma_xmain_id'
25
- end
26
- def self.search_ma_secured(q, page, per_page=PER_PAGE)
27
- paginate :per_page=>per_page, :page => page, :conditions =>
28
- ["content_type=? AND data_text LIKE ?", "output", "%#{q}%" ],
29
- :order=>'ma_xmain_id DESC', :select=>'DISTINCT ma_xmain_id'
30
- end
6
+ field :a, :type => String
7
+ field :b, :type => String
8
+ field :c, :type => String
9
+ field :d, :type => String
10
+ field :x, :type => String
11
+ field :y, :type => String
12
+ field :z, :type => String
13
+ field :s, :type => String
14
+ field :t, :type => String
15
+ field :u, :type => String
16
+ field :w, :type => String
17
+ field :yes, :type => Boolean
18
+ field :dscan, :type => String
19
+ field :process_at, :type => Date
20
+ field :issue_on, :type => Date
21
+ # jinda end
31
22
  end
@@ -13,15 +13,15 @@
13
13
 
14
14
  %h2 Recently tested with:
15
15
  %ul
16
- %li Rubygems 2.5.0
17
- %li Rails 5.2.3
18
- %li rails new YOURAPP --skip-test-unit --skip-bundle --skip-active-record
19
- %li (rails new YOURAPP -BOT)
16
+ %li Rubygems 2.6.3
17
+ %li Rails 6.0.0
18
+ %li rails new YOURAPP --skip-test-unit --skip-bundle --skip-active-record --skip-javascript --skip-turbolinks
19
+ %li (rails new YOURAPP -BOTJ)
20
20
 
21
21
 
22
22
  %h2 Installation
23
23
  %ul
24
- %li add gem 'jinda', '0.3.5'
24
+ %li add gem 'jinda', '0.4.0'
25
25
  %li bundle
26
26
  %li rails generate jinda:install
27
27
  %li (run all with "sh install.sh" )
@@ -1,6 +1,6 @@
1
1
  unless Identity.where(code:"admin").exists?
2
2
  identity= Identity.create :code => "admin", :email => "admin@test.com", :password => "secret",
3
3
  :password_confirmation => "secret"
4
- User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,
4
+ Jinda::User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,
5
5
  :email => identity.email, :role => "M,A,D"
6
6
  end
@@ -0,0 +1,27 @@
1
+ <%
2
+ doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
3
+ %>
4
+ <%= fields_for doc do |f| %>
5
+
6
+ <%= f.select :x, [["SELECTION 1", 1], ["SELECTION 2", 2], ["SELECTION 3", 3]] %>
7
+
8
+
9
+ <%= f.label :x, "Reference number" %>
10
+ <%= f.text_field :x %>
11
+ <!--div>
12
+ <%= f.label :w, "Confidential" , :class=>"ui-input-text" %>
13
+ <%= f.select :w, [['normal',0],['secret',1],['top secret',2]],{},"data-native-menu"=>"false" %>
14
+ </div-->
15
+ <%= f.label :issue_on, "Dated" %>
16
+ <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
17
+ <%= f.label :y, "Summary" %>
18
+ <%= f.text_area :summary, :cols=>50, :rows=>6 %>
19
+ <%= f.label :dscan, "Attached document" %>
20
+ <%= f.file_field :dscan %>
21
+ <% end %>
22
+ <%= label_tag :z, "Ungroup field" %>
23
+ <%= text_field_tag :z %>
24
+ <!--div>
25
+ <%= label_tag :yes, "Logic field", :class=>"ui-input-text" %>
26
+ <%= select_tag :yes, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
27
+ </div-->
@@ -0,0 +1,27 @@
1
+ <%
2
+ doc = Jinda::Doc.new :issue_on=> Date.today, :process_at => Time.now
3
+ %>
4
+ <%= fields_for doc do |f| %>
5
+
6
+ <%= f.select :x, [["SELECTION 1", 1], ["SELECTION 2", 2], ["SELECTION 3", 3]] %>
7
+
8
+
9
+ <%= f.label :x, "Reference number" %>
10
+ <%= f.text_field :x %>
11
+ <!--div>
12
+ <%= f.label :w, "Confidential" , :class=>"ui-input-text" %>
13
+ <%= f.select :w, [['normal',0],['secret',1],['top secret',2]],{},"data-native-menu"=>"false" %>
14
+ </div-->
15
+ <%= f.label :issue_on, "Dated" %>
16
+ <%= f.date_field :issue_on, "blackDays"=>[0,6] %>
17
+ <%= f.label :y, "Summary" %>
18
+ <%= f.text_area :summary, :cols=>50, :rows=>6 %>
19
+ <%= f.label :dscan, "Attached document" %>
20
+ <%= f.file_field :dscan %>
21
+ <% end %>
22
+ <%= label_tag :z, "Ungroup field" %>
23
+ <%= text_field_tag :z %>
24
+ <!--div>
25
+ <%= label_tag :yes, "Logic field", :class=>"ui-input-text" %>
26
+ <%= select_tag :yes, options_for_select([['Yes', 'y'], ['No', 'n']],'y'), 'data-role'=>"slider" %>
27
+ </div-->
data/lib/jinda/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jinda
2
- VERSION = "0.3.5"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jinda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Prateep Kul
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-04-26 00:00:00.000000000 Z
12
+ date: 2019-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -39,74 +39,6 @@ dependencies:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '10.0'
42
- - !ruby/object:Gem::Dependency
43
- name: rspec
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '3.7'
49
- - - "~>"
50
- - !ruby/object:Gem::Version
51
- version: 3.7.0
52
- type: :development
53
- prerelease: false
54
- version_requirements: !ruby/object:Gem::Requirement
55
- requirements:
56
- - - "~>"
57
- - !ruby/object:Gem::Version
58
- version: '3.7'
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 3.7.0
62
- - !ruby/object:Gem::Dependency
63
- name: guard
64
- requirement: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- type: :development
70
- prerelease: false
71
- version_requirements: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- - !ruby/object:Gem::Dependency
77
- name: guard-rspec
78
- requirement: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '4.7'
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- version: 4.7.3
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- requirements:
90
- - - "~>"
91
- - !ruby/object:Gem::Version
92
- version: '4.7'
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: 4.7.3
96
- - !ruby/object:Gem::Dependency
97
- name: pry-byebug
98
- requirement: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '3.4'
103
- type: :development
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '3.4'
110
42
  - !ruby/object:Gem::Dependency
111
43
  name: activesupport
112
44
  requirement: !ruby/object:Gem::Requirement
@@ -147,26 +79,6 @@ dependencies:
147
79
  - - "~>"
148
80
  - !ruby/object:Gem::Version
149
81
  version: 4.1.11
150
- - !ruby/object:Gem::Dependency
151
- name: dotenv-rails
152
- requirement: !ruby/object:Gem::Requirement
153
- requirements:
154
- - - "~>"
155
- - !ruby/object:Gem::Version
156
- version: '2.1'
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: 2.1.1
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '2.1'
167
- - - ">="
168
- - !ruby/object:Gem::Version
169
- version: 2.1.1
170
82
  description: 'Generate Rails workflow from mind map: Freemind'
171
83
  email:
172
84
  - 1.0@kul.asia
@@ -184,8 +96,7 @@ files:
184
96
  - lib/generators/jinda/install_generator.rb
185
97
  - lib/generators/jinda/minitest_generator.rb
186
98
  - lib/generators/jinda/rspec_generator.rb
187
- - lib/generators/jinda/templates/.env
188
- - lib/generators/jinda/templates/app/assets/config/manifest.js
99
+ - lib/generators/jinda/templates/README.md
189
100
  - lib/generators/jinda/templates/app/assets/images/4dcity-old.ico
190
101
  - lib/generators/jinda/templates/app/assets/images/4dcity.ico
191
102
  - lib/generators/jinda/templates/app/assets/images/account.png
@@ -242,7 +153,7 @@ files:
242
153
  - lib/generators/jinda/templates/app/assets/images/user.png
243
154
  - lib/generators/jinda/templates/app/assets/images/user_admin_gear.png
244
155
  - lib/generators/jinda/templates/app/assets/images/view_code.png
245
- - lib/generators/jinda/templates/app/assets/javascripts/application.js
156
+ - lib/generators/jinda/templates/app/assets/javascripts/application-org.js
246
157
  - lib/generators/jinda/templates/app/assets/javascripts/application.js-jqm
247
158
  - lib/generators/jinda/templates/app/assets/javascripts/cable.js
248
159
  - lib/generators/jinda/templates/app/assets/javascripts/disable_enter_key.js
@@ -253,8 +164,8 @@ files:
253
164
  - lib/generators/jinda/templates/app/assets/javascripts/jquery.mobile.datebox.js
254
165
  - lib/generators/jinda/templates/app/assets/javascripts/jquery.mobile.splitview.js
255
166
  - lib/generators/jinda/templates/app/assets/stylesheets/app.scss
256
- - lib/generators/jinda/templates/app/assets/stylesheets/application.css
257
- - lib/generators/jinda/templates/app/assets/stylesheets/application.css.scss
167
+ - lib/generators/jinda/templates/app/assets/stylesheets/application-org.css
168
+ - lib/generators/jinda/templates/app/assets/stylesheets/application-org.css.scss
258
169
  - lib/generators/jinda/templates/app/assets/stylesheets/articles.scss
259
170
  - lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.eot
260
171
  - lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.ttf
@@ -295,22 +206,21 @@ files:
295
206
  - lib/generators/jinda/templates/app/assets/stylesheets/social.scss
296
207
  - lib/generators/jinda/templates/app/channels/application_cable/channel.rb
297
208
  - lib/generators/jinda/templates/app/channels/application_cable/connection.rb
298
- - lib/generators/jinda/templates/app/controllers/admins_controller.rb
299
- - lib/generators/jinda/templates/app/controllers/application_controller.rb
300
- - lib/generators/jinda/templates/app/controllers/articles_controller.rb
301
- - lib/generators/jinda/templates/app/controllers/comments_controller.rb
302
209
  - lib/generators/jinda/templates/app/controllers/ctrs_controller.rb-gem-test
303
- - lib/generators/jinda/templates/app/controllers/devs_controller.rb
304
- - lib/generators/jinda/templates/app/controllers/identities_controller.rb
305
- - lib/generators/jinda/templates/app/controllers/jinda_controller.rb
306
- - lib/generators/jinda/templates/app/controllers/password_resets.rb
307
- - lib/generators/jinda/templates/app/controllers/password_resets_controller.rb
308
- - lib/generators/jinda/templates/app/controllers/sessions_controller.rb
309
- - lib/generators/jinda/templates/app/controllers/sitemap_controller.rb
310
- - lib/generators/jinda/templates/app/controllers/users_controller.rb
210
+ - lib/generators/jinda/templates/app/controllers/jinda_org/admins_controller.rb
211
+ - lib/generators/jinda/templates/app/controllers/jinda_org/application_controller.rb
212
+ - lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb
213
+ - lib/generators/jinda/templates/app/controllers/jinda_org/comments_controller.rb
214
+ - lib/generators/jinda/templates/app/controllers/jinda_org/devs_controller.rb
215
+ - lib/generators/jinda/templates/app/controllers/jinda_org/identities_controller.rb
216
+ - lib/generators/jinda/templates/app/controllers/jinda_org/jinda_controller.rb
217
+ - lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
218
+ - lib/generators/jinda/templates/app/controllers/jinda_org/password_resets_controller.rb
219
+ - lib/generators/jinda/templates/app/controllers/jinda_org/sessions_controller.rb
220
+ - lib/generators/jinda/templates/app/controllers/jinda_org/sitemap_controller.rb
221
+ - lib/generators/jinda/templates/app/controllers/jinda_org/users_controller.rb
311
222
  - lib/generators/jinda/templates/app/helpers/admins_helper.rb
312
223
  - lib/generators/jinda/templates/app/helpers/application_helper.rb
313
- - lib/generators/jinda/templates/app/helpers/application_helper.rb.bak
314
224
  - lib/generators/jinda/templates/app/helpers/articles_helper.rb
315
225
  - lib/generators/jinda/templates/app/helpers/basic_helper.rb
316
226
  - lib/generators/jinda/templates/app/helpers/comments_helper.rb
@@ -322,7 +232,6 @@ files:
322
232
  - lib/generators/jinda/templates/app/jinda/index.mm
323
233
  - lib/generators/jinda/templates/app/jinda/template/linkview.haml
324
234
  - lib/generators/jinda/templates/app/jinda/template/view.html.erb
325
- - lib/generators/jinda/templates/app/jobs/application_job.rb
326
235
  - lib/generators/jinda/templates/app/mailers/application_mailer.rb
327
236
  - lib/generators/jinda/templates/app/mailers/jinda_mailer.rb
328
237
  - lib/generators/jinda/templates/app/mailers/user_mailer.rb
@@ -416,8 +325,9 @@ files:
416
325
  - lib/generators/jinda/templates/app/views/users/index.haml
417
326
  - lib/generators/jinda/templates/app/views/users/pwd/enter.html.erb
418
327
  - lib/generators/jinda/templates/app/views/users/user/enter_user.html.erb
419
- - lib/generators/jinda/templates/cloudinary.yml
420
- - lib/generators/jinda/templates/dot.rspec
328
+ - lib/generators/jinda/templates/config/cloudinary.yml
329
+ - lib/generators/jinda/templates/db/seeds.rb
330
+ - lib/generators/jinda/templates/dot/dot.env
421
331
  - lib/generators/jinda/templates/install.sh
422
332
  - lib/generators/jinda/templates/jinda.yml
423
333
  - lib/generators/jinda/templates/public/404.html
@@ -426,7 +336,6 @@ files:
426
336
  - lib/generators/jinda/templates/public/assets/images/logo.png
427
337
  - lib/generators/jinda/templates/public/favicon.ico
428
338
  - lib/generators/jinda/templates/public/robots.txt
429
- - lib/generators/jinda/templates/seeds.rb
430
339
  - lib/generators/jinda/templates/spec/controllers/sessions_controller_spec.rb
431
340
  - lib/generators/jinda/templates/spec/features/userlogins_spec.rb
432
341
  - lib/generators/jinda/templates/spec/models/user_spec.rb
@@ -439,6 +348,8 @@ files:
439
348
  - lib/generators/jinda/templates/test/integration/jinda_routes_test.rb
440
349
  - lib/generators/jinda/templates/test/test_helper.rb
441
350
  - lib/jinda.rb
351
+ - lib/jinda/ template/view.html.erb
352
+ - lib/jinda/app/jinda/template/view.html.erb
442
353
  - lib/jinda/gemhelpers.rb
443
354
  - lib/jinda/helpers.rb
444
355
  - lib/jinda/railtie.rb
@@ -456,14 +367,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
456
367
  requirements:
457
368
  - - ">="
458
369
  - !ruby/object:Gem::Version
459
- version: '0'
370
+ version: 2.5.0
460
371
  required_rubygems_version: !ruby/object:Gem::Requirement
461
372
  requirements:
462
373
  - - ">="
463
374
  - !ruby/object:Gem::Version
464
375
  version: '0'
465
376
  requirements: []
466
- rubygems_version: 3.0.3
377
+ rubygems_version: 3.0.6
467
378
  signing_key:
468
379
  specification_version: 4
469
380
  summary: 'Rails workflow from mind map: Freemind'
@@ -1,3 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
3
- //= link_directory ../stylesheets .css
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- class ApplicationJob < ActiveJob::Base
2
- end
@@ -1,3 +0,0 @@
1
- --require rails_helper
2
- --color
3
- --format doc