cmor_core 0.0.51.pre → 0.0.56.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/app/view_helpers/cmor/core/application_view_helper.rb +40 -1
  3. data/app/views/cmor/core/application_view_helper/_render_flash.html.haml +1 -1
  4. metadata +5 -70
  5. data/spec/dummy/Rakefile +0 -6
  6. data/spec/dummy/app/assets/config/manifest.js +0 -3
  7. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  8. data/spec/dummy/app/assets/javascripts/cable.js +0 -13
  9. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  10. data/spec/dummy/app/channels/application_cable/channel.rb +0 -4
  11. data/spec/dummy/app/channels/application_cable/connection.rb +0 -4
  12. data/spec/dummy/app/controllers/application_controller.rb +0 -2
  13. data/spec/dummy/app/controllers/frontend_controller.rb +0 -2
  14. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  15. data/spec/dummy/app/jobs/application_job.rb +0 -2
  16. data/spec/dummy/app/mailers/application_mailer.rb +0 -4
  17. data/spec/dummy/app/models/application_record.rb +0 -3
  18. data/spec/dummy/app/views/layouts/application.html.erb +0 -15
  19. data/spec/dummy/app/views/layouts/mailer.html.erb +0 -13
  20. data/spec/dummy/app/views/layouts/mailer.text.erb +0 -1
  21. data/spec/dummy/bin/bundle +0 -3
  22. data/spec/dummy/bin/rails +0 -4
  23. data/spec/dummy/bin/rake +0 -4
  24. data/spec/dummy/bin/setup +0 -36
  25. data/spec/dummy/bin/update +0 -31
  26. data/spec/dummy/bin/yarn +0 -11
  27. data/spec/dummy/config.ru +0 -5
  28. data/spec/dummy/config/application.rb +0 -30
  29. data/spec/dummy/config/boot.rb +0 -5
  30. data/spec/dummy/config/cable.yml +0 -10
  31. data/spec/dummy/config/database.yml +0 -25
  32. data/spec/dummy/config/environment.rb +0 -5
  33. data/spec/dummy/config/environments/development.rb +0 -61
  34. data/spec/dummy/config/environments/production.rb +0 -94
  35. data/spec/dummy/config/environments/test.rb +0 -46
  36. data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -8
  37. data/spec/dummy/config/initializers/assets.rb +0 -14
  38. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  39. data/spec/dummy/config/initializers/cmor_core.rb +0 -19
  40. data/spec/dummy/config/initializers/content_security_policy.rb +0 -25
  41. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -5
  42. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  43. data/spec/dummy/config/initializers/i18n.rb +0 -2
  44. data/spec/dummy/config/initializers/inflections.rb +0 -16
  45. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  46. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  47. data/spec/dummy/config/locales/en.yml +0 -33
  48. data/spec/dummy/config/puma.rb +0 -34
  49. data/spec/dummy/config/routes.rb +0 -3
  50. data/spec/dummy/config/spring.rb +0 -6
  51. data/spec/dummy/config/storage.yml +0 -34
  52. data/spec/dummy/db/development.sqlite3 +0 -0
  53. data/spec/dummy/db/migrate/20200119053812_create_active_storage_tables.active_storage.rb +0 -27
  54. data/spec/dummy/db/test.sqlite3 +0 -0
  55. data/spec/dummy/log/development.log +0 -0
  56. data/spec/dummy/package.json +0 -5
  57. data/spec/dummy/public/404.html +0 -67
  58. data/spec/dummy/public/422.html +0 -67
  59. data/spec/dummy/public/500.html +0 -66
  60. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  61. data/spec/dummy/public/apple-touch-icon.png +0 -0
  62. data/spec/dummy/public/favicon.ico +0 -0
  63. data/spec/dummy/tmp/development_secret.txt +0 -1
  64. data/spec/rails_helper.rb +0 -62
  65. data/spec/spec_helper.rb +0 -96
  66. data/spec/support/capybara.rb +0 -1
  67. data/spec/support/factory_bot.rb +0 -5
  68. data/spec/support/rao-shoulda_matchers.rb +0 -5
  69. data/spec/support/shoulda_matchers.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 473b645b561784c1fc4fd187eb81f02c960020a2d9f712223123050e61b7ede7
