Module: Vault
- Defined in:
- lib/vault-tools.rb,
lib/vault-tools/app.rb,
lib/vault-tools/hid.rb,
lib/vault-tools/log.rb,
lib/vault-tools/web.rb,
lib/vault-tools/user.rb,
lib/vault-tools/config.rb,
lib/vault-tools/product.rb,
lib/vault-tools/version.rb,
lib/vault-tools/pipeline.rb,
lib/vault-tools/sinatra_helpers/html_serializer.rb
Defined Under Namespace
Modules: App, Config, HID, Log, Product, SinatraHelpers, Tools, User Classes: Pipeline, Web
Class Method Summary collapse
- .hack_time_class ⇒ Object
-
.load_path ⇒ Object
adds ./lib dir to the load path.
- .override_global_config ⇒ Object
-
.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.
Class Method Details
.hack_time_class ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/vault-tools.rb', line 34 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
22 23 24 25 |
# File 'lib/vault-tools.rb', line 22 def self.load_path $stderr.puts "Adding './lib' to path..." if ENV['DEBUG'] $LOAD_PATH.unshift(File.('./lib')) end |
.override_global_config ⇒ Object
42 43 44 45 46 |
# File 'lib/vault-tools.rb', line 42 def self.override_global_config $stderr.puts "Set Config to Vault::Config..." if ENV['DEBUG'] Object.send(:remove_const, :Config) Object.const_set(:Config, Vault::Config) end |
.require ⇒ Object
require bundler and the proper gems for the ENV
15 16 17 18 19 |
# File 'lib/vault-tools.rb', line 15 def self.require Kernel.require 'bundler' $stderr.puts "Loading #{ENV['RACK_ENV']} environment..." Bundler.require :default, ENV['RACK_ENV'].to_sym end |
.set_timezones ⇒ Object
sets TZ to UTC and Sequel timezone to :utc
28 29 30 31 32 |
# File 'lib/vault-tools.rb', line 28 def self.set_timezones $stderr.puts "Setting timezones to UTC..." if ENV['DEBUG'] Sequel.default_timezone = :utc if defined? Sequel ENV['TZ'] = 'UTC' end |
.setup ⇒ Object
all in one go
49 50 51 52 53 54 55 |
# File 'lib/vault-tools.rb', line 49 def self.setup self.require self.load_path self.set_timezones self.hack_time_class self.override_global_config end |