top-headlines 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/top-headlines/cli.rb +6 -6
- data/lib/top-headlines/source.rb +2 -2
- data/lib/top-headlines/version.rb +1 -1
- data/top-headlines.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18a04861f9e8ec16bdb8cad13363f477d9181829
|
4
|
+
data.tar.gz: 91b075f928689b14a9db065a9eb089daf91d34d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2f354b01e0f05ebde920e3d1e8526acdc1ed5ff284e61e6080b56fa3c36e59a84a0865cb019e7e26280d56bf29e07fdc2400eb8695c18b38053d05266ed19d6
|
7
|
+
data.tar.gz: d6d6274abf21b0c6965766d4f5fed656080ab6fc3636e98c58026224a5278ab7bd6c258579b0ee5136a6e94faf654d796d00f3f226a8005e434bff9d0c0d10ef
|
data/lib/top-headlines/cli.rb
CHANGED
@@ -94,7 +94,7 @@ class TopHeadlines::CLI
|
|
94
94
|
print "\nYOUR SELECTION: "
|
95
95
|
@num = gets.strip.upcase
|
96
96
|
|
97
|
-
while @num[-1].to_i.between?(1,5) && !
|
97
|
+
while @num[-1].to_i.between?(1,5) && !num_included_in_menu_if_statement
|
98
98
|
source = @num[0...-1].strip.upcase
|
99
99
|
headline = @num.strip[-1].to_i
|
100
100
|
|
@@ -106,7 +106,7 @@ class TopHeadlines::CLI
|
|
106
106
|
@num = gets.strip.upcase
|
107
107
|
end
|
108
108
|
|
109
|
-
|
109
|
+
num_included_in_menu_if_statement ? @input = @num : invalid_entry
|
110
110
|
menu_if_statement
|
111
111
|
end
|
112
112
|
|
@@ -115,7 +115,7 @@ class TopHeadlines::CLI
|
|
115
115
|
print "\nYOUR SELECTION: "
|
116
116
|
@num = gets.strip.upcase
|
117
117
|
|
118
|
-
while @num.to_i.between?(1,5) && !
|
118
|
+
while @num.to_i.between?(1,5) && !num_included_in_menu_if_statement
|
119
119
|
open_url(@input, @num)
|
120
120
|
|
121
121
|
sleep(1)
|
@@ -123,10 +123,10 @@ class TopHeadlines::CLI
|
|
123
123
|
print "\nYOUR SELECTION: "
|
124
124
|
@num = gets.strip.upcase
|
125
125
|
|
126
|
-
@input = @num if
|
126
|
+
@input = @num if num_included_in_menu_if_statement
|
127
127
|
end
|
128
128
|
|
129
|
-
|
129
|
+
num_included_in_menu_if_statement ? @input = @num : invalid_entry
|
130
130
|
menu_if_statement
|
131
131
|
end
|
132
132
|
|
@@ -140,7 +140,7 @@ class TopHeadlines::CLI
|
|
140
140
|
url != nil ? system("open", url) : invalid_entry
|
141
141
|
end
|
142
142
|
|
143
|
-
def
|
143
|
+
def num_included_in_menu_if_statement
|
144
144
|
@num == "EXIT" || @num == "ALL" || @num == "SOURCES" || source_includes?(@num)
|
145
145
|
end
|
146
146
|
|
data/lib/top-headlines/source.rb
CHANGED
@@ -3,8 +3,8 @@ class TopHeadlines::Source
|
|
3
3
|
SOURCES = {
|
4
4
|
"CNN" => {
|
5
5
|
url: "http://www.cnn.com/",
|
6
|
-
headlines_selector: "
|
7
|
-
urls_selector: "
|
6
|
+
headlines_selector: ".cd__headline",
|
7
|
+
urls_selector: ".cd__headline",
|
8
8
|
child_selector: "a"
|
9
9
|
},
|
10
10
|
"MSNBC" => {
|
data/top-headlines.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'top-headlines/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "top-headlines"
|
8
8
|
spec.version = TopHeadlines::VERSION
|
9
|
-
spec.authors = ["
|
9
|
+
spec.authors = ["Zach Newburgh"]
|
10
10
|
spec.email = ["zach.newburgh@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{This gem allows users to view the top headlines from major news sources. Users can open the headlines in the browser directly from the command line for articles from AP, BBC, Bloomberg, CNN, Daily Beast, FiveThirtyEight, Forbes, Fox News, Guardian, Huffington Post, MSNBC, New York Times, Politico, Wall Street Journal, Washington Post, and Yahoo News.}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: top-headlines
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Zach Newburgh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.4.
|
128
|
+
rubygems_version: 2.4.8
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: This gem allows users to view the top headlines from major news sources.
|