Commit Graph

15 Commits

Author SHA1 Message Date
Xavier Noria
821d6c694c Zeitwerk integration 2019-02-12 02:28:04 -08:00
Kasper Timm Hansen
37c948ce67
Restructure credentials after environment overrides.
Follow up to: e0d3313

- Revert renames from `encrypted` and `encrypted_file` back to `credentials`.
  They might be using our Encrypted* generators but from that level of abstraction
  they're still about credentials.

- Same vein: extract a `credentials` method for the `encrypted` local variable. But
  don't call it `encrypted` just because it uses that under the hood. It's about
  capturing the credentials. It's also useful in `change_credentials_in_system_editor`.

- Remove lots of needless argument passing. We've abstracted content_path and key_path
  into methods for a reason, so they should be used. Also spares a conspicuous rename
  of content_path into file_path in other methods.

- Reorders private methods so they're grouped into: command building blocks, option
  parsers, and the generators.

- Extracts commonality in the credentials application tests. A tad unsure about this.
  But I do like that we go with key, content thus matching the command and remove the
  yield which isn't really needed.

- Moves test/credentials_test.rb to beneath the test/application directory. It's a
  Rails application test, so it should be in there.

- Uses `root.join` — a neat trick gleaned from the tests! — and composes the configuration
  private methods such that the building block is below the callers.
2019-01-14 20:13:00 +01:00
Pat Allan
acea68de02 Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Xavier Noria
783763bde9 applies new string literal convention in railties/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:16:09 +02:00
Prathamesh Sonpatki
d93427840e
Remove unused boot_rails method and it's usage
- The `boot_rails` method from abstract_unit.rb is empty after 2abcdfd978fdcd491576a237e8c6b.
- So let's remove it and its usage.
2016-07-04 09:34:21 +05:30
Arun Agrawal
382f52ddbb Remove warning for setting eager_load
AppTemplate::Application.new does not run load hooks.

To load this configuration we need to use create which will 
run load hooks to load this configuration.
2015-06-05 11:07:16 +02:00
Benjamin Fleischer
db5f1a46f2 secret_token is now saved in Rails.application.secrets.secret_token
- `secrets.secret_token` is now used in all places `config.secret_token` was
  - `secrets.secret_token`, when not present in `config/secrets.yml`,
    now falls back to the value of `config.secret_token`
  - when `secrets.secret_token` is set, it over-writes
    `config.secret_token` so they are the same (for backwards-compatibility)
  - Update docs to reference app.secrets in all places
    - Remove references to `config.secret_token`, `config.secret_key_base`
- Warn that missing secret_key_base is deprecated
- Add tests for secret_token, key_generator, and message_verifier
  - the legacy key generator is used with the message verifier when
    secrets.secret_key_base is blank and secret_token is set
  - app.key_generator raises when neither secrets.secret_key_base nor
    secret_token are set
  - app.env_config    raises when neither secrets.secret_key_base nor
    secret_token are set
- Add changelog

Run focused tests via
ruby -w -Itest test/application/configuration_test.rb -n '/secret_|key_/'
2014-11-02 21:21:09 -06:00
Aaron Patterson
8121eefc22 add a new constructor that runs load hooks 2014-08-07 15:50:46 -07:00
Carlos Antonio da Silva
5d4fce640e Remove some more globals from tests
We are using blocks here so we have access to the environment around
them, no need for globals.
2014-07-30 22:52:38 -03:00
Rafael Mendonça França
43f525031a Make console and generators blocks works at Application instance level
Like rake tasks and runner blocks these blocks should also being shared
between applications since they are stored at the classes.

Fixes #14748
2014-04-14 18:59:47 -03:00
Rafael Mendonça França
e1404ec824 Rails.application should be set inside before_configuration hook
Fixes #14620
2014-04-07 17:35:00 -03:00
SUGINO Yasuhiro
4a36eb64a5 Fix typos: the indefinite articles(a -> an) 2013-09-13 20:44:37 +09:00
wangjohn
08dc92421a Allowing multiple rails applications in the same ruby instance.
This change provides the ability to create a new application with a
configuration which can be specified.
2013-06-30 18:52:40 -07:00