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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72eaf532302a8ec6bf8a50eb76b9b3d4368374cb
4
- data.tar.gz: 93fc8a746da87159d17b20638ebba107ed2974bd
3
+ metadata.gz: 4a352d7713a9f41161d66acdea0fae66c8c62930
4
+ data.tar.gz: 4d13a6985e2cc7737482ac93313cdadfd0a11ec6
5
5
  SHA512:
6
- metadata.gz: 031642ebd06e5a47a0b760bdab559c19cfeb617abf5467ae5f37e1eb4be9ca4715c0ee87809f79ce7e95571a39c8ec91bc064848b9ec11c012afab4af1e9b31d
7
- data.tar.gz: cb0aa08173c7dbd0710027d2dea4f7246a4f94a6dd1b3106e9c39a95e67fe9628c48aa21256b69239635e5f8c97fbf83b7fa2cd05b93d149e818a9f99ed20c66
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 action".colored.yellow
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}. Enter the verification code below and you'll be all set from now on."
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
@@ -21,11 +21,6 @@ module Bro
21
21
  end
22
22
  end
23
23
 
24
- def reset_lookup_ids
25
- # drop all lookup ids
26
- write_state read_state().keep_if { |x| !!!(x =~ /\d+/) }, true
27
- end
28
-
29
24
  # read the ~/.bro file and return a hash of the values
30
25
  def read_state
31
26
  obj = {}
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.6'
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 COMMAND after 'bro add'. For example: bro add curl\n\n"
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}'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bropages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - bropages.org