Class: Skywalking::Environment::SinatraFramework
- Inherits:
-
Object
- Object
- Skywalking::Environment::SinatraFramework
- Defined in:
- lib/skywalking/environment.rb
Instance Method Summary collapse
Instance Method Details
#app_name ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/skywalking/environment.rb', line 55 def app_name candidate = ObjectSpace.each_object(Class).select { |klass| klass < ::Sinatra::Base } - [::Sinatra::Application] if candidate.length == 1 candidate.first.name else "Sinatra" end rescue "Sinatra" end |
#env ⇒ Object
67 68 69 |
# File 'lib/skywalking/environment.rb', line 67 def env ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development' end |
#name ⇒ Object
47 48 49 |
# File 'lib/skywalking/environment.rb', line 47 def name :sinatra end |
#present? ⇒ Boolean
51 52 53 |
# File 'lib/skywalking/environment.rb', line 51 def present? defined?(::Sinatra) && defined?(::Sinatra::Base) end |