jinda 0.7.3 → 0.7.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +61 -42
  3. data/app/assets/stylesheets/images/gears.png +0 -0
  4. data/lib/generators/jinda/config_generator.rb +0 -1
  5. data/lib/generators/jinda/install_generator.rb +161 -133
  6. data/lib/generators/jinda/installer/gemfiles-org/custom_gems.rb +8 -0
  7. data/lib/generators/jinda/installer/gemfiles-org/dev_gems.rb +20 -0
  8. data/lib/generators/jinda/installer/gemfiles-org/runtime_gems.rb +30 -0
  9. data/lib/generators/jinda/installer/gemfiles-org/todo.md +3 -0
  10. data/lib/generators/jinda/installer/gems_install.rb +132 -0
  11. data/lib/generators/jinda/installer/test.rb +6 -0
  12. data/lib/generators/jinda/templates/README.md +2 -2
  13. data/lib/generators/jinda/templates/app/controllers/jinda_org/articles_controller.rb +3 -1
  14. data/lib/generators/jinda/templates/app/controllers/jinda_org/users_controller.rb +1 -0
  15. data/lib/generators/jinda/templates/app/views/articles/_report.haml +8 -0
  16. data/lib/generators/jinda/templates/app/views/articles/show.html.haml +20 -9
  17. data/lib/generators/jinda/templates/app/views/docs/doc_new/doc_form.html.erb +21 -15
  18. data/lib/generators/jinda/templates/app/views/users/user/enter_user.html.erb +2 -0
  19. data/lib/generators/jinda/templates/config/initializers/fix_mongoid_generator.rb +14 -0
  20. data/lib/generators/jinda/templates/spec/controllers/sessions_controller_spec.rb +7 -5
  21. data/lib/generators/jinda/templates/spec/features/userlogins_spec.rb +2 -2
  22. data/lib/generators/jinda/templates/spec/rails_helper.rb +0 -2
  23. data/lib/generators/jinda/templates/spec/spec_helper.rb +6 -3
  24. data/lib/generators/jinda/templates/spec/support/databasecleaner.rb +13 -0
  25. data/lib/jinda/themes.rb +10 -3
  26. data/lib/jinda/version.rb +1 -1
  27. data/lib/tasks/jinda.rake +14 -5
  28. metadata +26 -3
@@ -6,8 +6,6 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } # Add this a
6
6
  abort("The Rails environment is running in production mode!") if Rails.env.production?
7
7
  require 'rspec/rails'
8
8
  require 'spec_helper'
9
- require 'support/factory_bot'
10
- Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
11
9
 
12
10
  RSpec.configure do |config|
13
11
 
@@ -8,6 +8,9 @@ require 'valid_attribute'
8
8
 
9
9
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
10
10
  RSpec.configure do |config|
11
+ config.filter_run focus: true
12
+ config.run_all_when_everything_filtered = true
13
+
11
14
  # config.include SpecTestHelper, :type => :controller
12
15
  config.expect_with :rspec do |expectations|
13
16
  expectations.include_chain_clauses_in_custom_matcher_descriptions = true
@@ -42,12 +45,12 @@ RSpec.configure do |config|
42
45
  uncommitted transaction data setup over the spec's database connection.
43
46
  MSG
44
47
  end
45
- DatabaseCleaner.clean_with(:truncation)
48
+ DatabaseCleaner.clean_with(:deletion)
46
49
  end
47
50
 
48
51
  config.before(:each, :js => true) do
49
52
  #DatabaseCleaner.strategy = :transaction
50
- DatabaseCleaner.strategy = :truncation
53
+ DatabaseCleaner.strategy = :deletion
51
54
  end
52
55
 
53
56
  config.before(:each, type: :feature) do
@@ -60,7 +63,7 @@ RSpec.configure do |config|
60
63
  # under test that does *not* share a database connection with the
61
64
  # specs, so use truncation strategy.
62
65
  # DatabaseCleaner.strategy = :truncation
63
- DatabaseCleaner[:mongoid].strategy = :truncation
66
+ DatabaseCleaner[:mongoid].strategy = :deletion
64
67
 
65
68
  end
66
69
  end
@@ -0,0 +1,13 @@
1
+ RSpec.configure do |config|
2
+ config.before(:suite) do
3
+ DatabaseCleaner[:mongoid].strategy = :deletion
4
+ end
5
+
6
+ config.before(:each) do
7
+ DatabaseCleaner[:mongoid].start
8
+ end
9
+
10
+ config.after(:each) do
11
+ DatabaseCleaner[:mongoid].clean
12
+ end
13
+ end
data/lib/jinda/themes.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # ##########################################################################
7
7
  def get_login_user_info
8
8
  if current_ma_user.present?
9
- $user_image = current_ma_user.image
9
+ $user_image = ((current_ma_user.image != "") ? current_ma_user.image : asset_url("user.png", :width => "48"))
10
10
  $user_name = current_ma_user.code
11
11
  $user_email = current_ma_user.email
12
12
  $user_id = current_ma_user.try(:id)
@@ -18,6 +18,13 @@ def get_login_user_info
18
18
  end
19
19
  return $user_image, $user_name, $user_email,$user_id
20
20
  end
21
+ # search image from User in Article/View/Show
22
+ def get_user_image(user_id)
23
+ user_image = User.find(user_id).image
24
+ user_image = ((user_image != "") ? user_image : asset_url("user.png", :width => "48"))
25
+ return user_image
26
+ end
27
+
21
28
 
22
29
  def name2code(s)
23
30
  # rather not ignore # symbol cause it could be comment
@@ -91,8 +98,8 @@ def markdown(text)
91
98
  flash[:notice] = "This ruby version not support #{error}"
