acclimate 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/acclimate/command.rb +7 -3
- data/lib/acclimate/configuration.rb +28 -2
- data/lib/acclimate/version.rb +1 -1
- data/lib/acclimate.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 973b34f7b1806ac68c6404ab0fc36dc9a06c5f91
|
4
|
+
data.tar.gz: 7e5fbb219ec3f766c02b3d3fba09fe0bfd82ea6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31177a678d428c75ce5d92a31b90321a245feb5e946b5b490de85dfab9a6ca42180fc6ded7de7ac521472d3588c70ce7406ed0f29580785a20e59fae0ff32390
|
7
|
+
data.tar.gz: 70dd76895bf56d3a7fe63d383e1b32e48eb1bcd6d8ccbef8561249ae4e461df94df766f84bc1edc451448fb636687def48349906f06ea176e5b3a55d18e085b9
|
data/lib/acclimate/command.rb
CHANGED
@@ -17,12 +17,16 @@ module Acclimate
|
|
17
17
|
|
18
18
|
attr_reader :options
|
19
19
|
|
20
|
+
def base_path
|
21
|
+
Pathname.new( Dir.pwd )
|
22
|
+
end
|
23
|
+
|
20
24
|
def config
|
21
|
-
@config = config_klass.
|
25
|
+
@config = config_klass.load( options )
|
22
26
|
end
|
23
27
|
|
24
|
-
def
|
25
|
-
|
28
|
+
def config_filepath
|
29
|
+
config_klass.config_filepath
|
26
30
|
end
|
27
31
|
|
28
32
|
def config_klass
|
@@ -1,18 +1,44 @@
|
|
1
1
|
require 'hashie'
|
2
|
+
require 'pathname'
|
3
|
+
require 'yaml'
|
2
4
|
|
3
5
|
module Acclimate
|
4
6
|
class Configuration < Hashie::Mash
|
5
7
|
|
6
|
-
def
|
7
|
-
|
8
|
+
def self.load( options={} )
|
9
|
+
new( file_options.merge( options ))
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.config_filepath
|
13
|
+
end
|
14
|
+
|
15
|
+
def config_filepath
|
16
|
+
Pathname.new( self.class.config_filepath )
|
8
17
|
end
|
9
18
|
|
10
19
|
def slice( *keys )
|
11
20
|
klass.new( select { |k,v| keys.map( &:to_s ).include?( k ) } )
|
12
21
|
end
|
13
22
|
|
23
|
+
def for_env
|
24
|
+
return Hashie::Mash.new({}) unless env
|
25
|
+
self[env]
|
26
|
+
end
|
27
|
+
|
14
28
|
protected
|
15
29
|
|
30
|
+
def self.file_options
|
31
|
+
return {} unless config_filepath
|
32
|
+
|
33
|
+
File.exists?( config_filepath ) ?
|
34
|
+
load_file_options :
|
35
|
+
{}
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.load_file_options
|
39
|
+
YAML::load( File.read( config_filepath ))
|
40
|
+
end
|
41
|
+
|
16
42
|
def klass
|
17
43
|
self.class
|
18
44
|
end
|
data/lib/acclimate/version.rb
CHANGED
data/lib/acclimate.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acclimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C. Jason Harrelson (midas )
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|