rock_n_roll 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: f3eaa3a47503a0da3cf6f05a5bddf96eb9d62da029279ff8a7fa152cfb435f1d
4
- data.tar.gz: e38a3a7cd70f3aa0168744a89250c511dfd47a911a1d4b3d084e3eb0a468b597
3
+ metadata.gz: 0a1d3ec5bd587ae5252d86e9b10618dd0b1f2c0450aa20e10a1a8f4a33edd07c
4
+ data.tar.gz: 99d41a22f29b20c87bf9836ecd42b2c19387517493c34fbdaea7444ac5bae665
5
5
  SHA512:
6
- metadata.gz: 3746f2947e560b4f18ee65056c4913fc19c17a4781cc167edca55d7ec57ea1d1a4306ee3a6739e3eb1509beb84f29fabbb281f1259b93f1ca9036ec28b14f7c2
7
- data.tar.gz: 313a32473adb84e94aae7ec63f69f3c92d83c3bcffd527f19d991fd5133ac1cfa8047ec1a15458ce3e205778485bc32c138c25d093ffb38c29044fe56eb7cfef
6
+ metadata.gz: 1c64bc526db9f3653aa57f01e0d1bff340cc6e7d0e95b5827b705baf2930c031073a50133efbb908c365bdc1b3fca150058e566f0f8b51028f1ab2933dd7cd4f
7
+ data.tar.gz: a77caaf8762d6c18b5aa2c5f01e337476436e9165a4199648cb768f60ae4165e2b8ad8003534ec40fd1a47e0a662d9543e59d1bb9eb3248248aebe95bf55d095
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rock_n_roll (0.1.0)
4
+ rock_n_roll (0.2.0)
5
5
  nokogiri
6
6
 
7
7
  GEM
@@ -10,9 +10,9 @@ GEM
10
10
  coderay (1.1.2)
11
11
  diff-lcs (1.3)
12
12
  method_source (0.9.0)
13
- mini_portile2 (2.3.0)
14
- nokogiri (1.8.2)
15
- mini_portile2 (~> 2.3.0)
13
+ mini_portile2 (2.4.0)
14
+ nokogiri (1.9.1)
15
+ mini_portile2 (~> 2.4.0)
16
16
  pry (0.11.3)
17
17
  coderay (~> 1.1.0)
18
18
  method_source (~> 0.9.0)
@@ -42,4 +42,4 @@ DEPENDENCIES
42
42
  rspec
43
43
 
44
44
  BUNDLED WITH
45
- 1.16.1
45
+ 1.16.2
@@ -14,12 +14,14 @@ class RockNRoll::Race
14
14
  if location == ""
15
15
  location = "TBD"
16
16
  end
17
+
17
18
  url = "https://www.runrocknroll.com" + race.css("h3 a").attribute("href").text
18
19
  if !url.end_with?("/")
19
20
  url += "/"
20
21
  elsif url == ""
21
22
  url = "TBD"
22
23
  end
24
+
23
25
  self.new(location, url)
24
26
  end
25
27
 
@@ -36,15 +38,23 @@ class RockNRoll::Race
36
38
  end
37
39
 
38
40
  def date
39
- @date = race_site.search("h3 time").text.strip
41
+ if self.url != "https://www.runrocknroll.com/en/events/virtual-run/"
42
+ @date = race_site.search("h3 time").text.strip
43
+ else
44
+ @date = "Dates vary. Please check https://www.runrocknroll.com/en/events/virtual-run for more details!"
45
+ end
40
46
  end
41
47
 
42
48
  def description
43
- @description = race_site.search(".caption p").first.text.strip
44
- if @description == "Leer Más" || @description == ""
45
- @description = "Please click on the race's URL for more information."
49
+ if self.url == "https://www.runrocknroll.com/en/events/virtual-run/"
50
+ @description = "Sign up for a Virtual Rock N Roll Race! Visit https://www.runrocknroll.com/en/events/virtual-run for more details."
46
51
  else
47
- @description
52
+ @description = race_site.search(".caption p").first.text.strip
53
+ if @description == "Leer Más" || @description == ""
54
+ @description = "Please click on the race's URL for more information."
55
+ else
56
+ @description
57
+ end
48
58
  end
49
59
  end
50
60
 
@@ -54,14 +64,19 @@ class RockNRoll::Race
54
64
 
55
65
  def distances
56
66
  @race_distances = []
57
- distance_url = self.url + "the-races/courses/"
58
- @distance_site = Nokogiri::HTML(open(distance_url))
59
- @distance_site.search("div ul.nav-justified li").each do |distances|
60
- distances.search("a").collect do |distance| #iterate through the XML of distances
61
- race_distance = distance.text.strip
62
- @race_distances << race_distance
67
+ if self.url == "https://www.runrocknroll.com/en/events/virtual-run/"
68
+ @distances = "Distances vary. Please visit https://www.runrocknroll.com/en/events/virtual-run for more details!"
69
+ else
70
+ distance_url = self.url + "the-races/courses/"
71
+ @distance_site = Nokogiri::HTML(open(distance_url))
72
+ @distance_site.search("div ul.nav-justified li").each do |distances|
73
+ distances.search("a").collect do |distance| #iterate through the XML of distances
74
+ race_distance = distance.text.strip
75
+ @race_distances << race_distance
76
+ end
63
77
  end
78
+ @distances = @race_distances.join(", ")
64
79
  end
65
- @distances = @race_distances.join(", ")
66
80
  end
81
+
67
82
  end
@@ -1,3 +1,3 @@
1
1
  module RockNRoll
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -6,8 +6,8 @@ require "rock_n_roll/version"
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "rock_n_roll"
8
8
  spec.version = RockNRoll::VERSION
9
- spec.authors = ["'Alyssa Kim'"]
10
- spec.email = ["'alyssa.kim@gmail.com'"]
9
+ spec.authors = ["Alyssa Kim"]
10
+ spec.email = ["alyssa.kim@gmail.com"]
11
11
 
12
12
  spec.summary = %q{This gem returns information about Rock 'n' Roll races around the world.}
13
13
  spec.description = %q{This gem provides information on cities, dates, distances, hashtags, and URLs to Rock 'n' Roll races worldwide.}
@@ -26,8 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
27
  f.match(%r{^(test|spec|features)/})
28
28
  end
29
- spec.bindir = "exe"
30
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.executables << "rock-n-roll"
31
30
  spec.require_paths = ["lib"]
32
31
 
33
32
  spec.add_development_dependency "bundler", "~> 1.16"
@@ -35,4 +34,4 @@ Gem::Specification.new do |spec|
35
34
  spec.add_development_dependency "pry"
36
35
  spec.add_development_dependency "rspec"
37
36
  spec.add_dependency "nokogiri"
38
- end
37
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_n_roll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
- - "'Alyssa Kim'"
7
+ - Alyssa Kim
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-14 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,8 +83,9 @@ dependencies:
83
83
  description: This gem provides information on cities, dates, distances, hashtags,
84
84
  and URLs to Rock 'n' Roll races worldwide.
85
85
  email:
86
- - "'alyssa.kim@gmail.com'"
87
- executables: []
86
+ - alyssa.kim@gmail.com
87
+ executables:
88
+ - rock-n-roll
88
89
  extensions: []
89
90
  extra_rdoc_files: []
90
91
  files: