europeana-feedback-button 0.0.5 → 0.0.6

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.
Files changed (85) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +5 -0
  3. data/.rubocop.yml +2 -8
  4. data/.travis.yml +1 -2
  5. data/Gemfile +11 -6
  6. data/README.md +17 -7
  7. data/Rakefile +1 -0
  8. data/app/controllers/europeana/feedback_button/application_controller.rb +28 -0
  9. data/app/controllers/europeana/feedback_button/feedback_controller.rb +20 -12
  10. data/app/mailers/europeana/feedback_button/feedback_mailer.rb +9 -6
  11. data/app/models/europeana/feedback_button/feedback.rb +21 -0
  12. data/app/validators/europeana/feedback_button/word_count_validator.rb +26 -0
  13. data/app/views/concerns/europeana/feedback_button/feedbackable_view.rb +5 -5
  14. data/app/views/europeana/feedback_button/feedback_mailer/post.text.erb +2 -0
  15. data/bin/rails +19 -5
  16. data/config/routes.rb +1 -0
  17. data/europeana-feedback-button.gemspec +7 -10
  18. data/lib/europeana/feedback_button.rb +32 -1
  19. data/lib/europeana/feedback_button/engine.rb +2 -1
  20. data/lib/europeana/feedback_button/version.rb +2 -1
  21. data/lib/generators/europeana/feedback_button/install_generator.rb +15 -0
  22. data/lib/generators/europeana/feedback_button/templates/europeana_feedback_button.rb +8 -0
  23. data/spec/controllers/feedback_controller_spec.rb +82 -19
  24. data/spec/dummy/Rakefile +2 -1
  25. data/spec/dummy/app/assets/config/manifest.js +3 -0
  26. data/spec/dummy/app/assets/javascripts/application.js +2 -1
  27. data/spec/dummy/app/assets/stylesheets/application.css +3 -3
  28. data/spec/dummy/app/controllers/application_controller.rb +1 -3
  29. data/spec/dummy/app/controllers/welcome_controller.rb +3 -5
  30. data/spec/dummy/app/helpers/application_helper.rb +1 -0
  31. data/spec/dummy/app/jobs/application_job.rb +4 -0
  32. data/spec/dummy/app/mailers/application_mailer.rb +2 -1
  33. data/spec/dummy/app/views/layouts/application.html.erb +9 -9
  34. data/spec/dummy/app/views/layouts/mailer.html.erb +10 -6
  35. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  36. data/spec/dummy/bin/bundle +2 -1
  37. data/spec/dummy/bin/rails +2 -1
  38. data/spec/dummy/bin/rake +1 -0
  39. data/spec/dummy/bin/setup +16 -16
  40. data/spec/dummy/bin/update +30 -0
  41. data/spec/dummy/bin/yarn +11 -0
  42. data/spec/dummy/config.ru +3 -1
  43. data/spec/dummy/config/application.rb +12 -18
  44. data/spec/dummy/config/boot.rb +3 -2
  45. data/spec/dummy/config/environment.rb +2 -1
  46. data/spec/dummy/config/environments/development.rb +24 -20
  47. data/spec/dummy/config/environments/production.rb +22 -26
  48. data/spec/dummy/config/environments/test.rb +10 -6
  49. data/spec/dummy/config/initializers/application_controller_renderer.rb +9 -0
  50. data/spec/dummy/config/initializers/content_security_policy.rb +26 -0
  51. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  52. data/spec/dummy/config/initializers/europeana_feedback_button.rb +5 -0
  53. data/spec/dummy/config/initializers/filter_parameter_logging.rb +1 -0
  54. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -6
  55. data/spec/dummy/config/locales/en.yml +10 -0
  56. data/spec/dummy/config/puma.rb +36 -0
  57. data/spec/dummy/config/routes.rb +2 -57
  58. data/spec/dummy/config/spring.rb +8 -0
  59. data/spec/dummy/package.json +5 -0
  60. data/spec/dummy/public/404.html +6 -6
  61. data/spec/dummy/public/422.html +6 -6
  62. data/spec/dummy/public/500.html +6 -6
  63. data/{app/assets/images/europeana_feedback_button/.keep → spec/dummy/public/apple-touch-icon-precomposed.png} +0 -0
  64. data/{app/models/.keep → spec/dummy/public/apple-touch-icon.png} +0 -0
  65. data/spec/lib/europeana/feedback_button_spec.rb +21 -0
  66. data/spec/mailers/feedback_mailer_spec.rb +54 -0
  67. data/spec/models/feedback_spec.rb +25 -0
  68. data/spec/spec_helper.rb +11 -1
  69. metadata +52 -53
  70. data/QUICKSTART.md +0 -30
  71. data/app/assets/javascripts/europeana_feedback_button/application.js +0 -13
  72. data/app/assets/stylesheets/europeana_feedback_button/application.css +0 -15
  73. data/app/helpers/europeana/feedback_button/application_helper.rb +0 -7
  74. data/app/helpers/europeana/feedback_button/feedback_helper.rb +0 -12
  75. data/app/views/layouts/europeana/feedback_button/application.html.erb +0 -14
  76. data/config/initializers/action_mailer.rb +0 -2
  77. data/lib/tasks/europeana_feedback_button_tasks.rake +0 -5
  78. data/spec/dummy/README.rdoc +0 -28
  79. data/spec/dummy/app/mailers/.keep +0 -0
  80. data/spec/dummy/app/models/.keep +0 -0
  81. data/spec/dummy/config/database.yml +0 -25
  82. data/spec/dummy/config/initializers/assets.rb +0 -12
  83. data/spec/dummy/config/initializers/session_store.rb +0 -4
  84. data/spec/dummy/config/secrets.yml +0 -22
  85. data/spec/helpers/feedback_helper_spec.rb +0 -0