92
99
  return
93
100
  end
94
- red = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
95
- red.render(erbified).html_safe
101
+ red = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
102
+ red.render(erbified).html_safe
96
103
  end
97
104
  def align_text(s, pixel=3)
98
105
  "<span style='position:relative; top:-#{pixel}px;'>#{s}</span>".html_safe
data/lib/jinda/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jinda
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.5.5"
3
3
  end
data/lib/tasks/jinda.rake CHANGED
@@ -16,11 +16,20 @@ namespace :jinda do
16
16
 
17
17
  desc "generate admin user"
18
18
  task :seed=> :environment do
19
- unless Identity.where(code:"admin").exists?
20
- identity= Identity.create :code => "admin", :email => "admin@test.com", :password => "secret",
21
- :password_confirmation => "secret", :image => "https://user-images.githubusercontent.com/3953832/42472827-50ed8cbc-8388-11e8-8982-fa523c25288f.png"
22
- User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,
23
- :email => identity.email, :role => "M,A,D", :auth_token => "71JxMH5fxi23zinBoq1uKA", :image => identity.image
19
+ usamples = [
20
+ { code: 'admin', password: 'secret', email: 'admin@test.com', role: 'M,A,D', image: 'https://user-images.githubusercontent.com/3953832/110025024-7911b480-7cf4-11eb-83ee-8dbe6e8fc96f.png'},
21
+ { code: 'tester', password: 'password', email: 'tester@test.com', role: 'M', image: 'https://www.manateeschools.net/cms/lib/FL02202357/Centricity/domain/2439/staff_photos/fflinststone.jpg'}
22
+ ]
23
+ usamples.each do |h|
24
+ code = h[:code].to_s
25
+ email = h[:email].to_s
26
+ password = h[:password].to_s
27
+ role = h[:role].to_s
28
+ image = h[:image]
29
+ unless Identity.where(code: code).exists?
30
+ identity= Identity.create :code => code, :email => email, :password => password , :password_confirmation => password
31
+ User.create :provider => "identity", :uid => identity.id.to_s, :code => identity.code,:email => identity.email, :role => role, :image => image
32
+ end
24
33
  end
25
34
  end
26
35
 
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.7.3
4
+ version: 0.7.5.5
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: 2021-01-28 00:00:00.000000000 Z
12
+ date: 2021-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -59,6 +59,20 @@ dependencies:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 7.1.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: rexml
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.2'
69
+ type: :runtime
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.2'
62
76
  description: 'Generate Rails workflow from mind map: Freemind'
63
77
  email:
64
78
  - 1.0@kul.asia
@@ -161,6 +175,7 @@ files:
161
175
  - app/assets/stylesheets/images/button_black.png
162
176
  - app/assets/stylesheets/images/button_blue.png
163
177
  - app/assets/stylesheets/images/button_red.png
178
+ - app/assets/stylesheets/images/gears.png
164
179
  - app/assets/stylesheets/images/icons-18-black.png
165
180
  - app/assets/stylesheets/images/icons-18-white.png
166
181
  - app/assets/stylesheets/images/icons-36-black.png
@@ -212,6 +227,12 @@ files:
212
227
  - lib/generators/jinda/USAGE
213
228
  - lib/generators/jinda/config_generator.rb
214
229
  - lib/generators/jinda/install_generator.rb
230
+ - lib/generators/jinda/installer/gemfiles-org/custom_gems.rb
231
+ - lib/generators/jinda/installer/gemfiles-org/dev_gems.rb
232
+ - lib/generators/jinda/installer/gemfiles-org/runtime_gems.rb
233
+ - lib/generators/jinda/installer/gemfiles-org/todo.md
234
+ - lib/generators/jinda/installer/gems_install.rb
235
+ - lib/generators/jinda/installer/test.rb
215
236
  - lib/generators/jinda/minitest_generator.rb
216
237
  - lib/generators/jinda/rspec_generator.rb
217
238
  - lib/generators/jinda/templates/Dockerfile
@@ -341,6 +362,7 @@ files:
341
362
  - lib/generators/jinda/templates/app/views/users/pwd/enter.html.erb
342
363
  - lib/generators/jinda/templates/app/views/users/user/enter_user.html.erb
343
364
  - lib/generators/jinda/templates/config/cloudinary.yml
365
+ - lib/generators/jinda/templates/config/initializers/fix_mongoid_generator.rb
344
366
  - lib/generators/jinda/templates/config/mongoid.yml-docker
345
367
  - lib/generators/jinda/templates/config/mongoid.yml-localhost
346
368
  - lib/generators/jinda/templates/db/seeds.rb
@@ -367,6 +389,7 @@ files:
367
389
  - lib/generators/jinda/templates/spec/rails_helper.rb
368
390
  - lib/generators/jinda/templates/spec/spec_helper.rb
369
391
  - lib/generators/jinda/templates/spec/support/authentication_helper.rb
392
+ - lib/generators/jinda/templates/spec/support/databasecleaner.rb
370
393
  - lib/generators/jinda/templates/spec/support/factory_bot.rb
371
394
  - lib/generators/jinda/templates/spec/support/omniauth_macros.rb
372
395
  - lib/generators/jinda/templates/spec/support/request_spec_helper.rb
@@ -466,7 +489,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
466
489
  - !ruby/object:Gem::Version
467
490
  version: '0'
468
491
  requirements: []
469
- rubygems_version: 3.1.2
492
+ rubygems_version: 3.2.3
470
493
  signing_key:
471
494
  specification_version: 4
472
495
  summary: 'Rails workflow from mind map: Freemind'