ouija 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gems +2 -0
- data/.gitignore +8 -0
- data/.rvmrc +4 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +16 -0
- data/README.md +105 -0
- data/lib/ouija/planchette.rb +1 -1
- data/lib/ouija/version.rb +1 -19
- data/ouija.gemspec +3 -4
- metadata +10 -4
data/.gems
ADDED
data/.gitignore
ADDED
data/.rvmrc
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/README.md
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
Ouija
|
2
|
+
=====
|
3
|
+
|
4
|
+
Ouija is a RubyGem that makes configuration clean and simple. Separate
|
5
|
+
concerns are in separate config files (yaml, currently). Configuration
|
6
|
+
is kept DRY by allowing you to declare the bulk of the settings as common
|
7
|
+
(hopefully) and then let's you override where necessary by environment and
|
8
|
+
hostname. At runtime, Ouija collapses the configuration into one graph based
|
9
|
+
on the current context -- hostname and environment (both of which can be
|
10
|
+
overridden).
|
11
|
+
|
12
|
+
Installation
|
13
|
+
------------
|
14
|
+
|
15
|
+
gem install ouija
|
16
|
+
|
17
|
+
Overriding
|
18
|
+
----------
|
19
|
+
|
20
|
+
Ouija collapses config settings at runtime based on current hostname and
|
21
|
+
environment. Tree structure is merged and values are overridden. Values
|
22
|
+
that are arrays are also overridden, not merged. See usage example below.
|
23
|
+
|
24
|
+
Override precedence:
|
25
|
+
|
26
|
+
`hosts` entries override
|
27
|
+
|
28
|
+
`environments` entries which override
|
29
|
+
|
30
|
+
`default` entries
|
31
|
+
|
32
|
+
Usage example
|
33
|
+
-------------
|
34
|
+
|
35
|
+
Config file `PROJECT_ROOT/config/ouija/foo.yml`
|
36
|
+
|
37
|
+
default:
|
38
|
+
output_dir: /usr/local/foo/results
|
39
|
+
logging:
|
40
|
+
log_dir: /var/log/foo
|
41
|
+
output_queues:
|
42
|
+
- 'NormalQueue'
|
43
|
+
environments:
|
44
|
+
production:
|
45
|
+
logging:
|
46
|
+
level: ERROR
|
47
|
+
output_queues:
|
48
|
+
- 'NormalQueue'
|
49
|
+
- 'SamplingQueue'
|
50
|
+
staging:
|
51
|
+
logging:
|
52
|
+
level: INFO
|
53
|
+
development:
|
54
|
+
logging:
|
55
|
+
level: DEBUG
|
56
|
+
output_queues:
|
57
|
+
- 'DevQueue'
|
58
|
+
hosts:
|
59
|
+
My-MacBook-Pro.local:
|
60
|
+
output_dir: ./results
|
61
|
+
logging:
|
62
|
+
log_dir: ./log
|
63
|
+
|
64
|
+
Driver script `PROJECT_ROOT/script/foo`
|
65
|
+
|
66
|
+
#!/usr/bin/env ruby
|
67
|
+
require 'rubygems'
|
68
|
+
require 'bundler/setup'
|
69
|
+
Bundler.require
|
70
|
+
require 'ouija'
|
71
|
+
Ouija.setup
|
72
|
+
planchette = Ouija.session('foo')
|
73
|
+
puts planchette.to_hash.inspect
|
74
|
+
|
75
|
+
Results on host with name `My-MacBook-Pro.local`
|
76
|
+
|
77
|
+
$ script/foo
|
78
|
+
{"output_dir"=>"./results", "logging"=>{"log_dir"=>"./log", "level"=>"DEBUG"}, "output_queues"=>["DevQueue"]}
|
79
|
+
$ OUIJA_ENV=staging script/foo
|
80
|
+
{"output_dir"=>"./results", "logging"=>{"log_dir"=>"./log", "level"=>"INFO"}, "output_queues"=>["NormalQueue"]}
|
81
|
+
$ OUIJA_ENV=production script/foo
|
82
|
+
{"output_dir"=>"./results", "logging"=>{"log_dir"=>"./log", "level"=>"ERROR"}, "output_queues"=>["NormalQueue", "SamplingQueue"]}
|
83
|
+
|
84
|
+
Legal stuff
|
85
|
+
-----------
|
86
|
+
|
87
|
+
Copyright (c) 2012, Rob Lewis ([kohder](http://github.com/kohder))
|
88
|
+
|
89
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
90
|
+
of this software and associated documentation files (the "Software"), to deal
|
91
|
+
in the Software without restriction, including without limitation the rights
|
92
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
93
|
+
copies of the Software, and to permit persons to whom the Software is
|
94
|
+
furnished to do so, subject to the following conditions:
|
95
|
+
|
96
|
+
The above copyright notice and this permission notice shall be included in
|
97
|
+
all copies or substantial portions of the Software.
|
98
|
+
|
99
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
100
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
101
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
102
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
103
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
104
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
105
|
+
THE SOFTWARE.
|
data/lib/ouija/planchette.rb
CHANGED
data/lib/ouija/version.rb
CHANGED
@@ -1,23 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Ouija
|
4
|
-
|
5
|
-
MAJOR, MINOR, PATCH = 0, 1, 0
|
6
|
-
|
7
|
-
def self.major
|
8
|
-
MAJOR
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.minor
|
12
|
-
MINOR
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.patch
|
16
|
-
PATCH
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.current
|
20
|
-
"#{major}.#{minor}.#{patch}"
|
21
|
-
end
|
22
|
-
end
|
4
|
+
VERSION = '0.1.1'
|
23
5
|
end
|
data/ouija.gemspec
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('lib/ouija/version')
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = 'ouija'
|
6
|
-
gem.version = Ouija::
|
6
|
+
gem.version = Ouija::VERSION
|
7
7
|
gem.platform = Gem::Platform::RUBY
|
8
8
|
gem.author = 'Rob Lewis (kohder)'
|
9
9
|
gem.email = 'rob@kohder.com'
|
@@ -14,9 +14,8 @@ Gem::Specification.new do |gem|
|
|
14
14
|
|
15
15
|
gem.required_ruby_version = '>= 1.9.2'
|
16
16
|
|
17
|
-
|
18
|
-
gem.
|
19
|
-
#gem.test_files = %x[git ls-files -- {spec}/*].split("\n")
|
17
|
+
gem.files = %x[git ls-files].split("\n")
|
18
|
+
gem.test_files = %x[git ls-files -- {spec}/*].split("\n")
|
20
19
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
21
20
|
gem.require_paths = %w(lib)
|
22
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ouija
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-09 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: The Ouija configuration gem
|
15
15
|
email: rob@kohder.com
|
@@ -17,13 +17,19 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
-
|
20
|
+
- .gems
|
21
|
+
- .gitignore
|
22
|
+
- .rvmrc
|
23
|
+
- Gemfile
|
24
|
+
- Gemfile.lock
|
21
25
|
- LICENSE.md
|
26
|
+
- README.md
|
22
27
|
- lib/ouija.rb
|
28
|
+
- lib/ouija/medium/yaml.rb
|
23
29
|
- lib/ouija/ouija.rb
|
24
30
|
- lib/ouija/planchette.rb
|
25
31
|
- lib/ouija/version.rb
|
26
|
-
-
|
32
|
+
- ouija.gemspec
|
27
33
|
homepage: http://github.com/kohder/ouija
|
28
34
|
licenses:
|
29
35
|
- MIT
|