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 +4 -4
- data/lib/ravioli.rb +1 -1
- data/lib/ravioli/builder.rb +0 -2
- data/lib/ravioli/configuration.rb +6 -2
- data/lib/ravioli/{engine.rb → railtie.rb} +8 -9
- data/lib/ravioli/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e56ab68185fd144f082af7ecf11f18725ad872ffab08684d72c1bdff8a4d3672
|
4
|
+
data.tar.gz: a304ea94ee11385fad332140b8b521ca1d2f3fb1ba71e8baf0c46a3e73054b89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 307d77cdd70599a9c81d19eec6fc8206fb4a524a05e42d0a2a20edac514b4287be510be6708aefb5b18c61444f1e21e5816aca58355693c801a8fd627d00cd39
|
7
|
+
data.tar.gz: 3436f7252744290a5cc7242d501c1751b79c0ca7e9266b5d39c5e11efbf57269c81822819e77d2760ad8957a85f83cdaec24c4a6ebdec4c790bd8e3154c4d0ab
|
data/lib/ravioli.rb
CHANGED
data/lib/ravioli/builder.rb
CHANGED
@@ -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
|
97
|
-
|
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
|
-
|
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
|
data/lib/ravioli/version.rb
CHANGED
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
|
+
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-
|
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/
|
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
|