4
- data.tar.gz: bfdebe65c99d2ec882c31be899dba82f70222d3c2abc1aac4f50b7d4298dd8dc
3
+ metadata.gz: f08b6be939cc6c342aae5ace607cf138937e8590dfec727a57c260eaa0da1766
4
+ data.tar.gz: 45d0ba4027abd624e4cfff9653d1137122ad6e2b559ebcfa8525d1accf6b2b87
5
5
  SHA512:
6
- metadata.gz: 5d075801903db9966a8eae47d3797d4e567e6084f1efccf65f51857c5b8293a54f5955a5697fdf465036b650947bf23f87b83d85f0e0a57dd644d26e0900fd38
7
- data.tar.gz: 9d2ff6104fb2758a219808b81e73460e2485f23907159363c7d12a69a83a0642aa2432fb22fa7d1f773e4d9866b4f0a3bb4e0e4f398820ccf3c2dfb7d892fd74
6
+ metadata.gz: 26e1b3e2fe4c28d8a5b534e607ae6ae9d7b053bc4fa62ef9b9a8e49250228ea25f52022c9de42f5b07a918c2e06147c750d530f034756b08e77190d87ef52d81
7
+ data.tar.gz: 19edb32d50f96d3cd8b4cffb1debdc853eebb0f744a97a5c01f4bd1d631adf8dddfb0d3bb4b6207a75e8bbf3720255cf4f83673f03c2cd3301149dcf8b5d7f7a
@@ -36,6 +36,45 @@ module Cmor
36
36
  end
37
37
 
38
38
  include FlashConcern
39
+
40
+ module PageTitleConcern
41
+ extend ActiveSupport::Concern
42
+
43
+ def application_title
44
+ t("#{Rails.application.class.to_s.deconstantize.underscore}.application.name")
45
+ end
46
+
47
+ def page_title
48
+ page_title = t(page_title_i18n_key, default: page_title_fallbacks)
49
+ [application_title, page_title].join(" - ")
50
+ end
51
+
52
+ private
53
+
54
+ def page_title_fallbacks
55
+ page_title_from_content || page_title_from_resource
56
+ end
57
+
58
+ def page_title_i18n_key
59
+ splitted_controller_name = c.params[:controller].split('/')
60
+ controller_namespace = splitted_controller_name[0..1].join('.')
61
+ controller_demodulized_name = splitted_controller_name.last
62
+
63
+ [controller_namespace, 'pages', controller_demodulized_name, c.controller.action_name].join('.')
64
+ end
65
+
66
+ def page_title_from_resource
67
+ if(resource = c.controller.instance_variable_get(:@resource)).respond_to?(:title)
68
+ resource.title
69
+ end
70
+ end
71
+
72
+ def page_title_from_content
73
+ c.content_for(:title)
74
+ end
75
+ end
76
+
77
+ include PageTitleConcern
39
78
  end
40
79
  end
41
- end
80
+ end
@@ -1,5 +1,5 @@
1
1
  - messages.each do |type, content|
2
2
  .alert.alert-dismissible.fade.show{ role: "alert", class: "alert-#{type}"}
3
- = content
3
+ = content.html_safe
4
4
  %button.close{"aria-label" => "Close", "data-dismiss" => "alert", :type => "button"}
5
5
  %span{"aria-hidden" => "true"} ×
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmor_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.51.pre
4
+ version: 0.0.56.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-23 00:00:00.000000000 Z
11
+ date: 2020-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.51.pre
33
+ version: 0.0.56.pre
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.51.pre
40
+ version: 0.0.56.pre
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: delayed_job_active_record
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -350,71 +350,6 @@ files:
350
350
  - lib/generators/cmor/core/install/templates/frontend_controller.rb
351
351
  - lib/generators/cmor/core/install/templates/initializer.rb
352
352
  - lib/tasks/cmor_core_tasks.rake
353
- - spec/dummy/Rakefile
354
- - spec/dummy/app/assets/config/manifest.js
355
- - spec/dummy/app/assets/javascripts/application.js
356
- - spec/dummy/app/assets/javascripts/cable.js
357
- - spec/dummy/app/assets/stylesheets/application.css
358
- - spec/dummy/app/channels/application_cable/channel.rb
359
- - spec/dummy/app/channels/application_cable/connection.rb
360
- - spec/dummy/app/controllers/application_controller.rb
361
- - spec/dummy/app/controllers/frontend_controller.rb
362
- - spec/dummy/app/helpers/application_helper.rb
363
- - spec/dummy/app/jobs/application_job.rb
364
- - spec/dummy/app/mailers/application_mailer.rb
365
- - spec/dummy/app/models/application_record.rb
366
- - spec/dummy/app/views/layouts/application.html.erb
367
- - spec/dummy/app/views/layouts/mailer.html.erb
368
- - spec/dummy/app/views/layouts/mailer.text.erb
369
- - spec/dummy/bin/bundle
370
- - spec/dummy/bin/rails
371
- - spec/dummy/bin/rake
372
- - spec/dummy/bin/setup
373
- - spec/dummy/bin/update
374
- - spec/dummy/bin/yarn
375
- - spec/dummy/config.ru
376
- - spec/dummy/config/application.rb
377
- - spec/dummy/config/boot.rb
378
- - spec/dummy/config/cable.yml
379
- - spec/dummy/config/database.yml
380
- - spec/dummy/config/environment.rb
381
- - spec/dummy/config/environments/development.rb
382
- - spec/dummy/config/environments/production.rb
383
- - spec/dummy/config/environments/test.rb
384
- - spec/dummy/config/initializers/application_controller_renderer.rb
385
- - spec/dummy/config/initializers/assets.rb
386
- - spec/dummy/config/initializers/backtrace_silencers.rb
387
- - spec/dummy/config/initializers/cmor_core.rb
388
- - spec/dummy/config/initializers/content_security_policy.rb
389
- - spec/dummy/config/initializers/cookies_serializer.rb
390
- - spec/dummy/config/initializers/filter_parameter_logging.rb
391
- - spec/dummy/config/initializers/i18n.rb
392
- - spec/dummy/config/initializers/inflections.rb
393
- - spec/dummy/config/initializers/mime_types.rb
394
- - spec/dummy/config/initializers/wrap_parameters.rb
395
- - spec/dummy/config/locales/en.yml
396
- - spec/dummy/config/puma.rb
397
- - spec/dummy/config/routes.rb
398
- - spec/dummy/config/spring.rb
399
- - spec/dummy/config/storage.yml
400
- - spec/dummy/db/development.sqlite3
401
- - spec/dummy/db/migrate/20200119053812_create_active_storage_tables.active_storage.rb
402
- - spec/dummy/db/test.sqlite3
403
- - spec/dummy/log/development.log
404
- - spec/dummy/package.json
405
- - spec/dummy/public/404.html
406
- - spec/dummy/public/422.html
407
- - spec/dummy/public/500.html
408
- - spec/dummy/public/apple-touch-icon-precomposed.png
409
- - spec/dummy/public/apple-touch-icon.png
410
- - spec/dummy/public/favicon.ico
411
- - spec/dummy/tmp/development_secret.txt
412
- - spec/rails_helper.rb
413
- - spec/spec_helper.rb
414
- - spec/support/capybara.rb
415
- - spec/support/factory_bot.rb
416
- - spec/support/rao-shoulda_matchers.rb
417
- - spec/support/shoulda_matchers.rb
418
353
  homepage: https://github.com/content-management-on-rails
419
354
  licenses:
420
355
  - MIT
@@ -434,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
434
369
  - !ruby/object:Gem::Version
435
370
  version: 1.3.1
436
371
  requirements: []
437
- rubygems_version: 3.1.2
372
+ rubygems_version: 3.1.4
438
373
  signing_key:
439
374
  specification_version: 4
