chupacabra 0.2.1 → 1.0.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: 827c827c90f33ac238f7e4e6ffdb92903824241f
4
- data.tar.gz: 4b576fcd8b49219a30ed14bf1997fe409e228b85
3
+ metadata.gz: 91b249864fb39e2616ae0be1428cb4adebd56d3d
4
+ data.tar.gz: 80d046a996269dc178da4977c83c085c5d70e718
5
5
  SHA512:
6
- metadata.gz: 370a0a21a2363eb0ba1e9447cf6f66bc67afecccd84fd79944a8d636b9a6e16e1033bede68cbf3e8992cbe881cddae8f4cc8f29dd65ce6df8f2690408e2cf529
7
- data.tar.gz: 25971bac04c9558123909a9b5836f9fbb993c3a28166fca0807baff3f359aa4787408ed75737484ded5603030e523c139d335ac3569adeb67e8f1a56a9107903
6
+ metadata.gz: 2413b8de48467aa4826c3509e9dce5758283f9017400edc5761d573185444423f35b8548b51bc88c5f46d5cce1a5d933c5fe5f17c48f1003eccb6253698edec4
7
+ data.tar.gz: 4aff86c4513b274e4645d3b4c3e8832efee46957e7972460fb85716a5771135063d6eb65f317330cbfcc9401eb37e6f0c25da3456eac7eab4cf769dc412dbdcf
@@ -1,5 +1,6 @@
1
1
  require 'pathname'
2
2
  require 'fileutils'
3
+ require 'json'
3
4
 
4
5
  module Chupacabra
5
6
  class Storage
@@ -51,7 +52,7 @@ module Chupacabra
51
52
  def data
52
53
  @data ||=
53
54
  if File.exists?(self.class.passwords_path)
54
- Marshal.load(Crypto.decrypt(File.read(self.class.passwords_path), @password))
55
+ JSON.parse(Crypto.decrypt(File.read(self.class.passwords_path), @password))
55
56
  else
56
57
  { }
57
58
  end
@@ -59,8 +60,8 @@ module Chupacabra
59
60
 
60
61
  def save
61
62
  File.open(self.class.passwords_path, 'w') do |file|
62
- file << Crypto.encrypt(Marshal.dump(@data), @password)
63
+ file << Crypto.encrypt(@data.to_json, @password)
63
64
  end
64
65
  end
65
66
  end
66
- end
67
+ end
@@ -13,12 +13,15 @@ module Chupacabra
13
13
 
14
14
  def execute(command, run_in_test = false)
15
15
  log(command)
16
- if Chupacabra.test? && !run_in_test
16
+ output = if Chupacabra.test? && !run_in_test
17
17
  `echo #{command}`
18
18
  else
19
19
  log(command)
20
20
  `#{command}`
21
- end.encode!('UTF-8', :undef => :replace, :invalid => :replace, :replace => "").strip
21
+ end
22
+
23
+ output.encode!('UTF-8', :undef => :replace, :invalid => :replace, :replace => "") if output.respond_to?(:encode!)
24
+ output.strip
22
25
  end
23
26
 
24
27
  def get_password
@@ -1,3 +1,3 @@
1
1
  module Chupacabra
2
- VERSION = '0.2.1'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chupacabra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dawid Sklodowski