pwkeep 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/pwkeep/main.rb +4 -4
- data/lib/pwkeep/storage.rb +1 -1
- data/pwkeep.gemspec +1 -1
- metadata +1 -1
data/README.md
CHANGED
data/lib/pwkeep/main.rb
CHANGED
@@ -108,7 +108,7 @@ EOS
|
|
108
108
|
result = PWKeep.run_editor(data, {})
|
109
109
|
|
110
110
|
unless result[0]
|
111
|
-
raise "Not modified"
|
111
|
+
raise PWKeep::Exception, "Not modified"
|
112
112
|
end
|
113
113
|
|
114
114
|
pw = ask("Enter your password:") { |q| q.echo = false }
|
@@ -124,7 +124,7 @@ EOS
|
|
124
124
|
data = @storage.load_system opts[:system]
|
125
125
|
result = PWKeep.run_editor(data[:data], {})
|
126
126
|
unless result[0]
|
127
|
-
raise "Not modified"
|
127
|
+
raise PWKeep::Exception, "Not modified"
|
128
128
|
end
|
129
129
|
@storage.save_system opts[:system], result[1]
|
130
130
|
say("<%= color('Changes stored', GREEN)%>")
|
@@ -164,9 +164,9 @@ EOS
|
|
164
164
|
end
|
165
165
|
return
|
166
166
|
end
|
167
|
-
rescue PWKeep::Exception =>
|
167
|
+
rescue PWKeep::Exception => e1
|
168
168
|
PWKeep::logger.error e.message.colorize(:red)
|
169
|
-
rescue OpenSSL::PKey::RSAError =>
|
169
|
+
rescue OpenSSL::PKey::RSAError => e2
|
170
170
|
PWKeep::logger.error "Cannot load private key".colorize(:red)
|
171
171
|
end
|
172
172
|
end
|
data/lib/pwkeep/storage.rb
CHANGED
@@ -148,7 +148,7 @@ class Storage
|
|
148
148
|
system_h = system_to_hash(system)
|
149
149
|
|
150
150
|
data = { :system => system, :data => data, :stored_at => Time.now }
|
151
|
-
encrypt_system(path.join(system_h), data)
|
151
|
+
encrypt_system(path.join(system_h), data.to_json)
|
152
152
|
end
|
153
153
|
|
154
154
|
def valid?
|
data/pwkeep.gemspec
CHANGED