uberpass 0.0.4 → 0.0.5
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.
- data/README.rdoc +1 -1
- data/lib/uberpass/cli.rb +7 -11
- data/lib/uberpass/version.rb +1 -1
- data/spec/uberpass_spec.rb +10 -0
- metadata +2 -2
data/README.rdoc
CHANGED
data/lib/uberpass/cli.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'ostruct'
|
2
1
|
require "highline"
|
3
2
|
|
4
3
|
module Uberpass
|
@@ -159,13 +158,6 @@ module Uberpass
|
|
159
158
|
do_action if @run_loop
|
160
159
|
end
|
161
160
|
|
162
|
-
def self.help
|
163
|
-
print "\nactions:\n"
|
164
|
-
actions.each do |action|
|
165
|
-
@output.print " #{action.name}\n"
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
161
|
def confirm_action
|
170
162
|
@terminal.agree("<%= color('are you sure?', :confirm) %> ") { |q| q.default = "n" }
|
171
163
|
end
|
@@ -256,9 +248,13 @@ module Uberpass
|
|
256
248
|
end
|
257
249
|
|
258
250
|
def output_entry(key, values)
|
259
|
-
|
260
|
-
|
261
|
-
|
251
|
+
if values.nil?
|
252
|
+
out = "<%= color('#{key} does not exist', :error) %>"
|
253
|
+
else
|
254
|
+
out = "<%= color('#{values["created_at"].strftime("%d/%m/%Y")}', :date) %>"
|
255
|
+
out << " <%= color('#{key}', :name) %>\n"
|
256
|
+
out << "<%= color('#{values["password"]}', :name) %>"
|
257
|
+
end
|
262
258
|
|
263
259
|
@terminal.say out
|
264
260
|
end
|
data/lib/uberpass/version.rb
CHANGED
data/spec/uberpass_spec.rb
CHANGED
@@ -116,4 +116,14 @@ describe Uberpass do
|
|
116
116
|
password = Uberpass::FileHandler.show 'tumblr'
|
117
117
|
refute_nil password['tumblr']
|
118
118
|
end
|
119
|
+
|
120
|
+
it "should show an error if key missing" do
|
121
|
+
@output.truncate(@output.rewind)
|
122
|
+
@input << 's missing'
|
123
|
+
@input.rewind
|
124
|
+
|
125
|
+
@uberpass.do_action
|
126
|
+
|
127
|
+
assert_match /missing does not exist/, @output.string
|
128
|
+
end
|
119
129
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uberpass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: highline
|