punky_brewster 1.3.0 → 1.3.1

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: e8a9177571a0dcd323267ab86c302822074fad2f
4
- data.tar.gz: 47417879ff9929663329a0833e93a2b240b6c3b6
3
+ metadata.gz: 6844c1b11fcbf2b357dcaa4d0642e9542d7d1911
4
+ data.tar.gz: aa60da5f829ee4e2ac68c82ad393a77920c155e0
5
5
  SHA512:
6
- metadata.gz: 440fe7236b3791f5c252ade1d65aebdbde2e5688a907c564a3dcd5c8e9fc07e148eee268f6974d0716252170456f0bdba25bcb5f60137b3e4bfb0c79834c8a9b
7
- data.tar.gz: 59b547292fbfb7b3f619d7e2e85d1f02d739baf4dcc09ddae74c852d14cc478ace63e095ac019ab6b48a4b65bfe632c3f558274b20e2b9a03fb47c3b29935e58
6
+ metadata.gz: b5fa3e019bf34fb1c0cdaa1600c391c50d209b5aba74e25a402caa2b4baad08cd933fc6c6e30fe4120485ffb50940886be62bcd2b5d4620350f95321878c4bcd
7
+ data.tar.gz: cf120db09b90f5c51d0a1c7d7df524eb685722219c11bf79c22fea35d3edbb98e17443b5580021293be26c61ed684f107340ae6800d4388044e575aacf41c664
@@ -3,5 +3,10 @@ module PunkyBrewster
3
3
  def abv_per_dollar
4
4
  (abv.to_f / price).round(2)
5
5
  end
6
+
7
+ # Returns true if all expected values have been set.
8
+ def valid?
9
+ values.compact.length == members.length
10
+ end
6
11
  end
7
12
  end
@@ -11,14 +11,9 @@ module PunkyBrewster
11
11
  def beers
12
12
  @beers ||= begin
13
13
  content = document.at_css('#content')
14
- divide = content.at_css('.styled-hr')
15
- past_divide = false
16
14
  beer_list = []
17
15
 
18
16
  content.traverse do |node|
19
- past_divide = true if node == divide
20
- next unless past_divide
21
-
22
17
  if node.name == 'h2'
23
18
  beer_list << Beer.new
24
19
  # Includes non-breaking spaces
@@ -32,7 +27,7 @@ module PunkyBrewster
32
27
  end
33
28
  end
34
29
 
35
- beer_list
30
+ beer_list.select(&:valid?)
36
31
  end
37
32
  end
38
33
 
@@ -1,3 +1,3 @@
1
1
  module PunkyBrewster
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: punky_brewster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Nicholls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-22 00:00:00.000000000 Z
11
+ date: 2015-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -187,4 +187,3 @@ signing_key:
187
187
  specification_version: 4
188
188
  summary: What's pouring at Punky Brewster?
189
189
  test_files: []
190
- has_rdoc: