vrbo 0.2.1 → 1.0.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
  SHA1:
3
- metadata.gz: 6005b72bd6d6b2c13d6b0943d48e306e2d71a2fa
4
- data.tar.gz: 124b624d7c728e6541d3b057f8b65d3be88ac5fb
3
+ metadata.gz: 1e270cf50db857e13ff31144a26c6709004f5b37
4
+ data.tar.gz: 44946d1a06927d2851b466cd3778f7e496aab390
5
5
  SHA512:
6
- metadata.gz: 12ed01e0c19f5f7f118ca46c8f5157dbdfcd3cdd11180252573a39b8f277116e5b0228dced973b17abedc34d532e6d4569ca594e023d0686503b5d80e746ec69
7
- data.tar.gz: 55e0efc0820f4106ce33a97a7b43818b33a893c5cd8d6878f413437f9500c6f17eee924b9a22bed32f8414a4cdd744dc2ccb0151b51016a0541fa76a9f69a85c
6
+ metadata.gz: 7d98e6ebcf1b27439114ac95d14ddc4f314245e07d148fbb5fe3ae2feb1c3c45eb827ed68b8cc12b3c380b38fae1e3b9d7c52120ba9f1b0a1eb50c3be511bba9
7
+ data.tar.gz: 24c8e72c6b2fbf8d34e408ec7bcba8aafbf22fef76b0d81cc5adce8177cb065c75b185dd86aed184b205fdd7893550cb0d18bddcfaf5509adf6884ed238344d4
@@ -26,9 +26,7 @@ module VRBO
26
26
  @available_dates = today.upto(today + 365).map { |date| date_if_available(date) }.compact
27
27
  end
28
28
 
29
- alias :find_all_available_dates :find_available_dates
30
-
31
- def calendar_url(protocol = 'http')
29
+ def url(protocol = 'http')
32
30
  if id
33
31
  "#{protocol}://www.vrbo.com/#{id}/calendar"
34
32
  else
@@ -36,6 +34,8 @@ module VRBO
36
34
  end
37
35
  end
38
36
 
37
+ alias :find_all_available_dates :find_available_dates
38
+
39
39
  private
40
40
 
41
41
  def date_if_available(date)
@@ -53,7 +53,7 @@ module VRBO
53
53
  end
54
54
 
55
55
  def calendar
56
- @calendar ||= agent.get(calendar_url)
56
+ @calendar ||= agent.get(url)
57
57
  end
58
58
 
59
59
  def agent
@@ -64,6 +64,5 @@ module VRBO
64
64
  def table_xpath(date)
65
65
  "//b[contains(text(), '#{date.strftime('%B %Y')}')]/following-sibling::table"
66
66
  end
67
-
68
67
  end
69
68
  end
@@ -1,3 +1,3 @@
1
1
  module VRBO
2
- VERSION = '0.2.1'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -47,14 +47,15 @@ class CalendarTest < MiniTest::Unit::TestCase
47
47
  end
48
48
 
49
49
  def test_passing_calendar_id
50
- cal = VRBO::Calendar.new(calendar_id)
51
- assert_equal calendar_id, cal.id
52
- assert_equal "http://www.vrbo.com/#{calendar_id}/calendar", cal.calendar_url
50
+ calendar = VRBO::Calendar.new(calendar_id)
51
+ assert_equal calendar_id, calendar.id
52
+ assert_equal "http://www.vrbo.com/#{calendar_id}/calendar", calendar.url
53
+ assert_equal "https://www.vrbo.com/#{calendar_id}/calendar", calendar.url('https')
53
54
  end
54
55
 
55
56
  def test_no_calendar_id_given
56
57
  assert_raises ArgumentError do
57
- VRBO::Calendar.new.calendar_url
58
+ VRBO::Calendar.new.url
58
59
  end
59
60
  end
60
61
 
@@ -62,9 +63,9 @@ class CalendarTest < MiniTest::Unit::TestCase
62
63
  VRBO.configure do |config|
63
64
  config.calendar_id = calendar_id
64
65
  end
65
- cal = VRBO::Calendar.new
66
+ calendar = VRBO::Calendar.new
66
67
  VRBO.reset_config
67
- assert_equal calendar_id, cal.id
68
- assert_equal "http://www.vrbo.com/#{calendar_id}/calendar", cal.calendar_url
68
+ assert_equal calendar_id, calendar.id
69
+ assert_equal "http://www.vrbo.com/#{calendar_id}/calendar", calendar.url
69
70
  end
70
71
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vrbo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley