awesome_translations 0.0.61 → 0.0.63

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/awesome_translations/caches_controller.rb +1 -1
  3. data/app/controllers/awesome_translations/handlers_controller.rb +3 -7
  4. data/app/helpers/awesome_translations/views_helper.rb +2 -2
  5. data/config/locales/en.yml +3 -0
  6. data/lib/awesome_translations/cache_database_generator.rb +11 -9
  7. data/lib/awesome_translations/config.rb +2 -2
  8. data/lib/awesome_translations/engine.rb +1 -1
  9. data/lib/awesome_translations/erb_inspector/file_inspector.rb +1 -1
  10. data/lib/awesome_translations/global_translator.rb +12 -12
  11. data/lib/awesome_translations/handlers/validations_handler.rb +1 -1
  12. data/lib/awesome_translations/translate_functionality.rb +2 -2
  13. data/lib/awesome_translations/version.rb +1 -1
  14. metadata +4 -281
  15. data/spec/controllers/groups_controller_spec.rb +0 -83
  16. data/spec/controllers/handlers_controller_spec.rb +0 -51
  17. data/spec/controllers/users_controller_spec.rb +0 -21
  18. data/spec/dummy/README.rdoc +0 -28
  19. data/spec/dummy/Rakefile +0 -6
  20. data/spec/dummy/app/assets/config/manifest.js +0 -3
  21. data/spec/dummy/app/assets/javascripts/application.js +0 -0
  22. data/spec/dummy/app/assets/javascripts/translations.js +0 -3
  23. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  24. data/spec/dummy/app/controllers/application_controller.rb +0 -15
  25. data/spec/dummy/app/controllers/locales_controller.rb +0 -6
  26. data/spec/dummy/app/controllers/users_controller.rb +0 -43
  27. data/spec/dummy/app/helpers/application_helper.rb +0 -7
  28. data/spec/dummy/app/mailers/my_mailer.rb +0 -5
  29. data/spec/dummy/app/models/application_record.rb +0 -3
  30. data/spec/dummy/app/models/role.rb +0 -17
  31. data/spec/dummy/app/models/user.rb +0 -8
  32. data/spec/dummy/app/views/layouts/application.html.erb +0 -28
  33. data/spec/dummy/app/views/users/_partial_test.html.erb +0 -1
  34. data/spec/dummy/app/views/users/edit.html.liquid +0 -7
  35. data/spec/dummy/app/views/users/index.html.haml +0 -16
  36. data/spec/dummy/app/views/users/show.html.erb +0 -7
  37. data/spec/dummy/bin/bundle +0 -3
  38. data/spec/dummy/bin/rails +0 -4
  39. data/spec/dummy/bin/rake +0 -4
  40. data/spec/dummy/config/application.rb +0 -35
  41. data/spec/dummy/config/boot.rb +0 -5
  42. data/spec/dummy/config/database.yml +0 -25
  43. data/spec/dummy/config/environment.rb +0 -5
  44. data/spec/dummy/config/environments/development.rb +0 -32
  45. data/spec/dummy/config/environments/production.rb +0 -80
  46. data/spec/dummy/config/environments/test.rb +0 -39
  47. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  48. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  49. data/spec/dummy/config/initializers/inflections.rb +0 -16
  50. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  51. data/spec/dummy/config/initializers/secret_token.rb +0 -13
  52. data/spec/dummy/config/initializers/session_store.rb +0 -3
  53. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  54. data/spec/dummy/config/routes.rb +0 -7
  55. data/spec/dummy/config.ru +0 -4
  56. data/spec/dummy/db/awesome_translations.sqlite3 +0 -0
  57. data/spec/dummy/db/development.sqlite3 +0 -0
  58. data/spec/dummy/db/migrate/20141018081559_create_users.rb +0 -9
  59. data/spec/dummy/db/migrate/20141018081640_create_roles.rb +0 -10
  60. data/spec/dummy/db/migrate/20150607110245_add_price_cents_to_roles.rb +0 -5
  61. data/spec/dummy/db/schema.rb +0 -30
  62. data/spec/dummy/db/test.sqlite3 +0 -0
  63. data/spec/dummy/log/development.log +0 -52
  64. data/spec/dummy/log/test.log +0 -770
  65. data/spec/dummy/public/404.html +0 -58
  66. data/spec/dummy/public/422.html +0 -58
  67. data/spec/dummy/public/500.html +0 -57
  68. data/spec/dummy/public/favicon.ico +0 -0
  69. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/2m/2mnPY9uUnBNkGHLxtFaWv5hB3oA7sY2K1ZtwQlZLnAY.cache +0 -2
  70. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +0 -2
  71. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/5r/5rpKlqLSFsRCibev7g6MQkIOhWuOah-1KAN3aqV_fYI.cache +0 -0
  72. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/6E/6ExTs_VkmUe-fovt99Kw8rq-xCfx0_qGsSoldSWScZI.cache +0 -1
  73. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/8O/8OrG8phjC9s5-_7GAI2TEmRjsrGsuvq1gnJQPdMm8v8.cache +0 -0
  74. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/8f/8f4REKYOWkNfHexyAVqGXnbOP3vky_ANapWzlRMDeQ4.cache +0 -3
  75. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/8n/8n_viDw_qMQaQmqHM0ObPADed5uRyEYo3gDZIiTqUyA.cache +0 -1
  76. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/9e/9euY4B26kaHeiqfd1Qc0bsfRjpzmq36X6uqUfaRNtIs.cache +0 -1
  77. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/AB/AB5PxrhEqi8qOm7AmSf-sHDs9ffj_iTsytaHas2ryPA.cache +0 -1
  78. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/AI/AICJO1oM9dzlQ_N1QlHcCN9e8PC0wjtYk7-VmuNdfwg.cache +0 -0
  79. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Ca/CaGQBiCuFgkHQ5gw8ZnGQqO8iP1md3GcllDsmaKBFdQ.cache +0 -2
  80. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Ch/ChWez9UVXMuuBpLJMDRGuDmMuXy8gIuFo6794-wBgXc.cache +0 -1
  81. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/D9/D9eOwgl8pLlC7LJu-LL59UeHm9d-CH1mPgsA8j6xkMg.cache +0 -1
  82. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache +0 -2
  83. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Hn/Hn53895nYKzu-g1FJKYS_yszYqCADXasTmN615R_qMQ.cache +0 -1
  84. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/It/ItV7jxV0bfHndR-H3cidDwpTFGhvs0ETLRqCTmZMXB8.cache +0 -1
  85. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/LL/LL0EenAcTXP-UNCqfcKtMF4Z8oDeWvdlwLQfuOVRPdw.cache +0 -0
  86. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +0 -3
  87. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/NU/NUN9oO9gyoo-sY32AOLHdDACjLIxisCxXdKd84ou6cs.cache +0 -2
  88. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Ob/ObuKkBd-camcT52YpgeuyheU-GDFLZCJnoVtq2plgW0.cache +0 -0
  89. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Og/Og_HPfE6734sqkQ0_h4EkOOx3Aoq1LABLH9ovjl6Bvw.cache +0 -0
  90. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Pw/Pwuhz_6So_JcSrxT0Uf4VaLhh_FFSJMKxLZFMbS0LNQ.cache +0 -0
  91. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/R-/R-nohuDiORrLlJJtKc5bQsjIRS8yTQFVR3EIxJx3JZw.cache +0 -1
  92. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/SX/SXA6qKBlsAQ-MLPi7-KPCPcSx9Gg2VR1xa-lCmgipgA.cache +0 -1
  93. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Sb/Sb1Vug319YfPL2Rci1PLMLXJjeIFYcNbHb5hKOvO1eo.cache +0 -2
  94. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/_f/_f0DjbdXTMEPb52THCCF5qbKkDs28tHHnap5ag4jsdU.cache +0 -0
  95. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/dT/dTb1O_9BwFdhA3VT1UTxY-XIIoAGDHGHVO9bzRUNIfc.cache +0 -0
  96. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/dV/dVTKOfd8qDIHT3VD-4emnl0yAIxcSF1pY0CUESPHwdM.cache +0 -0
  97. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/i0/i0TQIUsntlYrsibtn9YfB3qbI6bj8hLPom8KUfxR078.cache +0 -1
  98. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/jF/jFFXBsyFdv_TiNykX219AHs3Q7dQInYRP_80cAWZsgE.cache +0 -0
  99. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/mX/mXfx3VRudxpXrRx1aejtNA5YHOwND3kwWUfvdXHSors.cache +0 -2
  100. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/nG/nGQXdOLWsP4c926DJJBNXFUE0cKfZynnqN5aQ4T1I48.cache +0 -1
  101. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/oX/oXeqOS7RZb4eFbKrraeQtr6TUrXPTueLN_Crp7S0RLE.cache +0 -1
  102. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/p2/p27Ube4R6tciXRc0F8lpz6wUzmXIPxwqz7dKaUYVVuc.cache +0 -1
  103. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache +0 -2
  104. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/q6/q6BYa32YJF11eGVapO4ouNl6gayPIsARgMavlzZmoi0.cache +0 -2
  105. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/r5/r5draRYO72lGMZZKpqYbscAWxAawJVG7uO0uyx3iw24.cache +0 -1
  106. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/r7/r7kGQJTsdrqs3i-prYAVnngsoc6uAtrjLTULTJdgy9g.cache +0 -1
  107. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/rI/rITk_65QtUwq61bjRPAksGeJxbLUFfz-sFPnQiZPHjw.cache +0 -3
  108. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/rR/rRS9OkVGJ9Wvs1fwZH-raqD4sXkbV8WmlLGIibYpZmI.cache +0 -0
  109. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/u9/u9nsXMBU9hA4UnH4SDHgk19ev_JNeeiS1-EZDrgStCI.cache +0 -1
  110. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/un/unZXcRqhGJwHvVWJmJ1rTizBZq6H5jF28E5-FHyTYL4.cache +0 -1
  111. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/wP/wP-1NwhQC0Sp_5PHpwAI7N0_N99vLNy0TA2FcMd6zgE.cache +0 -0
  112. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/x7/x7KkTV3ibfIEysLB_ug5bfmnn2VLV_BldukPR3EoPBk.cache +0 -2
  113. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/xr/xrDdkyCzfXr-pIE8gfvD8iFiWPuq9EwuZIl-uU9s0_o.cache +0 -1
  114. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/yc/yc3EXb1cvVLmwnk8aQN89bgVFeuwsVz2k2p0mvC2c3c.cache +0 -1
  115. data/spec/factories/group.rb +0 -8
  116. data/spec/factories/handler.rb +0 -11
  117. data/spec/factories/handler_translation.rb +0 -13
  118. data/spec/factories/translation_key.rb +0 -8
  119. data/spec/factories/translation_value.rb +0 -9
  120. data/spec/factories/user.rb +0 -7
  121. data/spec/features/clean_ups_spec.rb +0 -38
  122. data/spec/features/duplicates_spec.rb +0 -61
  123. data/spec/features/movals_spec.rb +0 -60
  124. data/spec/handlers/file_handler_spec.rb +0 -103
  125. data/spec/handlers/model_handler_spec.rb +0 -40
  126. data/spec/handlers/validations_handler_spec.rb +0 -31
  127. data/spec/handlers_spec.rb +0 -9
  128. data/spec/lib/cache_database_generator_spec.rb +0 -59
  129. data/spec/lib/erb_inspector/file_inspector_spec.rb +0 -46
  130. data/spec/lib/erb_inspector/translation_inspector_spec.rb +0 -33
  131. data/spec/lib/erb_inspector_spec.rb +0 -30
  132. data/spec/lib/model_inspector/attribute_spec.rb +0 -18
  133. data/spec/lib/model_inspector_spec.rb +0 -39
  134. data/spec/lib/object_extensions_spec.rb +0 -7
  135. data/spec/lib/translation_migrator_spec.rb +0 -46
  136. data/spec/models/awesome_translations/handler_spec.rb +0 -8
  137. data/spec/models/awesome_translations/translated_value_spec.rb +0 -41
  138. data/spec/models/awesome_translations/translation_spec.rb +0 -54
  139. data/spec/spec_helper.rb +0 -76
