ravioli 0.1.4 → 0.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f4bb7ba56c32614b3b2be61de6c94648e3ff2fbb54692f84c56bbacdbb1db4e
4
- data.tar.gz: bafd93a46a25071127c09c19231af5545749ea18b63eaa94d7ac2e67e2642fdd
3
+ metadata.gz: e56ab68185fd144f082af7ecf11f18725ad872ffab08684d72c1bdff8a4d3672
4
+ data.tar.gz: a304ea94ee11385fad332140b8b521ca1d2f3fb1ba71e8baf0c46a3e73054b89
5
5
  SHA512:
6
- metadata.gz: f2b59aa2b29243d15c43a0262442576eeedb7c2b5d651341e184b771f277c598c62844dfc0b9f3d234ce9206a80ecd62286d352f31a4ea08db6439f64c5ccac8
7
- data.tar.gz: a691095131f8babd604bf1a6c5a6aaacf4b137c46dc9adc1cd824ffabe2b2c1f75657e8b082defee4b911c5a37695d8955184ffe5d6c2f593cadc336ffdc92eb
6
+ metadata.gz: 307d77cdd70599a9c81d19eec6fc8206fb4a524a05e42d0a2a20edac514b4287be510be6708aefb5b18c61444f1e21e5816aca58355693c801a8fd627d00cd39
7
+ data.tar.gz: 3436f7252744290a5cc7242d501c1751b79c0ca7e9266b5d39c5e11efbf57269c81822819e77d2760ad8957a85f83cdaec24c4a6ebdec4c790bd8e3154c4d0ab
data/lib/ravioli.rb CHANGED
@@ -40,4 +40,4 @@ module Ravioli
40
40
  end
41
41
  end
42
42
 
43
- require_relative "ravioli/engine" if defined?(Rails)
43
+ require_relative "ravioli/railtie" if defined?(Rails)
@@ -79,10 +79,8 @@ module Ravioli
79
79
  #
80
80
  # @param is_staging [boolean, #present?] whether or not the current environment is considered a staging environment
81
81
  def add_staging_flag!(is_staging = Rails.env.production? && ENV["STAGING"].present?)
82
- require_relative "./staging_inquirer"
83
82
  is_staging = is_staging.present?
84
83
  configuration.staging = is_staging
85
- Rails.env.class.prepend Ravioli::StagingInquirer
86
84
  end
87
85
 
88
86
  # Iterates through the config directory (including nested folders) and
@@ -92,9 +92,13 @@ module Ravioli
92
92
  # rubocop:disable Style/MethodMissingSuper
93
93
  # rubocop:disable Style/MissingRespondToMissing
94
94
  def method_missing(method, *args, &block)
95
+ return super unless args.empty?
96
+
95
97
  # Return proper booleans from query methods
96
- return send(method.to_s.chomp("?")).present? if args.empty? && method.to_s.ends_with?("?")
97
- super
98
+ return send(method.to_s.chomp("?")).present? if method.to_s.ends_with?("?")
99
+
100
+ # Try to find a matching ENV key
101
+ fetch_env_key_for(method) { super(method, *args, &block) }
98
102
  end
99
103
  # rubocop:enable Style/MissingRespondToMissing
100
104
  # rubocop:enable Style/MethodMissingSuper
@@ -1,15 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Ravioli
4
- class Engine < ::Rails::Engine
5
- # Bootstrap Ravioli onto the Rails app
6
- initializer "ravioli", before: :load_environment_config do |app|
7
- Rails.extend Ravioli::RailsConfig unless Rails.respond_to?(:config)
8
- end
9
- end
10
-
11
- private
3
+ require_relative "./staging_inquirer"
12
4
 
5
+ module Ravioli
13
6
  module RailsConfig
14
7
  def config
15
8
  Ravioli.default || Ravioli.build(namespace: Rails.application&.class&.module_parent, strict: Rails.env.production?) do |config|
@@ -19,4 +12,10 @@ module Ravioli
19
12
  end
20
13
  end
21
14
  end
15
+
16
+ class Railtie < ::Rails::Railtie
17
+ # Bootstrap Ravioli onto the Rails app
18
+ Rails.env.class.prepend Ravioli::StagingInquirer
19
+ Rails.extend Ravioli::RailsConfig unless Rails.respond_to?(:config)
20
+ end
22
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ravioli
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ravioli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flip Sasser
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-22 00:00:00.000000000 Z
11
+ date: 2021-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -270,7 +270,7 @@ files:
270
270
  - lib/ravioli.rb
271
271
  - lib/ravioli/builder.rb
272
272
  - lib/ravioli/configuration.rb
273
- - lib/ravioli/engine.rb
273
+ - lib/ravioli/railtie.rb
274
274
  - lib/ravioli/staging_inquirer.rb
275
275
  - lib/ravioli/version.rb
276
276
  homepage: https://github.com/flipsasser/ravioli