bropages 0.0.8 → 0.0.9
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 +8 -8
- data/lib/bro/bro_state.rb +2 -2
- data/lib/bro.rb +8 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTJhY2EwM2YzZDk5ZjA1NzYyZDQ3NzlhODAwODhlZjZmNjI3Njg3Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzMxY2IwOGFhODUwMjU4ZjE1MjU0YWY1YTI5ODA5MzNlZDk3YTAzMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjljMGU4ZWU0NWVmYWUzMzRlMmU2NjE0ZjUzMTFhZTNlYWUyODI0NTFhYzBj
|
10
|
+
YWRiMTIzMmE3NTA0NGE3ZjQ2MDIxMjVkMDJhYjMzY2E1OTMzMWQ3MTEzNzc4
|
11
|
+
ODQzNzk5Y2MzNzMyNzQ1Nzc2Zjg2MzNjZDQ1MGNjZGVhMWY1ZjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTU1OGI2M2RhMDY3ZjU1NWFmZDVhOWRkM2ZiNDA4NTc5YjE0MTFiN2FlNThj
|
14
|
+
MDY3MmJjZWMxMWRlOTQ0MjBjYWM4NjA1YzA2YzUxM2I4YzYyM2FiOTQ4OTg2
|
15
|
+
MzliMjkzYWIwZTEwZWQxOTJlYTIzNDVkMjk1NzhkN2RiZGE5MWI=
|
data/lib/bro/bro_state.rb
CHANGED
data/lib/bro.rb
CHANGED
@@ -16,7 +16,7 @@ URL = ENV["BROPAGES_URL"] || 'http://bropages.org'
|
|
16
16
|
FILE = ENV["HOME"] + '/.bro'
|
17
17
|
|
18
18
|
program :name, 'bro'
|
19
|
-
program :version,
|
19
|
+
program :version, Gem::Specification::load("bro.gemspec").version.to_s
|
20
20
|
program :description, "Highly readable supplement to man pages.\n\nShows simple, concise examples for commands."
|
21
21
|
default_command :lookup
|
22
22
|
|
@@ -130,7 +130,7 @@ command :add do |c|
|
|
130
130
|
c.action do |args, options|
|
131
131
|
begin
|
132
132
|
login_details = state.check_email
|
133
|
-
rescue
|
133
|
+
rescue => e
|
134
134
|
say "Sorry, you can't do this without email verification".sorry
|
135
135
|
say e
|
136
136
|
end
|
@@ -205,12 +205,13 @@ command :lookup do |c|
|
|
205
205
|
|
206
206
|
QQQ
|
207
207
|
else
|
208
|
-
|
208
|
+
cmd_display = args.join(" ")
|
209
|
+
cmd = args.join("%20")
|
209
210
|
|
210
211
|
state.reset_lookup_ids()
|
211
212
|
|
212
213
|
# write to ~/.bro file with last command
|
213
|
-
state.write_state({ cmd:
|
214
|
+
state.write_state({ cmd: cmd_display })
|
214
215
|
|
215
216
|
# connect to webservice for entry
|
216
217
|
error = false
|
@@ -218,9 +219,9 @@ command :lookup do |c|
|
|
218
219
|
res = RestClient.get URL + '/' + cmd + '.json'
|
219
220
|
rescue => e
|
220
221
|
say <<-QQQ.unindent
|
221
|
-
The #{
|
222
|
+
The #{cmd_display.colored.yellow} command isn't in our database
|
222
223
|
|
223
|
-
\t* Use #{"bro add".colored.green.underline} to add #{
|
224
|
+
\t* Use #{"bro add".colored.green.underline} to add #{cmd_display.colored.yellow} to our database!
|
224
225
|
|
225
226
|
\t* Need help? Visit #{"http://bropages.org/help".colored.underline}
|
226
227
|
|
@@ -232,7 +233,7 @@ command :lookup do |c|
|
|
232
233
|
enable_paging
|
233
234
|
list = JSON.parse res
|
234
235
|
s = list.length == 1 ? 'y' : 'ies'
|
235
|
-
say "#{list.length} entr#{s} for #{
|
236
|
+
say "#{list.length} entr#{s} for #{cmd_display}\n".status.underline
|
236
237
|
|
237
238
|
sep = ""
|
238
239
|
(HighLine::SystemExtensions.terminal_size[0] - 5).times { sep += "." }
|