Class: Rinfo
- Inherits:
-
Object
- Object
- Rinfo
- Defined in:
- lib/rinfo.rb,
lib/rinfo/engine.rb,
lib/rinfo/version.rb
Defined Under Namespace
Classes: Engine
Constant Summary collapse
- VERSION =
'0.2.0'
Class Attribute Summary collapse
Class Method Summary collapse
Class Attribute Details
.filename ⇒ Object
34 35 36 |
# File 'lib/rinfo.rb', line 34 def filename @filename ||= 'rinfo.json' end |
Class Method Details
.env_blacklist ⇒ Object
26 27 28 |
# File 'lib/rinfo.rb', line 26 def env_blacklist @env_blacklist ||= [:prod, :production] end |
.env_blacklist=(args) ⇒ Object
30 31 32 |
# File 'lib/rinfo.rb', line 30 def env_blacklist=(args) @env_blacklist = [*args].map(&:to_sym) end |
.inform! ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rinfo.rb', line 14 def inform! if should_inform? JSON.pretty_generate(rinfo) else fail ActionController::RoutingError, 'Not Found' end end |
.should_inform? ⇒ Boolean
22 23 24 |
# File 'lib/rinfo.rb', line 22 def should_inform? ([:all, env.to_sym] & env_blacklist).empty? end |