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.1.3'
Class Attribute Summary collapse
Class Method Summary collapse
Class Attribute Details
.filename ⇒ Object
33 34 35 |
# File 'lib/rinfo.rb', line 33 def filename @filename ||= 'rinfo.json' end |
Class Method Details
.env_blacklist ⇒ Object
25 26 27 |
# File 'lib/rinfo.rb', line 25 def env_blacklist @env_blacklist ||= [:prod, :production] end |
.env_blacklist=(args) ⇒ Object
29 30 31 |
# File 'lib/rinfo.rb', line 29 def env_blacklist=(args) @env_blacklist = [*args].map(&:to_sym) end |
.inform! ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rinfo.rb', line 13 def inform! if should_inform? JSON.pretty_generate(rinfo) else fail ActionController::RoutingError 'Not Found' end end |
.should_inform? ⇒ Boolean
21 22 23 |
# File 'lib/rinfo.rb', line 21 def should_inform? ([:all, env.to_sym] & env_blacklist).empty? end |