@@ -1,21 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe UsersController do
4
- let(:user) { create :user }
5
-
6
- render_views
7
-
8
- around do |example|
9
- I18n.with_locale(:en) do
10
- example.call
11
- end
12
- end
13
-
14
- it "#update" do
15
- patch :update, params: {id: user.id, user: {email: "newemail@example.com"}}
16
- expect(response).to redirect_to user_url(user)
17
-
18
- # Ensure correct key
19
- expect(flash[:notice]).to eq "translation missing: en.users.user_was_updated"
20
- end
21
- 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>.
data/spec/dummy/Rakefile DELETED
@@ -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 File.expand_path("config/application", __dir__)
5
-
6
- Dummy::Application.load_tasks
@@ -1,3 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
3
- //= link_directory ../stylesheets .css
File without changes
@@ -1,3 +0,0 @@
1
- console.log(I18n.t(".hello_world"))
2
- console.log(I18n.t("javascripts.absolute.key"))
3
- console.log(I18n.t("javascripts.absolute.key_with_args", {some_arg: "Hello", some_other_arg: "World"}))
@@ -1,13 +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 vendor/assets/stylesheets of plugins, if any, 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 top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
10
- *
11
- *= require_self
12
- *= require_tree .
13
- */
@@ -1,15 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- include AwesomeTranslations::ControllerTranslateFunctionality
3
-
4
- # Prevent CSRF attacks by raising an exception.
5
- # For APIs, you may want to use :null_session instead.
6
- protect_from_forgery with: :exception
7
-
8
- around_action :with_locale
9
-
10
- private
11
-
12
- def with_locale(&blk)
13
- I18n.with_locale(session[:locale] || :en, &blk)
14
- end
15
- end
@@ -1,6 +0,0 @@
1
- class LocalesController < ApplicationController
2
- def create
3
- session[:locale] = params[:locale]
4
- redirect_to root_url
5
- end
6
- end
@@ -1,43 +0,0 @@
1
- class UsersController < ApplicationController
2
- before_action :set_user
3
-
4
- def index
5
- @users = User.all
6
- end
7
-
8
- def show; end
9
-
10
- def new; end
11
-
12
- def create
13
- if @user.save
14
- flash[:notice] = t(".user_was_created")
15
- redirect_to user_path(@user)
16
- else
17
- flash[:error] = @user.errors.full_messages.join(". ")
18
- render :new
19
- end
20
- end
21
-
22
- def edit; end
23
-
24
- def update
25
- if @user.update(user_params)
26
- flash[:notice] = controller_t(".user_was_updated")
27
- redirect_to user_path(@user)
28
- else
29
- flash[:error] = @user.errors.full_messages.join(". ")
30
- render :edit
31
- end
32
- end
33
-
34
- private
35
-
36
- def set_user
37
- @user = User.find(params[:id].to_i) if params[:id].to_i > 0
38
- end
39
-
40
- def user_params
41
- params.require(:user).permit(:email)
42
- end
43
- end
@@ -1,7 +0,0 @@
1
- module ApplicationHelper
2
- include AwesomeTranslations::ViewsHelper
3
-
4
- def hello_world
5
- helper_t(".hello_world")
6
- end
7
- end
@@ -1,5 +0,0 @@
1
- class MyMailer < ActionMailer::Base # rubocop:disable Rails/ApplicationMailer
2
- def mailer_action(_user_id)
3
- mail(subject: t(".custom_subject"))
4
- end
5
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
@@ -1,17 +0,0 @@
1
- class Role < ApplicationRecord
2
- translates :name
3
- belongs_to :user
4
- validates :role, presence: true
5
- monetize :price_cents, allow_nil: true
6
-
7
- def self.roles
8
- {
9
- t(".administrator") => "admin",
10
- t(".moderator") => "moderator"
11
- }
12
- end
13
-
14
- def self.roles_array
15
- [[t(".user"), "user"]]
16
- end
17
- end
@@ -1,8 +0,0 @@
1
- class User < ApplicationRecord
2
- validates :email, presence: true
3
- validates :email, uniqueness: true
4
- validates :email, length: {in: 2..255}, format: {with: /\A.+@.+\Z/}
5
- validates :email, confirmation: true
6
-
7
- has_many :roles, dependent: :destroy
8
- end
@@ -1,28 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", media: "all" %>
6
- <%= javascript_include_tag "application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
- <div class="awesome-translations">
11
- <%= link_to t(".awesome_translations"), try(:awesome_translations_path) %>
12
- </div>
13
- <div class="language">
14
- <%= link_to t(".english"), locales_path(locale: :en), method: :post %>
15
- <%= link_to t(".danish"), locales_path(locale: :da), method: :post %>
16
- </div>
17
- <div class="current-language">
18
- <%= t(".the_current_language_is", locale: I18n.locale) %>
19
- </div>
20
- <%= t(".hello_world") %>
21
- <%= t(".hello_world") %>
22
- <div class="helper_hello_world">
23
- Hello world from helper
24
- <%= hello_world %>
25
- </div>
26
- <%= yield %>
27
- </body>
28
- </html>
@@ -1 +0,0 @@
1
- <%= t(".partial_test") %>
@@ -1,7 +0,0 @@
1
- <h1>{{ ".edit_user" | t }}</h1>
2
-
3
- {{ '.test_for_liquid_templates' | t }}
4
- {{ ".test_for_liquid_templates_with_escape" | t | escape }}
5
- {{ ".test_for_liquid_templates_with_var_escape" | val: "something", something | t | escape }}
6
- {{ ".test_for_liquid_templates_with_var_double_quotes" | val: "something", something | t }}
7
- {{ '.test_for_liquid_templates_with_var_single_quotes' | val: 'something', something | t }}
@@ -1,16 +0,0 @@
1
- %h1= User.model_name.human(count: 2)
2
-
3
- .hello-world-i18n= t(".hello_world")
4
-
5
- %h2= t(".list_of_users")
6
- %table
7
- %thead
8
- %tr
9
- %th= User.human_attribute_name(:id)
10
- %tbody
11
- - @users.each do |user|
12
- %tr
13
- %td= link_to user.id, user_path(user)
14
- - unless @users.any?
15
- %tr
16
- %td{colspan: 1}= t(".no_users_was_found")
@@ -1,7 +0,0 @@
1
- <div class="test-translation">
2
- <%= t(".some_translation") %>
3
- </div>
4
-
5
- <%= t("yes") %>
6
- <%= t("no") %>
7
- <%= t("activerecord.attributes.users.email") %>
@@ -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")
data/spec/dummy/bin/rails DELETED
@@ -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"
data/spec/dummy/bin/rake DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative "../config/boot"
3
- require "rake"
4
- Rake.application.run
@@ -1,35 +0,0 @@
1
- require File.expand_path("boot", __dir__)
2
-
3
- # Pick the frameworks you want:
4
- require "active_record/railtie"
5
- require "action_controller/railtie"
6
- require "action_mailer/railtie"
7
- require "sprockets/railtie"
8
- # require "rails/test_unit/railtie"
9
-
10
- Bundler.require(*Rails.groups)
11
-
12
- require "money-rails"
13
- require "awesome_translations"
14
-
15
- module Dummy; end
16
-
17
- class Dummy::Application < Rails::Application
18
- # Settings in config/environments/* take precedence over those specified here.
19
- # Application configuration should go into files in config/initializers
20
- # -- all .rb files in that directory are automatically loaded.
21
-
22
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
23
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
24
- # config.time_zone = 'Central Time (US & Canada)'
25
-
26
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
27
- config.i18n.load_path += Dir[Rails.root.join("config/locales/**/*.{rb,yml}").to_s]
28
- config.i18n.available_locales = [:da, :de, :en]
29
- config.i18n.default_locale = :en
30
-
31
- config.assets.precompile += %w[
32
- awesome_translations/application.css
33
- awesome_translations/application.js
34
- ]
35
- end
@@ -1,5 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
3
-
4
- require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
5
- $LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
@@ -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
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require File.expand_path("application", __dir__)
3
-
4
- # Initialize the Rails application.
5
- Dummy::Application.initialize!
@@ -1,32 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Do not eager load code on boot.
10
- config.eager_load = false
11
-
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send.
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger.
20
- config.active_support.deprecation = :log
21
-
22
- # Raise an error on page load if there are pending migrations
23
- config.active_record.migration_error = :page_load
24
-
25
- # Debug mode disables concatenation and preprocessing of assets.
26
- # This option may cause significant delays in view rendering with a large
27
- # number of complex assets.
28
- config.assets.debug = true
29
-
30
- # Raises error for missing translations
31
- # config.action_view.raise_on_missing_translations = true
32
- end
@@ -1,80 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # Code is not reloaded between requests.
5
- config.cache_classes = true
6
-
7
- # Eager load code on boot. This eager loads most of Rails and
8
- # your application in memory, allowing both thread web servers
9
- # and those relying on copy on write to perform better.
10
- # Rake tasks automatically ignore this option for performance.
11
- config.eager_load = true
12
-
13
- # Full error reports are disabled and caching is turned on.
14
- config.consider_all_requests_local = false
15
- config.action_controller.perform_caching = true
16
-
17
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
- # config.action_dispatch.rack_cache = true
21
-
22
- # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_files = false
24
-
25
- # Compress JavaScripts and CSS.
26
- config.assets.js_compressor = :uglifier
27
- # config.assets.css_compressor = :sass
28
-
29
- # Do not fallback to assets pipeline if a precompiled asset is missed.
30
- config.assets.compile = false
31
-
32
- # Generate digests for assets URLs.
33
- config.assets.digest = true
34
-
35
- # Version of your assets, change this if you want to expire all your assets.
36
- config.assets.version = "1.0"
37
-
38
- # Specifies the header that your server uses for sending files.
39
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
41
-
42
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
- # config.force_ssl = true
44
-
45
- # Set to :debug to see everything in the log.
46
- config.log_level = :info
47
-
48
- # Prepend all log lines with the following tags.
49
- # config.log_tags = [ :subdomain, :uuid ]
50
-
51
- # Use a different logger for distributed setups.
52
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
53
-
54
- # Use a different cache store in production.
55
- # config.cache_store = :mem_cache_store
56
-
57
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
- # config.action_controller.asset_host = "http://assets.example.com"
59
-
60
- # Precompile additional assets.
61
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
- # config.assets.precompile += %w( search.js )
63
-
64
- # Ignore bad email addresses and do not raise email delivery errors.
65
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66
- # config.action_mailer.raise_delivery_errors = false
67
-
68
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69
- # the I18n.default_locale when a translation can not be found).
70
- config.i18n.fallbacks = true
71
-
72
- # Send deprecation notices to registered listeners.
73
- config.active_support.deprecation = :notify
74
-
75
- # Disable automatic flushing of the log to improve performance.
76
- # config.autoflush_log = false
77
-
78
- # Use default logging formatter so that PID and timestamp are not suppressed.
79
- config.log_formatter = ::Logger::Formatter.new
80
- end
@@ -1,39 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Do not eager load code on boot. This avoids loading your whole application
11
- # just for the purpose of running a single test. If you are using a tool that
12
- # preloads Rails for running tests, you may have to set it to true.
13
- config.eager_load = false
14
-
15
- # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_files = true
17
- config.static_cache_control = "public, max-age=3600"
18
-
19
- # Show full error reports and disable caching.
20
- config.consider_all_requests_local = true
21
- config.action_controller.perform_caching = false
22
-
23
- # Raise exceptions instead of rendering exception templates.
24
- config.action_dispatch.show_exceptions = false
25
-
26
- # Disable request forgery protection in test environment.
27
- config.action_controller.allow_forgery_protection = false
28
-
29
- # Tell Action Mailer not to deliver emails to the real world.
30
- # The :test delivery method accumulates sent emails in the
31
- # ActionMailer::Base.deliveries array.
32
- config.action_mailer.delivery_method = :test
33
-
34
- # Print deprecation notices to the stderr.
35
- config.active_support.deprecation = :stderr
36
-
37
- # Raises error for missing translations
38
- # config.action_view.raise_on_missing_translations = true
39
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Configure sensitive parameters which will be filtered from the log file.
4
- Rails.application.config.filter_parameters += [:password]
@@ -1,16 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format. Inflections
4
- # are locale specific, and you may define rules for as many different
5
- # locales as you wish. All of these examples are active by default:
6
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
- # inflect.plural /^(ox)$/i, '\1en'
8
- # inflect.singular /^(ox)en/i, '\1'
9
- # inflect.irregular 'person', 'people'
10
- # inflect.uncountable %w( fish sheep )
11
- # end
12
-
13
- # These inflection rules are supported but not enabled by default:
14
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
- # inflect.acronym 'RESTful'
16
- # end
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,13 +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 your secret_key_base is kept private
11
- # if you're sharing your code publicly.
12
- Dummy::Application.config.secret_key_base =
13
- "3193d92d55b33329105a2631964cb2022b233668841f66633ebdc25614b26cd22912d3ed8d6a16f0e58c407c80fac4a7c32eab62a2c03d853e57349244938528"
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Dummy::Application.config.session_store :cookie_store, key: "_dummy_session"
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
- end
10
-
11
- # To enable root element in JSON for ActiveRecord objects.
12
- # ActiveSupport.on_load(:active_record) do
13
- # self.include_root_in_json = true
14
- # end
@@ -1,7 +0,0 @@
1
- Rails.application.routes.draw do
2
- mount AwesomeTranslations::Engine => "/awesome_translations" if Rails.env.development?
3
-
4
- resources :locales
5
- resources :users
6
- root to: "users#index"
7
- end
data/spec/dummy/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path("config/environment", __dir__)
4
- run Rails.application
Binary file
@@ -1,9 +0,0 @@
1
- class CreateUsers < ActiveRecord::Migration[5.1]
2
- def change
3
- create_table :users do |t|
4
- t.string :email
5
- t.string :password
6
- t.integer :age
7
- end
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- class CreateRoles < ActiveRecord::Migration[5.1]
2
- def change
3
- create_table :roles do |t|
4
- t.belongs_to :user
5
- t.string :role
6
- end
7
-
8
- add_index :roles, :user_id
9
- end
10
- end
@@ -1,5 +0,0 @@
1
- class AddPriceCentsToRoles < ActiveRecord::Migration[5.1]
2
- def change
3
- add_column :roles, :price_cents, :integer
4
- end
5
- end