jinda 0.0.1 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/generators/jinda/config_generator.rb +78 -0
- data/lib/generators/jinda/install_generator.rb +53 -81
- data/lib/generators/jinda/templates/app/assets/stylesheets/{application.scss → application.css.scss} +3 -1
- data/lib/generators/jinda/templates/app/assets/stylesheets/jqm/application.scss-jqm +3 -1
- data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +9 -9
- data/lib/jinda/version.rb +1 -1
- metadata +5 -5
- data/lib/generators/jinda/mongoid_generator.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b966bdcdacb91a2d62adf3a27fe678a1c55ff688b20970f533f940c9d9637a01
|
4
|
+
data.tar.gz: d5bde70e8010587ce9900b3e614859dc969420ed4d9c53eaa13ec2828402fd58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e59517ee6dd14a17445f004ffeedeac9a353f586b608a4d5d6d967acf7ebeee58088e6bae04443114fef6c150701826dab90e24106394de67d046ce630afd5
|
7
|
+
data.tar.gz: 78e8b795de859b85d3a41187f42d948bcb84dbf97425371d3c1e3be2d82e38701ee88d8f16beb4d4b26ef164b6f00d564c78deff8307b202385aa08ddab881f8
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module Jinda
|
2
|
+
module Generators
|
3
|
+
class ConfigGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
desc "Backup Files"
|
6
|
+
def backup_files
|
7
|
+
st=" "
|
8
|
+
inside("config/initializes") {(File.file? "omniauth.rb") ? (mv omniauth.rb omniauth.rb.bak) : (puts "new omniauth.rb created")}
|
9
|
+
inside("config/initializes") {(File.file? "mongoid.rb") ? (mv mongoid.rb omniauth.rb.bak) : (puts "new mongoid.rb created")}
|
10
|
+
inside("config/initializes") {(File.file? "ckeditor.rb") ? (mv ckeditor.rb ckeditor.rb.bak) : (puts "new ckeditor.rb created")}
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Set up omniauth config"
|
14
|
+
def setup_omniauth
|
15
|
+
# gem 'bcrypt-ruby', '~> 3.0.0'
|
16
|
+
# gem 'omniauth-identity'
|
17
|
+
initializer "omniauth.rb" do
|
18
|
+
%q{
|
19
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
20
|
+
provider :identity,
|
21
|
+
:fields => [:code, :email],
|
22
|
+
:on_failed_registration=> lambda { |env|
|
23
|
+
IdentitiesController.action(:new).call(env)
|
24
|
+
}
|
25
|
+
provider :facebook, ENV['FACEBOOK_API'], ENV['FACEBOOK_KEY']
|
26
|
+
end
|
27
|
+
}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
# gem 'ckeditor', github: 'galetahub/ckeditor'
|
31
|
+
# rails generate ckeditor:install --orm=mongoid --backend=paperclip
|
32
|
+
desc "Set up setup_ckeditor config"
|
33
|
+
def setup_ckeditor
|
34
|
+
initializer "ckeditor.rb" do
|
35
|
+
%q{# gem 'ckeditor', github: 'galetahub/ckeditor'
|
36
|
+
Ckeditor.setup do |config|
|
37
|
+
require 'ckeditor/orm/mongoid'
|
38
|
+
end
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Set up mongoid config"
|
44
|
+
def setup_mongoid
|
45
|
+
generate "mongoid:config"
|
46
|
+
inject_into_file 'config/mongoid.yml', :after => ' # raise_not_found_error: true' do
|
47
|
+
"\n raise_not_found_error: false"
|
48
|
+
end
|
49
|
+
|
50
|
+
inject_into_file 'config/mongoid.yml', :after => ' # belongs_to_required_by_default: true' do
|
51
|
+
"\n belongs_to_required_by_default: false"
|
52
|
+
end
|
53
|
+
inject_into_file 'config/mongoid.yml', :after => ' # app_name: MyApplicationName' do
|
54
|
+
"\n\nproduction:" +
|
55
|
+
"\n clients:" +
|
56
|
+
"\n default:" +
|
57
|
+
"\n uri: <%= ENV['MONGODB_URI'] %>" +
|
58
|
+
"\n options:" +
|
59
|
+
"\n raise_not_found_error: false" +
|
60
|
+
"\n belongs_to_required_by_default: false\n"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def finish
|
65
|
+
puts " configured omniauth.\n"
|
66
|
+
puts " configured setup_ckeditor.\n"
|
67
|
+
puts " configured Mongoid.\n"
|
68
|
+
puts "\n"
|
69
|
+
puts "Next: To set up user/password as admin/secret\n"
|
70
|
+
puts "Please run the following command:\n"
|
71
|
+
puts "----------------------------------------\n"
|
72
|
+
puts "rake jinda:seed\n"
|
73
|
+
puts "----------------------------------------\n"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
@@ -5,6 +5,56 @@ module Jinda
|
|
5
5
|
def self.source_root
|
6
6
|
File.dirname(__FILE__) + "/templates"
|
7
7
|
end
|
8
|
+
|
9
|
+
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', '~> 4.7.0'
|
15
|
+
gem 'ckeditor', github: 'galetahub/ckeditor'
|
16
|
+
gem 'mongoid-paperclip', require: 'mongoid_paperclip'
|
17
|
+
gem 'meta-tags'
|
18
|
+
gem 'jquery-turbolinks'
|
19
|
+
|
20
|
+
gem 'mongo', '~> 2.2'
|
21
|
+
gem 'bson', '~> 4.0'
|
22
|
+
gem 'mongoid', github: 'mongodb/mongoid'
|
23
|
+
# gem "mongoid"
|
24
|
+
gem 'nokogiri' # use for jinda/doc
|
25
|
+
gem 'haml', git: 'https://github.com/haml/haml'
|
26
|
+
gem 'haml-rails'
|
27
|
+
gem 'mail'
|
28
|
+
gem 'prawn'
|
29
|
+
gem 'redcarpet'
|
30
|
+
gem 'bcrypt-ruby'
|
31
|
+
gem 'omniauth-identity'
|
32
|
+
gem 'omniauth-facebook'
|
33
|
+
gem 'dotenv-rails'
|
34
|
+
gem 'cloudinary'
|
35
|
+
gem 'kaminari'
|
36
|
+
gem 'kaminari-mongoid'
|
37
|
+
gem 'jquery-rails'
|
38
|
+
gem_group :development, :test do
|
39
|
+
gem "rspec"
|
40
|
+
gem "rspec-rails"
|
41
|
+
gem "better_errors"
|
42
|
+
gem "binding_of_caller"
|
43
|
+
gem 'pry-byebug'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def setup_app
|
48
|
+
inside("public") { run "mv index.html index.html.bak" }
|
49
|
+
inside("app/views/layouts") { run "mv application.html.erb application.html.erb.bak" }
|
50
|
+
inside("app/assets/javascripts") { run "mv application.js application.js.bak" }
|
51
|
+
inside("app/assets/stylesheets") { run "mv application.css application.css.bak" }
|
52
|
+
inside("config/initializes") {(File.file? "omniauth.rb") ? (mv omniauth.rb omniauth.rb.bak) : (puts "new omniauth.rb created")}
|
53
|
+
inside("config/initializes") {(File.file? "mongoid.rb") ? (mv mongoid.rb omniauth.rb.bak) : (puts "new mongoid.rb created")}
|
54
|
+
inside("config/initializes") {(File.file? "ckeditor.rb") ? (mv ckeditor.rb ckeditor.rb.bak) : (puts "new ckeditor.rb created")}
|
55
|
+
directory "app"
|
56
|
+
end
|
57
|
+
|
8
58
|
def setup_routes
|
9
59
|
route "root :to => 'jinda#index'"
|
10
60
|
route "mount Ckeditor::Engine => '/ckeditor'"
|
@@ -93,100 +143,22 @@ Mongoid::Config.belongs_to_required_by_default = false
|
|
93
143
|
"\nRails.application.config.assets.precompile += %w( disable_enter_key.js )\n"
|
94
144
|
end
|
95
145
|
end
|
96
|
-
|
97
|
-
def setup_omniauth
|
98
|
-
# gem 'bcrypt-ruby', '~> 3.0.0'
|
99
|
-
# gem 'omniauth-identity'
|
100
|
-
initializer "omniauth.rb" do
|
101
|
-
%q{
|
102
|
-
Rails.application.config.middleware.use OmniAuth::Builder do
|
103
|
-
provider :identity,
|
104
|
-
:fields => [:code, :email],
|
105
|
-
:on_failed_registration=> lambda { |env|
|
106
|
-
IdentitiesController.action(:new).call(env)
|
107
|
-
}
|
108
|
-
provider :facebook, ENV['FACEBOOK_API'], ENV['FACEBOOK_KEY']
|
109
|
-
end
|
110
|
-
}
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
def setup_app
|
115
|
-
inside("public") { run "mv index.html index.html.bak" }
|
116
|
-
inside("app/views/layouts") { run "mv application.html.erb application.html.erb.bak" }
|
117
|
-
inside("app/assets/javascripts") { run "mv application.js application.js.bak" }
|
118
|
-
inside("app/assets/stylesheets") { run "mv application.css application.css.bak" }
|
119
|
-
directory "app"
|
120
|
-
end
|
121
|
-
|
122
146
|
def gen_user
|
123
147
|
# copy_file "seeds.rb","db/seeds.rb"
|
124
148
|
end
|
125
|
-
|
126
149
|
def gen_image_store
|
127
150
|
copy_file "cloudinary.yml","config/cloudinary.yml"
|
128
151
|
copy_file ".env",".env"
|
129
|
-
|
130
152
|
empty_directory "upload" # create upload directory just in case
|
131
153
|
end
|
132
|
-
|
133
|
-
def setup_gems
|
134
|
-
gem 'maruku', '~> 0.7.3'
|
135
|
-
gem 'rouge'
|
136
|
-
gem 'normalize-rails'
|
137
|
-
gem 'font-awesome-rails'
|
138
|
-
gem 'ckeditor', github: 'galetahub/ckeditor'
|
139
|
-
gem 'mongoid-paperclip', require: 'mongoid_paperclip'
|
140
|
-
gem 'meta-tags'
|
141
|
-
gem 'jquery-turbolinks'
|
142
|
-
|
143
|
-
gem 'mongo', '~> 2.2'
|
144
|
-
gem 'bson', '~> 4.0'
|
145
|
-
gem 'mongoid', github: 'mongodb/mongoid'
|
146
|
-
# gem "mongoid"
|
147
|
-
gem 'nokogiri' # use for jinda/doc
|
148
|
-
gem 'haml', git: 'https://github.com/haml/haml'
|
149
|
-
gem 'haml-rails'
|
150
|
-
gem 'mail'
|
151
|
-
gem 'prawn'
|
152
|
-
gem 'redcarpet'
|
153
|
-
gem 'bcrypt-ruby'
|
154
|
-
gem 'omniauth-identity'
|
155
|
-
gem 'omniauth-facebook'
|
156
|
-
gem 'dotenv-rails'
|
157
|
-
gem 'cloudinary'
|
158
|
-
gem 'kaminari'
|
159
|
-
gem 'kaminari-mongoid'
|
160
|
-
gem 'jquery-rails'
|
161
|
-
gem_group :development, :test do
|
162
|
-
gem "rspec"
|
163
|
-
gem "rspec-rails"
|
164
|
-
gem "better_errors"
|
165
|
-
gem "binding_of_caller"
|
166
|
-
gem 'pry-byebug'
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
# gem 'ckeditor', github: 'galetahub/ckeditor'
|
171
|
-
# rails generate ckeditor:install --orm=mongoid --backend=paperclip
|
172
|
-
def setup_ckeditor
|
173
|
-
initializer "ckeditor.rb" do
|
174
|
-
%q{# gem 'ckeditor', github: 'galetahub/ckeditor'
|
175
|
-
Ckeditor.setup do |config|
|
176
|
-
require 'ckeditor/orm/mongoid'
|
177
|
-
end
|
178
|
-
}
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
154
|
def finish
|
183
|
-
puts "Jinda installation
|
155
|
+
puts "Jinda gem ready for next configuration installation. please run the following command:\n"
|
184
156
|
puts "----------------------------------------\n"
|
185
157
|
puts "bundle install\n"
|
186
|
-
puts "
|
158
|
+
puts "rake generate jinda:config\n"
|
159
|
+
puts "rake jinda:seed\n"
|
187
160
|
puts "----------------------------------------\n"
|
188
161
|
end
|
189
|
-
|
190
162
|
end
|
191
163
|
end
|
192
164
|
end
|
data/lib/generators/jinda/templates/app/assets/stylesheets/{application.scss → application.css.scss}
RENAMED
@@ -11,7 +11,6 @@
|
|
11
11
|
* require_tree .
|
12
12
|
* require_self
|
13
13
|
*= require normalize-rails
|
14
|
-
*= require font-awesome
|
15
14
|
*/
|
16
15
|
|
17
16
|
@import "jqm/jquery.mobile-1.2.1";
|
@@ -23,6 +22,9 @@
|
|
23
22
|
@import "jqm/kul-4.2";
|
24
23
|
@import "jqm/articles";
|
25
24
|
@import "jqm/rouge";
|
25
|
+
@import "font-awesome-sprockets";
|
26
|
+
@import "font-awesome";
|
27
|
+
|
26
28
|
|
27
29
|
|
28
30
|
|
@@ -11,7 +11,6 @@
|
|
11
11
|
* require_tree .
|
12
12
|
* require_self
|
13
13
|
*= require normalize-rails
|
14
|
-
*= require font-awesome
|
15
14
|
*/
|
16
15
|
|
17
16
|
@import "jqm/jquery.mobile-1.2.1";
|
@@ -23,6 +22,9 @@
|
|
23
22
|
@import "jqm/kul-4.2";
|
24
23
|
@import "jqm/articles";
|
25
24
|
@import "jqm/rouge";
|
25
|
+
@import "font-awesome-sprockets";
|
26
|
+
@import "font-awesome";
|
27
|
+
|
26
28
|
|
27
29
|
|
28
30
|
|
@@ -19,21 +19,21 @@
|
|
19
19
|
|
20
20
|
%h2 Installation
|
21
21
|
%ul
|
22
|
-
%li gem 'jinda', '~> 0.0.
|
22
|
+
%li gem 'jinda', '~> 0.0.8'
|
23
23
|
%li bundle
|
24
24
|
%li rails generate jinda:install
|
25
25
|
%li bundle
|
26
|
-
%li rails generate jinda:
|
26
|
+
%li rails generate jinda:config
|
27
27
|
%li rake db:seed, will create initial user:password admin:secret
|
28
28
|
%li when update app/jinda/index.mm, run rake jinda:update
|
29
29
|
|
30
|
-
%h2 Option: Themes available:
|
30
|
+
%h2 Option: Themes available: Jinda_adminbsb, Jinda_adminlte
|
31
31
|
%ul
|
32
|
-
%li gem '
|
33
|
-
%li
|
34
|
-
%li gem '
|
35
|
-
%li
|
36
|
-
%li bundle
|
37
|
-
%li rails generate
|
32
|
+
%li To install gem 'jinda_adminlte'
|
33
|
+
%li Install
|
34
|
+
%li gem 'jinda_adminlte'
|
35
|
+
%li Then
|
36
|
+
%li $ bundle
|
37
|
+
%li $ rails generate jinda_adminlte:install
|
38
38
|
|
39
39
|
|
data/lib/jinda/version.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.7
|
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: 2017-12-
|
12
|
+
date: 2017-12-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -66,8 +66,8 @@ files:
|
|
66
66
|
- bin/console
|
67
67
|
- bin/setup
|
68
68
|
- lib/generators/jinda/USAGE
|
69
|
+
- lib/generators/jinda/config_generator.rb
|
69
70
|
- lib/generators/jinda/install_generator.rb
|
70
|
-
- lib/generators/jinda/mongoid_generator.rb
|
71
71
|
- lib/generators/jinda/templates/app/assets/config/manifest.js
|
72
72
|
- lib/generators/jinda/templates/app/assets/images/4dcity-old.ico
|
73
73
|
- lib/generators/jinda/templates/app/assets/images/4dcity.ico
|
@@ -134,7 +134,7 @@ files:
|
|
134
134
|
- lib/generators/jinda/templates/app/assets/javascripts/jqm/jquery.mobile-1.2.1.js
|
135
135
|
- lib/generators/jinda/templates/app/assets/javascripts/jqm/jquery.mobile.datebox.js
|
136
136
|
- lib/generators/jinda/templates/app/assets/javascripts/jqm/jquery.mobile.splitview.js
|
137
|
-
- lib/generators/jinda/templates/app/assets/stylesheets/application.scss
|
137
|
+
- lib/generators/jinda/templates/app/assets/stylesheets/application.css.scss
|
138
138
|
- lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.eot
|
139
139
|
- lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.ttf
|
140
140
|
- lib/generators/jinda/templates/app/assets/stylesheets/fonts/sarabun.woff
|
@@ -338,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
338
338
|
version: '0'
|
339
339
|
requirements: []
|
340
340
|
rubyforge_project:
|
341
|
-
rubygems_version: 2.
|
341
|
+
rubygems_version: 2.7.3
|
342
342
|
signing_key:
|
343
343
|
specification_version: 4
|
344
344
|
summary: 'Rails workflow from mind map: Freemind'
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Jinda
|
2
|
-
module Generators
|
3
|
-
class MongoidGenerator < Rails::Generators::Base
|
4
|
-
desc "Set up mongoid config"
|
5
|
-
def setup_mongoid
|
6
|
-
generate "mongoid:config"
|
7
|
-
inject_into_file 'config/mongoid.yml', :after => ' # raise_not_found_error: true' do
|
8
|
-
"\n raise_not_found_error: false"
|
9
|
-
end
|
10
|
-
|
11
|
-
inject_into_file 'config/mongoid.yml', :after => ' # belongs_to_required_by_default: true' do
|
12
|
-
"\n belongs_to_required_by_default: false"
|
13
|
-
end
|
14
|
-
inject_into_file 'config/mongoid.yml', :after => ' # app_name: MyApplicationName' do
|
15
|
-
"\n\nproduction:" +
|
16
|
-
"\n clients:" +
|
17
|
-
"\n default:" +
|
18
|
-
"\n uri: <%= ENV['MONGODB_URI'] %>" +
|
19
|
-
"\n options:" +
|
20
|
-
"\n raise_not_found_error: false" +
|
21
|
-
"\n belongs_to_required_by_default: false\n"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
def finish
|
25
|
-
puts "Mongoid finished configured for rails 5 and heroku.\n"
|
26
|
-
puts "Next: To set up user/password as admin/secret\n"
|
27
|
-
puts "Please run the following command:\n"
|
28
|
-
puts "----------------------------------------\n"
|
29
|
-
puts "rake jinda:seed\n"
|
30
|
-
puts "----------------------------------------\n"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|