Module: Jersey
- Extended by:
- LoggingSingleton
- Defined in:
- lib/jersey.rb,
lib/jersey/api.rb,
lib/jersey/log.rb,
lib/jersey/setup.rb,
lib/jersey/version.rb,
lib/jersey/logging/mixins.rb,
lib/jersey/logging/base_logger.rb,
lib/jersey/logging/json_logger.rb,
lib/jersey/logging/logfmt_logger.rb
Defined Under Namespace
Modules: API, Extensions, HTTP, Helpers, Logging, LoggingSingleton, Middleware Classes: BaseLogger, JSONLogger, JsonLogger, LogfmtLogger, Logger
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Attribute Summary
Attributes included from LoggingSingleton
Class Method Summary collapse
- .hack_time_class ⇒ Object
-
.load_path ⇒ Object
adds ./lib dir to the load path.
-
.require ⇒ Object
require bundler and the proper gems for the ENV.
-
.set_timezones ⇒ Object
sets TZ to UTC and Sequel timezone to :utc.
-
.setup ⇒ Object
all in one go.
Methods included from LoggingSingleton
Class Method Details
.hack_time_class ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/jersey/setup.rb', line 25 def self.hack_time_class $stderr.puts "Modifying Time#to_s to use #iso8601..." if ENV['DEBUG'] # use send to call private method Time.send(:define_method, :to_s) do self.iso8601 end end |
.load_path ⇒ Object
adds ./lib dir to the load path
13 14 15 16 |
# File 'lib/jersey/setup.rb', line 13 def self.load_path $stderr.puts "Adding './lib' to path..." $LOAD_PATH.unshift(File.('./lib')) end |
.require ⇒ Object
require bundler and the proper gems for the ENV
5 6 7 8 9 10 |
# File 'lib/jersey/setup.rb', line 5 def self.require Kernel.require 'bundler' Config.dotenv! $stderr.puts "Loading #{Config.app_env} environment..." Bundler.require(:default, Config.app_env) end |
.set_timezones ⇒ Object
sets TZ to UTC and Sequel timezone to :utc
19 20 21 22 23 |
# File 'lib/jersey/setup.rb', line 19 def self.set_timezones $stderr.puts "Setting timezones to UTC..." Sequel.default_timezone = :utc if defined? Sequel ENV['TZ'] = 'UTC' end |
.setup ⇒ Object
all in one go
34 35 36 37 38 39 |
# File 'lib/jersey/setup.rb', line 34 def self.setup self.require self.load_path self.set_timezones self.hack_time_class end |