hnposts 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hnposts +11 -3
  3. data/lib/hnposts/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3961fe2760e8d173d015117190cd89a350f20aef
4
- data.tar.gz: a9d4aae48afab5742b9aedfce972d9a6dc12d93d
3
+ metadata.gz: 68d893f1165efc23bf5d3dbbb500f7c05d1d6242
4
+ data.tar.gz: 13ad6bb3a4f43719afd3402be0f5c997ba7d68bc
5
5
  SHA512:
6
- metadata.gz: 100db0b00e1d331e516168ea85e4e9b10c91fa676fe34addb83432da23a9765393b42bd5b3b3f86ee298df14fcf72544482332016f78ed803f2b8d5a89c6be8d
7
- data.tar.gz: 6f7bb7895f9baab19e3a0083e1fc66e9afcf7399abc5faaa77b2eb8dc404de287d7a23fe0cbc1cde5e4cfc4e51a209c9e3aa7299777892c20a133eac055bfc9c
6
+ metadata.gz: 6c743222b23fc961008efcffae37bfa4cdce0b6feb0282175911cb378f5e184a6fff9f276fdd82f97a9c74cba519dcdf24086105a91c111d4ce1a6c4b618889e
7
+ data.tar.gz: a68d08ac29df736191b86eb51dfaf383bdf29ce345b72e5465e3a4dab9e75bcda3715f02d95c351e9bf4a4a98f1474194b14b1aea808360f6a2f96f156338aff
data/bin/hnposts CHANGED
@@ -12,7 +12,15 @@ enc_opts = {
12
12
 
13
13
  posts = HNPosts.fetch_posts
14
14
 
15
- puts "Hacker News Stories".red.bold
16
- posts.each do |p|
17
- puts "#{format('%2d', p.position)}. #{p.title.blue} | #{p.comments.to_s.yellow.bold} #{"comments".yellow} | #{p.points.to_s.yellow.bold} #{"points".yellow}".encode(enc,enc_opts)
15
+ if STDOUT.tty?
16
+ puts "Hacker News Stories".red.bold
17
+ posts.each do |p|
18
+ puts "#{format('%2d', p.position)}. #{p.title.blue} | " \
19
+ "#{p.comments.to_s.yellow.bold} #{"comments".yellow} | " \
20
+ "#{p.points.to_s.yellow.bold} #{"points".yellow}".encode(enc,enc_opts)
21
+ end
22
+ else
23
+ posts.each do |p|
24
+ puts "#{p.title} | #{p.comments} comments | #{p.points} points".encode(enc,enc_opts)
25
+ end
18
26
  end
@@ -1,3 +1,3 @@
1
1
  module HNPosts
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hnposts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sankaranarayanan Viswanathan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-29 00:00:00.000000000 Z
11
+ date: 2014-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler