secret_garden 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fd8b035c1e983a5197765165fbfa569c6d5afc8
4
- data.tar.gz: 8324c7d980b1e747c8ae95e6a4b316bcdaba0f25
3
+ metadata.gz: 3da78f8745497d0bac247302cb5d78106ade5ff7
4
+ data.tar.gz: ca06edbf632fbc9def6e72e88d2b81fbd2b4b8de
5
5
  SHA512:
6
- metadata.gz: c4d29092775b47efd8ae2da86793b5b9bc932fffa375ccc846a4d262e9e8dd1036173da8b36e6606bde6fc7be3da4d712ab90d3a4b8c179aff44eeb545eaddb7
7
- data.tar.gz: 19d7393bc1eec088cd1dce7cfcb2f22b8f2be6bdfc49b3871182d4a5273e62d2f93819340d52cdc60252ec2f0f51a3e49bb428d751ae4ec5e161a19051f38a50
6
+ metadata.gz: 98d07e65ce00a14b851143f92f3f1f1b98348ebf373320117b57f345ad47b84974e8a9bf220f1d10b7dc702ef69d4f1f2b71e5fb51f5267f4f9c4edadbcc1529
7
+ data.tar.gz: 9b847dadff771541a80e1db777c4b8830371e3dceefbbcacf8e1edc9d2798a4238337a47ae2ef12b1898e5a872c43932380f26dc67d0646da79569b48fd27293
data/CHANGELOG ADDED
@@ -0,0 +1,18 @@
1
+ 0.1.0 / 2016-05-04
2
+
3
+ * Breaking changes
4
+
5
+ * Use latest env var syntax
6
+
7
+ 0.0.2 / 2016-03-21
8
+
9
+ * Enhancements
10
+
11
+ * Add SecretGarden.expose
12
+ * Add SecretGarden.fetch!
13
+
14
+ 0.0.1 / 2016-03-09
15
+
16
+ * Enhancements
17
+
18
+ * Basic functionality
@@ -6,7 +6,7 @@ module SecretGarden
6
6
 
7
7
  attr_accessor :root
8
8
 
9
- def initialize(root: Dir.pwd, env: nil)
9
+ def initialize(root: Dir.pwd)
10
10
  self.root = root
11
11
  end
12
12
 
@@ -37,7 +37,9 @@ module SecretGarden
37
37
 
38
38
  def parse_secret(line)
39
39
  name, path, property = line.scan(/([^\s]+)\s+([^:]+)(:.*)?/).first
40
- path.gsub! /@ENV@/, SecretGarden.env
40
+ path.gsub!(/\$(?:([a-zA-Z_][a-zA-Z0-9_]*)|{([a-zA-Z_][a-zA-Z0-9_]*)})/) do
41
+ ENV.fetch($1 || $2)
42
+ end
41
43
  [name, path, property.to_s[1..-1]]
42
44
  end
43
45
  end
@@ -1,3 +1,3 @@
1
1
  module SecretGarden
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/secret_garden.rb CHANGED
@@ -37,7 +37,7 @@ module SecretGarden
37
37
  end
38
38
 
39
39
  def self.map
40
- @map ||= SecretGarden::Map.new root: secret_file_path, env: env
40
+ @map ||= SecretGarden::Map.new root: secret_file_path
41
41
  end
42
42
 
43
43
  def self.secret_file_path=(val)
@@ -46,12 +46,4 @@ module SecretGarden
46
46
  def self.secret_file_path
47
47
  @secret_file_path ||= Dir.pwd
48
48
  end
49
-
50
- def self.env=(val)
51
- @env = val
52
- end
53
- def self.env
54
- @env ||= 'development' # sane default?
55
- end
56
-
57
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secret_garden
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Kastner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-21 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,6 +76,7 @@ files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
78
  - ".travis.yml"
79
+ - CHANGELOG
79
80
  - Gemfile
80
81
  - README.md
81
82
  - Rakefile