Module: RequestMigrations
- Defined in:
- lib/request_migrations.rb,
lib/request_migrations/gem.rb,
lib/request_migrations/router.rb,
lib/request_migrations/railtie.rb,
lib/request_migrations/testing.rb,
lib/request_migrations/version.rb,
lib/request_migrations/migrator.rb,
lib/request_migrations/migration.rb,
lib/request_migrations/controller.rb,
lib/request_migrations/configuration.rb
Defined Under Namespace
Modules: Controller, Router Classes: Configuration, InvalidVersionError, InvalidVersionFormatError, Migration, Migrator, Railtie, Testing, UnsupportedMigrationError, UnsupportedVersionError, Version
Constant Summary collapse
- SUPPORTED_VERSION_FORMATS =
SUPPORTED_VERSION_FORMATS is a list of supported version formats.
i[ semver date float integer string ].freeze
- VERSION =
"1.1.1"
Class Method Summary collapse
-
.config ⇒ Object
config returns the current config.
- .config=(cfg) ⇒ Object
-
.configure {|config| ... } ⇒ Object
configure yields the config.
-
.logger ⇒ Logger
logger returns the configured logger.
- .reset! ⇒ Object
-
.supported_versions ⇒ Array<String, Integer, Float>
supported_versions returns an array of supported versions.
Class Method Details
.config ⇒ Object
config returns the current config.
44 |
# File 'lib/request_migrations.rb', line 44 def self.config = @config ||= Configuration.new |
.config=(cfg) ⇒ Object
48 49 50 51 52 53 |
# File 'lib/request_migrations.rb', line 48 def self.config=(cfg) raise ArgumentError, 'invalid config provided' unless cfg.is_a?(Configuration) @config = cfg end |
.configure {|config| ... } ⇒ Object
configure yields the config.
77 78 79 |
# File 'lib/request_migrations.rb', line 77 def self.configure yield config end |
.logger ⇒ Logger
logger returns the configured logger.
65 66 67 68 69 70 71 |
# File 'lib/request_migrations.rb', line 65 def self.logger @logger ||= if RequestMigrations.config.logger.respond_to?(:tagged) RequestMigrations.config.logger.tagged(:request_migrations) else RequestMigrations.config.logger end end |
.reset! ⇒ Object
57 58 59 |
# File 'lib/request_migrations.rb', line 57 def self.reset! @config = Configuration.new end |
.supported_versions ⇒ Array<String, Integer, Float>
supported_versions returns an array of supported versions.
85 86 87 |
# File 'lib/request_migrations.rb', line 85 def self.supported_versions [RequestMigrations.config.current_version, *RequestMigrations.config.versions.keys].uniq.freeze end |