dohutil 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/doh/env.rb +16 -0
  2. data/lib/doh/log/stub.rb +14 -0
  3. metadata +9 -7
data/lib/doh/env.rb ADDED
@@ -0,0 +1,16 @@
1
+ module Doh
2
+ DEFAULT_ENV_PREFIXES = %w(DOH RACK RAILS)
3
+
4
+ def self.env
5
+ @env ||= (find_env || 'development')
6
+ end
7
+
8
+ def self.find_env(prefixes = nil)
9
+ retval = nil
10
+ (prefixes || DEFAULT_ENV_PREFIXES).each do |elem|
11
+ retval = ENV["#{elem}_ENV"]
12
+ break if retval
13
+ end
14
+ retval
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ class Object
2
+ unless respond_to?(:dohlog)
3
+ class DohlogStubInterface
4
+ def self.debug(msg); end
5
+ def self.info(msg); end
6
+ def self.alert(msg); end
7
+ def self.error(msg, exception = nil); end
8
+ def self.fatal(msg, exception = nil); end
9
+ end
10
+ def dohlog
11
+ DohlogStubInterface
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohutil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,22 +12,24 @@ bindir: bin
12
12
  cert_chain: []
13
13
  date: 2012-01-27 00:00:00.000000000Z
14
14
  dependencies: []
15
- description: This is a collection of tiny standalone utilities, built primarily to
16
- support other doh* gems (note the gems that are dependent on dohutil), but designed
17
- in a way that hopefully makes them more generally useful.
15
+ description: ! "\n This is a collection of tiny utilities, for a variety of purposes.\n
16
+ \ Originally built to support other doh* gems, such as dohtest, but\n designed
17
+ in a way that hopefully makes them more generally useful.\n "
18
18
  email:
19
- - gitauthor@pqmland.com
19
+ - devinfo@atpsoft.com
20
20
  executables: []
21
21
  extensions: []
22
22
  extra_rdoc_files:
23
23
  - MIT-LICENSE
24
24
  files:
25
25
  - lib/doh/config.rb
26
+ - lib/doh/env.rb
26
27
  - lib/doh/findup.rb
28
+ - lib/doh/log/stub.rb
27
29
  - lib/doh/options.rb
28
30
  - lib/doh/root.rb
29
31
  - MIT-LICENSE
30
- homepage: https://github.com/pquimo/dohutil
32
+ homepage: https://github.com/atpsoft/dohutil
31
33
  licenses:
32
34
  - MIT
33
35
  post_install_message:
@@ -51,5 +53,5 @@ rubyforge_project:
51
53
  rubygems_version: 1.8.10
52
54
  signing_key:
53
55
  specification_version: 3
54
- summary: Tiny standalone utilities, packaged together for convenience.
56
+ summary: Tiny utilities, packaged together for convenience.
55
57
  test_files: []