bropages 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bro/bro_state.rb +8 -5
- data/lib/bro/state.rb +0 -5
- data/lib/bro.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a352d7713a9f41161d66acdea0fae66c8c62930
|
4
|
+
data.tar.gz: 4d13a6985e2cc7737482ac93313cdadfd0a11ec6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f40a77c3d3057270cbd8ab85ac613772463721ca8326e375c95ae1ba7e6754f3c554e1cfadda3cae14cfe509173ea5945b53721d22185511f2f230e63699da26
|
7
|
+
data.tar.gz: 38768e9ed880117940121446bc103edd2786212a647f22deeef5d5caf6c013914a668ebbb4d72edb9c72a22084e347cde5ebd228553ecb09ae3010776bb782b9
|
data/lib/bro/bro_state.rb
CHANGED
@@ -9,6 +9,11 @@ module Bro
|
|
9
9
|
cmd
|
10
10
|
end
|
11
11
|
|
12
|
+
def reset_lookup_ids
|
13
|
+
# drop all lookup ids
|
14
|
+
write_state read_state().keep_if { |x| !!!(x =~ /\d+/) }, true
|
15
|
+
end
|
16
|
+
|
12
17
|
def check_email
|
13
18
|
begin
|
14
19
|
is_invalid_code read_state[:code], read_state[:email]
|
@@ -20,9 +25,7 @@ module Bro
|
|
20
25
|
end
|
21
26
|
|
22
27
|
def prompt_email
|
23
|
-
say "Bropages.org requires an email address verification to do this
|
24
|
-
say "Your email address and verification code will be saved locally on your machine to a file called #{"~/.bro".colored.yellow} and used for future bropages.org activity"
|
25
|
-
say "When you enter your email, you'll get a verification email with a code. Enter the code when prompted"
|
28
|
+
say "Bropages.org requires an email address verification to do this".colored.yellow
|
26
29
|
|
27
30
|
email = ""
|
28
31
|
|
@@ -36,7 +39,7 @@ module Bro
|
|
36
39
|
say "There was an error delivering to your email address. Please try again later".colored.yellow.on_red
|
37
40
|
raise e
|
38
41
|
else
|
39
|
-
say "Great! We're sending an email to #{email}.
|
42
|
+
say "Great! We're sending an email to #{email}".success
|
40
43
|
|
41
44
|
invalid_code = true
|
42
45
|
begin
|
@@ -44,7 +47,7 @@ module Bro
|
|
44
47
|
begin
|
45
48
|
is_invalid_code code, email
|
46
49
|
invalid_code = false
|
47
|
-
say "Great! You're verified! FYI, your email and code are stored locally in ~/.bro"
|
50
|
+
say "Great! You're verified! FYI, your email and code are stored locally in ~/.bro".success
|
48
51
|
write_state({ email: email, code: code })
|
49
52
|
rescue => e
|
50
53
|
say "Woops, there was a problem verifying your email. Please try again".colored.yellow.on_red
|
data/lib/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, '0.0.
|
19
|
+
program :version, '0.0.7'
|
20
20
|
program :description, "Highly readable supplement to man pages.\n\nShows simple, concise examples for commands."
|
21
21
|
default_command :lookup
|
22
22
|
|
@@ -121,7 +121,7 @@ command :add do |c|
|
|
121
121
|
c.summary = 'Add an entry, bro'
|
122
122
|
c.description = <<-QQQ.unindent
|
123
123
|
This adds an entry to the http://bropages.org database.
|
124
|
-
|
124
|
+
|
125
125
|
Called without parameters will add an entry for the last thing you looked up with bro.
|
126
126
|
QQQ
|
127
127
|
c.example 'Launch your editor to add an entry for curl', 'bro add curl'
|
@@ -140,7 +140,7 @@ command :add do |c|
|
|
140
140
|
cmd = state.get_arg_or_last_command args
|
141
141
|
|
142
142
|
if cmd.nil?
|
143
|
-
say "\nYou must enter a
|
143
|
+
say "\nYou must enter a command after #{"bro add".status}.\n\nFor example: #{"bro add".success} #{"curl".success.underline}\n\n"
|
144
144
|
else
|
145
145
|
prompt = <<-QQQ.unindent
|
146
146
|
#~ Bro entry for command '#{cmd}'
|