Module: Silencer::Environment
- Defined in:
- lib/silencer/rails/environment.rb
Constant Summary collapse
- RAILS_4 =
/^4/
- RAILS_5 =
/^5/
Class Method Summary collapse
- .rails4? ⇒ Boolean
- .rails5? ⇒ Boolean
- .rails? ⇒ Boolean
- .rails_version ⇒ Object
- .tagged_logger? ⇒ Boolean
Class Method Details
.rails4? ⇒ Boolean
20 21 22 |
# File 'lib/silencer/rails/environment.rb', line 20 def rails4? rails_version =~ RAILS_4 end |
.rails5? ⇒ Boolean
24 25 26 |
# File 'lib/silencer/rails/environment.rb', line 24 def rails5? rails_version =~ RAILS_5 end |
.rails? ⇒ Boolean
10 11 12 |
# File 'lib/silencer/rails/environment.rb', line 10 def rails? defined?(::Rails) end |
.rails_version ⇒ Object
14 15 16 17 18 |
# File 'lib/silencer/rails/environment.rb', line 14 def rails_version return unless rails? ::Rails::VERSION::STRING end |
.tagged_logger? ⇒ Boolean
28 29 30 |
# File 'lib/silencer/rails/environment.rb', line 28 def tagged_logger? rails4? || rails5? end |