440
375
  summary: Cmor Core Module.
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require_relative 'config/application'
5
-
6
- Rails.application.load_tasks
@@ -1,3 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
3
- //= link_directory ../stylesheets .css
@@ -1,15 +0,0 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
- //
10
- // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require rails-ujs
14
- //= require activestorage
15
- //= require_tree .
@@ -1,13 +0,0 @@
1
- // Action Cable provides the framework to deal with WebSockets in Rails.
2
- // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
- //
4
- //= require action_cable
5
- //= require_self
6
- //= require_tree ./channels
7
-
8
- (function() {
9
- this.App || (this.App = {});
10
-
11
- App.cable = ActionCable.createConsumer();
12
-
13
- }).call(this);
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Channel < ActionCable::Channel::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Connection < ActionCable::Connection::Base
3
- end
4
- end
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
@@ -1,2 +0,0 @@
1
- class FrontendController < ApplicationController
2
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- class ApplicationJob < ActiveJob::Base
2
- end
@@ -1,4 +0,0 @@
1
- class ApplicationMailer < ActionMailer::Base
2
- default from: 'from@example.com'
3
- layout 'mailer'
4
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= stylesheet_link_tag 'application', media: 'all' %>
9
- <%= javascript_include_tag 'application' %>
10
- </head>
11
-
12
- <body>
13
- <%= yield %>
14
- </body>
15
- </html>
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <style>
6
- /* Email styles need to be inline */
7
- </style>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>
@@ -1 +0,0 @@
1
- <%= yield %>
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
- load Gem.bin_path('bundler', 'bundle')
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../config/application', __dir__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'fileutils'
3
- include FileUtils
4
-
5
- # path to your application root.
6
- APP_ROOT = File.expand_path('..', __dir__)
7
-
8
- def system!(*args)
9
- system(*args) || abort("\n== Command #{args} failed ==")
10
- end
11
-
12
- chdir APP_ROOT do
13
- # This script is a starting point to setup your application.
14
- # Add necessary setup steps to this file.
15
-
16
- puts '== Installing dependencies =='
17
- system! 'gem install bundler --conservative'
18
- system('bundle check') || system!('bundle install')
19
-
20
- # Install JavaScript dependencies if using Yarn
21
- # system('bin/yarn')
22
-
23
- # puts "\n== Copying sample files =="
24
- # unless File.exist?('config/database.yml')
25
- # cp 'config/database.yml.sample', 'config/database.yml'
26
- # end
27
-
28
- puts "\n== Preparing database =="
29
- system! 'bin/rails db:setup'
30
-
31
- puts "\n== Removing old logs and tempfiles =="
32
- system! 'bin/rails log:clear tmp:clear'
33
-
34
- puts "\n== Restarting application server =="
35
- system! 'bin/rails restart'
36
- end
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'fileutils'
3
- include FileUtils
4
-
5
- # path to your application root.
6
- APP_ROOT = File.expand_path('..', __dir__)
7
-
8
- def system!(*args)
9
- system(*args) || abort("\n== Command #{args} failed ==")
10
- end
11
-
12
- chdir APP_ROOT do
13
- # This script is a way to update your development environment automatically.
14
- # Add necessary update steps to this file.
15
-
16
- puts '== Installing dependencies =='
17
- system! 'gem install bundler --conservative'
18
- system('bundle check') || system!('bundle install')
19
-
20
- # Install JavaScript dependencies if using Yarn
21
- # system('bin/yarn')
22
-
23
- puts "\n== Updating database =="
24
- system! 'bin/rails db:migrate'
25
-
26
- puts "\n== Removing old logs and tempfiles =="
27
- system! 'bin/rails log:clear tmp:clear'
28
-
29
- puts "\n== Restarting application server =="
30
- system! 'bin/rails restart'
31
- end
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path('..', __dir__)
3
- Dir.chdir(APP_ROOT) do
4
- begin
5
- exec "yarnpkg", *ARGV
6
- rescue Errno::ENOENT
7
- $stderr.puts "Yarn executable was not detected in the system."
8
- $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9
- exit 1
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require_relative 'config/environment'
4
-
5
- run Rails.application
@@ -1,30 +0,0 @@
1
- require_relative 'boot'
2
-
3
- require "rails"
4
- # Pick the frameworks you want:
5
- require "active_model/railtie"
6
- require "active_job/railtie"
7
- require "active_record/railtie"
8
- require "active_storage/engine"
9
- require "action_controller/railtie"
10
- require "action_mailer/railtie"
11
- require "action_view/railtie"
12
- require "action_cable/engine"
13
- require "sprockets/railtie"
14
- # require "rails/test_unit/railtie"
15
-
16
- Bundler.require(*Rails.groups)
17
- require "cmor_core"
18
-
19
- module Dummy
20
- class Application < Rails::Application
21
- # Initialize configuration defaults for originally generated Rails version.
22
- config.load_defaults 5.2
23
-
24
- # Settings in config/environments/* take precedence over those specified here.
25
- # Application configuration can go into files in config/initializers
26
- # -- all .rb files in that directory are automatically loaded after loading
27
- # the framework and any gems in your application.
28
- end
29
- end
30
-