@@ -1,30 +0,0 @@
1
- # Quickstart
2
-
3
- ## Include gem
4
-
5
- * ``gem 'europeana-feedback-button'``
6
- * run ``bundle install``
7
-
8
- ## Require Europeana::FeedbackButton
9
-
10
- * add ```require 'europeana/feedback_button'`` to your apps config/application.rb
11
-
12
- ## Mount the engine
13
-
14
- * in config/routes.rb add: ```mount Europeana::FeedbackButton::Engine, at: "/"``
15
-
16
- ## Add FeedbackableView to your views
17
-
18
- * add ```include Europeana::FeedbackButton::FeedbackableView``` to any view you want to have a feedback button. Add it to app/views/application_view.rb for feedback buttons on all pages.
19
-
20
- ## Set FEEDBACK_MAIL_TO
21
-
22
- * the engine only shows feedback buttons if you have a mail address configured in your .env file.
23
- * ```FEEDBACK_MAIL_TO=example@example.org```
24
-
25
-
26
- ## optional
27
-
28
- * Include ``helper Europeana::FeedbackButton::FeedbackHelper`` in your application_controller.rb
29
- * this will allow you to acces the helper methods from the engine without haveing to explicitly reference them with ```Europeana::FeedbackButton```
30
-
@@ -1,13 +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.
9
- //
10
- // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
@@ -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 styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
- module Europeana
3
- module FeedbackButton
4
- module ApplicationHelper
5
- end
6
- end
7
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module Europeana
3
- module FeedbackButton
4
- ##
5
- # Methods used by feedback controller and views
6
- module FeedbackHelper
7
- def feedback_enabled?
8
- Rails.application.config.x.feedback_mail_to.present?
9
- end
10
- end
11
- end
12
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>EuropeanaFeedbackButton</title>
5
- <%= stylesheet_link_tag "europeana/feedback_button/application", media: "all" %>
6
- <%= javascript_include_tag "europeana/feedback_button/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,2 +0,0 @@
1
- # frozen_string_literal: true
2
- Rails.application.config.x.feedback_mail_to = ENV['FEEDBACK_MAIL_TO']
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
- # desc "runs rspec tests"
3
- # task :europeana-feedback-button do
4
- # # Task goes here
5
- # end
@@ -1,28 +0,0 @@
1
- == README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
File without changes
File without changes
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- #
7
- default: &default
8
- adapter: sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- development:
13
- <<: *default
14
- database: db/development.sqlite3
15
-
16
- # Warning: The database defined as "test" will be erased and
17
- # re-generated from your development database when you run "rake".
18
- # Do not set this db to the same as development or production.
19
- test:
20
- <<: *default
21
- database: db/test.sqlite3
22
-
23
- production:
24
- <<: *default
25
- database: db/production.sqlite3
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- # Be sure to restart your server when you modify this file.
3
-
4
- # Version of your assets, change this if you want to expire all your assets.
5
- Rails.application.config.assets.version = '1.0'
6
-
7
- # Add additional assets to the asset load path
8
- # Rails.application.config.assets.paths << Emoji.images_path
9
-
10
- # Precompile additional assets.
11
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
12
- # Rails.application.config.assets.precompile += %w( search.js )
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- # Be sure to restart your server when you modify this file.
3
-
4
- Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,22 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rake secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: 22073e06776951b01674a099a4041ccbe95620cf84248236e008d8c5c878029d00e60948c95feed4fa3bb7e4cc5d3ed815da2ce8a2bb08d1548d247ef8cc68cc
15
-
16
- test:
17
- secret_key_base: dfca0f6ea2789da0a99b6cb8080e47119b350d1ba45c51e4470867e6f51473a79df2ddf3d44fd0a9e033ba30f95f90a17624a8929573bfa3e582e39d8d9ec115
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
File without changes