reddit-ruby 1.0.6 → 1.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: a4099eb50fc2031049d8162ba6a92ca6c0f81a21
4
- data.tar.gz: d76fea2d26a6a494a1ea4951de5b6242621a837e
3
+ metadata.gz: 8000199fe4ed99318ccf99d2c202df572777cbfa
4
+ data.tar.gz: 43a66e1f26350621d6cfa10ca07bbbc95257abba
5
5
  SHA512:
6
- metadata.gz: 9989506f952d29a80624acafd5f04275d4b066c41bf69f7d32d7574db29edb7912d3a7523c4a1d14758a71a8d964d1e777b2b922753e24d7952499fb07af23e8
7
- data.tar.gz: 2ed230a2a03bc56a0997e85cce231e4aa3ca4e594ec1e28fc86dad2e4a73188b58dd8901967d7f4c8e23d3951ab877dcf157a3d45da92ce43d4752653865d92e
6
+ metadata.gz: 4337a5c0c7d5890fdb100e5ee5953301f2b1f2e79780b98185b4f48e88a5767cb353c7e581b2707a47c8ce41433d64c85ebfec2748512932bf68a29370acd246
7
+ data.tar.gz: a81e986d178a3e82878fb4879e2eac446363a167e484bb99f52786670df468dd6ab7b2924fad82102bc03690f095cb90e379998471cd16251a2485cd646a7c87
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reddit-ruby (1.0.6)
4
+ reddit-ruby (1.0.7)
5
5
  colorize
6
6
  nokogiri
7
7
 
data/lib/reddit/cli.rb CHANGED
@@ -18,6 +18,7 @@ class Reddit::CLI
18
18
  def menu
19
19
  input = nil
20
20
  while input != "exit"
21
+ puts ""
21
22
  puts "> Enter the number of the post you'd like more info on:"
22
23
  input = gets.strip.downcase
23
24
 
@@ -35,8 +36,12 @@ class Reddit::CLI
35
36
 
36
37
  def get_score_text(index)
37
38
  post = @posts[index.to_i]
38
- score = post[:upvotes].to_i >= 0 ? 'upvotes' : 'downvotes'
39
- upvotes = post[:upvotes].to_i < 10 ? "0#{post[:upvotes]}" : "#{post[:upvotes]}"
39
+ upvotes = post[:upvotes]
40
+ if post[:upvotes].to_i == 1
41
+ score = post[:upvotes].to_i >= 0 ? 'upvote' : 'downvote'
42
+ else
43
+ score = post[:upvotes].to_i >= 0 ? 'upvotes' : 'downvotes'
44
+ end
40
45
  return "#{upvotes} #{score}"
41
46
  end
42
47
 
@@ -65,6 +70,7 @@ class Reddit::CLI
65
70
  puts "1. Open in browser"
66
71
  puts "2. Show hot posts"
67
72
  puts "3. Exit"
73
+ puts ""
68
74
  input = gets.strip.downcase
69
75
  if input.to_i == 1
70
76
  openInBrowser(post[:url])
@@ -1,3 +1,3 @@
1
1
  module Reddit
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reddit-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logan McAnsh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2017-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler