arcanus 0.6.0 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f691ad3164c5ba4a261d2d974d4095b480c739d
4
- data.tar.gz: 22682f983ddb043dcf11e01abd60ee76ebe2fae2
3
+ metadata.gz: cfdbfd95b410c5b263dbd46e5d13b1a47ba24bf3
4
+ data.tar.gz: 442ac40544405cc9b5e3066067eb444b9a314a3e
5
5
  SHA512:
6
- metadata.gz: ee13797a980e9f9a2afd541884a3d814a2e4348aa953657ddb29ec6684f9bdb68a5df5d00dea7c07c56284d7c565f52486870fc3e2b7b81baf555f69d449805b
7
- data.tar.gz: 168b42e29bca5d5b8c6280880e074316802e1c936f41a7f45011ec141f0ecb8cc007af7a91b7ebe9e57aec24f8670c03b126a312c16fdbc279606edb303a0f5d
6
+ metadata.gz: 9d4925a6692e79b6349390a05a11d7eda0dc14c65fde4e0e35a9ac854951bfd1f8b2fb4f48c3ffe73d0d7c518c3f8cbe13b2a4f56bc62f1a29efe25e5b55d471
7
+ data.tar.gz: 03e04c35dc1bae222f657b01a94e2f7a349e72cc94b66439a5604ab077edbddada2475bf57ef638bf4f02bd1c9da41fe42b6294a71ea56d0e9aa3a2cd6d9a6e4
@@ -40,9 +40,14 @@ module Arcanus
40
40
  @hash.fetch(*args)
41
41
  end
42
42
 
43
- # Returns the contents of the chest as a hash.
44
- def contents
45
- @hash
43
+ # Returns contents of the chest as a hash.
44
+ def to_hash
45
+ @hash.dup
46
+ end
47
+
48
+ # Returns contents of the chest as YAML.
49
+ def to_yaml
50
+ @hash.to_yaml
46
51
  end
47
52
 
48
53
  # Set value for the specified key path.
@@ -218,6 +223,10 @@ module Arcanus
218
223
  @hash.inspect
219
224
  end
220
225
 
226
+ def to_hash
227
+ @hash.dup
228
+ end
229
+
221
230
  # Implicit conversion to array. Needs to be defined so we can `puts` this
222
231
  # value.
223
232
  def to_ary
@@ -24,7 +24,7 @@ module Arcanus::Command
24
24
  # Edit entire chest
25
25
  ::Tempfile.new(['arcanus-chest', '.yaml']).tap do |file|
26
26
  file.sync = true
27
- file.write(chest.contents.to_yaml)
27
+ file.write(chest.to_yaml)
28
28
  edit_until_done(chest, file.path)
29
29
  end
30
30
  end
@@ -14,7 +14,7 @@ module Arcanus::Command
14
14
  key = Arcanus::Key.from_file(repo.unlocked_key_path)
15
15
  chest = Arcanus::Chest.new(key: key, chest_file_path: repo.chest_file_path)
16
16
 
17
- env_vars = extract_env_vars(chest.contents)
17
+ env_vars = extract_env_vars(chest.to_hash)
18
18
 
19
19
  output_lines =
20
20
  case arguments[1]
@@ -17,7 +17,7 @@ module Arcanus::Command
17
17
  ui.print chest.get(arguments[1])
18
18
  else
19
19
  # Print entire hash
20
- output_colored_hash(chest.contents)
20
+ output_colored_hash(chest.to_hash)
21
21
  end
22
22
  end
23
23
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module Arcanus
5
- VERSION = '0.6.0'.freeze
5
+ VERSION = '0.7.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arcanus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva