ratis 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +21 -23
- data/lib/ratis/point_2_point.rb +2 -4
- data/lib/ratis/route.rb +22 -16
- data/lib/ratis/routes.rb +25 -0
- data/lib/ratis/version.rb +1 -1
- data/ratis.gemspec +4 -3
- data/spec/ratis/next_bus_spec.rb +2 -2
- data/spec/ratis/point_2_point_spec.rb +1 -1
- data/spec/ratis/route_spec.rb +8 -59
- data/spec/ratis/routes_spec.rb +54 -0
- data/spec/spec_helper.rb +3 -2
- data/spec/support/vcr_cassettes/Point2Point.yml +27 -27
- metadata +23 -16
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,37 +1,38 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                ratis (3. | 
| 4 | 
            +
                ratis (3.3.0)
         | 
| 5 5 | 
             
                  savon (< 2.0)
         | 
| 6 6 |  | 
| 7 7 | 
             
            GEM
         | 
| 8 8 | 
             
              remote: http://rubygems.org/
         | 
| 9 9 | 
             
              specs:
         | 
| 10 | 
            -
                activesupport (3.2. | 
| 11 | 
            -
                  i18n ( | 
| 10 | 
            +
                activesupport (3.2.13)
         | 
| 11 | 
            +
                  i18n (= 0.6.1)
         | 
| 12 12 | 
             
                  multi_json (~> 1.0)
         | 
| 13 | 
            -
                addressable (2. | 
| 13 | 
            +
                addressable (2.3.5)
         | 
| 14 14 | 
             
                akami (1.2.0)
         | 
| 15 15 | 
             
                  gyoku (>= 0.4.0)
         | 
| 16 16 | 
             
                  nokogiri (>= 1.4.0)
         | 
| 17 | 
            -
                builder (3.2. | 
| 17 | 
            +
                builder (3.2.2)
         | 
| 18 18 | 
             
                chronic (0.9.1)
         | 
| 19 19 | 
             
                columnize (0.3.6)
         | 
| 20 | 
            -
                crack (0. | 
| 21 | 
            -
             | 
| 20 | 
            +
                crack (0.4.0)
         | 
| 21 | 
            +
                  safe_yaml (~> 0.9.0)
         | 
| 22 | 
            +
                diff-lcs (1.2.4)
         | 
| 22 23 | 
             
                gyoku (0.4.6)
         | 
| 23 24 | 
             
                  builder (>= 2.1.2)
         | 
| 24 | 
            -
                hashdiff (0.0. | 
| 25 | 
            +
                hashdiff (0.0.6)
         | 
| 25 26 | 
             
                httpi (1.1.1)
         | 
| 26 27 | 
             
                  rack
         | 
| 27 | 
            -
                i18n (0.6. | 
| 28 | 
            +
                i18n (0.6.1)
         | 
| 28 29 | 
             
                linecache (0.46)
         | 
| 29 30 | 
             
                  rbx-require-relative (> 0.0.4)
         | 
| 30 | 
            -
                multi_json (1. | 
| 31 | 
            -
                nokogiri (1.5. | 
| 31 | 
            +
                multi_json (1.7.7)
         | 
| 32 | 
            +
                nokogiri (1.5.10)
         | 
| 32 33 | 
             
                nori (1.1.5)
         | 
| 33 34 | 
             
                rack (1.5.2)
         | 
| 34 | 
            -
                rake (10.0 | 
| 35 | 
            +
                rake (10.1.0)
         | 
| 35 36 | 
             
                rbx-require-relative (0.0.9)
         | 
| 36 37 | 
             
                redcarpet (2.1.1)
         | 
| 37 38 | 
             
                rspec (2.13.0)
         | 
| @@ -48,6 +49,7 @@ GEM | |
| 48 49 | 
             
                  ruby-debug-base (~> 0.10.4.0)
         | 
| 49 50 | 
             
                ruby-debug-base (0.10.4)
         | 
| 50 51 | 
             
                  linecache (>= 0.3)
         | 
| 52 | 
            +
                safe_yaml (0.9.4)
         | 
| 51 53 | 
             
                savon (1.2.0)
         | 
| 52 54 | 
             
                  akami (~> 1.2.0)
         | 
| 53 55 | 
             
                  builder (>= 2.1.2)
         | 
| @@ -56,34 +58,30 @@ GEM | |
| 56 58 | 
             
                  nokogiri (>= 1.4.0)
         | 
| 57 59 | 
             
                  nori (~> 1.1.0)
         | 
| 58 60 | 
             
                  wasabi (~> 2.5.0)
         | 
| 59 | 
            -
                 | 
| 60 | 
            -
                  multi_json (~> 1.0)
         | 
| 61 | 
            -
                  simplecov-html (~> 0.5.3)
         | 
| 62 | 
            -
                simplecov-html (0.5.3)
         | 
| 63 | 
            -
                vcr (2.4.0)
         | 
| 61 | 
            +
                vcr (2.5.0)
         | 
| 64 62 | 
             
                wasabi (2.5.1)
         | 
| 65 63 | 
             
                  httpi (~> 1.0)
         | 
| 66 64 | 
             
                  nokogiri (>= 1.4.0)
         | 
| 67 | 
            -
                webmock (1. | 
| 65 | 
            +
                webmock (1.13.0)
         | 
| 68 66 | 
             
                  addressable (>= 2.2.7)
         | 
| 69 | 
            -
                  crack (>= 0. | 
| 70 | 
            -
                yard (0.8.2 | 
| 67 | 
            +
                  crack (>= 0.3.2)
         | 
| 68 | 
            +
                yard (0.8.6.2)
         | 
| 71 69 |  | 
| 72 70 | 
             
            PLATFORMS
         | 
| 73 71 | 
             
              ruby
         | 
| 74 72 |  | 
| 75 73 | 
             
            DEPENDENCIES
         | 
| 76 | 
            -
              activesupport
         | 
| 74 | 
            +
              activesupport (< 4.0)
         | 
| 77 75 | 
             
              bundler (>= 1.0.0)
         | 
| 78 76 | 
             
              chronic
         | 
| 79 77 | 
             
              hashdiff
         | 
| 78 | 
            +
              nokogiri (< 1.6.0)
         | 
| 80 79 | 
             
              rake
         | 
| 81 80 | 
             
              ratis!
         | 
| 82 | 
            -
              redcarpet
         | 
| 81 | 
            +
              redcarpet (~> 2.1.1)
         | 
| 83 82 | 
             
              rspec (~> 2.13.0)
         | 
| 84 83 | 
             
              rspec-instafail
         | 
| 85 84 | 
             
              ruby-debug
         | 
| 86 | 
            -
              simplecov
         | 
| 87 85 | 
             
              vcr
         | 
| 88 86 | 
             
              webmock
         | 
| 89 87 | 
             
              yard
         | 
    
        data/lib/ratis/point_2_point.rb
    CHANGED
    
    | @@ -61,8 +61,6 @@ module Ratis | |
| 61 61 | 
             
                end
         | 
| 62 62 |  | 
| 63 63 | 
             
                def self.parse_routes_only_no(response)
         | 
| 64 | 
            -
                  return nil unless response.success?
         | 
| 65 | 
            -
             | 
| 66 64 | 
             
                  atis_schedule = Point2Point::StandardResponse.new
         | 
| 67 65 |  | 
| 68 66 | 
             
                  atis_schedule.groups = response.to_array(:point2point_response, :groups, :group).map do |group|
         | 
| @@ -70,8 +68,8 @@ module Ratis | |
| 70 68 |  | 
| 71 69 | 
             
                    # Point2point 1.3 uses inconsistent tag naming, thus: <onstop> <onwalk...>, but <offstop> <offstopwalk...>
         | 
| 72 70 | 
             
                    # this docs says this is fixed in 1.4, so watch out
         | 
| 73 | 
            -
                    atis_schedule_group.on_stop  = atis_stop_from_hash | 
| 74 | 
            -
                    atis_schedule_group.off_stop = atis_stop_from_hash | 
| 71 | 
            +
                    atis_schedule_group.on_stop  = atis_stop_from_hash('on', group[:onstop])
         | 
| 72 | 
            +
                    atis_schedule_group.off_stop = atis_stop_from_hash('offstop', group[:offstop])
         | 
| 75 73 |  | 
| 76 74 | 
             
                    atis_schedule_group.trips = group.to_array(:trips, :trip).map do |trip|
         | 
| 77 75 | 
             
                      atis_trip          = Point2Point::Trip.new
         | 
    
        data/lib/ratis/route.rb
    CHANGED
    
    | @@ -1,23 +1,7 @@ | |
| 1 1 | 
             
            module Ratis
         | 
| 2 | 
            -
             | 
| 3 2 | 
             
              class Route
         | 
| 4 | 
            -
             | 
| 5 3 | 
             
                attr_accessor :short_name, :directions
         | 
| 6 4 |  | 
| 7 | 
            -
                def self.all
         | 
| 8 | 
            -
                  response = Request.get 'Allroutes'
         | 
| 9 | 
            -
                  return [] unless response.success?
         | 
| 10 | 
            -
             | 
| 11 | 
            -
                  routes = response.to_hash[:allroutes_response][:routes].split(/\n/)
         | 
| 12 | 
            -
                  atis_routes = routes.map do |r|
         | 
| 13 | 
            -
                    r.strip!
         | 
| 14 | 
            -
                    next if r.blank?
         | 
| 15 | 
            -
                    r = r.split(/,/)
         | 
| 16 | 
            -
                    Route.new r[0].strip, r[1..-1].map(&:strip)
         | 
| 17 | 
            -
                  end
         | 
| 18 | 
            -
                  atis_routes.compact
         | 
| 19 | 
            -
                end
         | 
| 20 | 
            -
             | 
| 21 5 | 
             
                def initialize(short_name, directions)
         | 
| 22 6 | 
             
                  self.short_name = short_name
         | 
| 23 7 | 
             
                  self.directions = directions
         | 
| @@ -28,4 +12,26 @@ module Ratis | |
| 28 12 | 
             
                end
         | 
| 29 13 | 
             
              end
         | 
| 30 14 |  | 
| 15 | 
            +
              class Routes
         | 
| 16 | 
            +
                def self.all
         | 
| 17 | 
            +
                  response = Request.get 'Allroutes2'
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  return [] unless response.success?
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                  # {:hexcolor=>"0", :route=>"0", :operator=>"AP", :description=>"0 - route", :publicroute=>"0", :hasrealtime=>"Y", :direction=>"*", :operatorname=>"VEOLIA-PHOENIX", :color=>"#000000"}
         | 
| 22 | 
            +
                  routes = {}
         | 
| 23 | 
            +
                  response.to_hash[:allroutes2_response][:routes][:item].each do |item|
         | 
| 24 | 
            +
                    if routes.has_key? item[:route]
         | 
| 25 | 
            +
                      routes[item[:route]] << item
         | 
| 26 | 
            +
                    else
         | 
| 27 | 
            +
                      routes[item[:route]] = [item]
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                  routes.map do |short_name, _routes|
         | 
| 32 | 
            +
                    directions = _routes.map{|rte| rte[:direction] }.reject{|dir| dir == '*' }
         | 
| 33 | 
            +
                    Route.new(short_name, directions)
         | 
| 34 | 
            +
                  end.compact.sort_by{|rte| rte.short_name }
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
              end
         | 
| 31 37 | 
             
            end
         | 
    
        data/lib/ratis/routes.rb
    ADDED
    
    | @@ -0,0 +1,25 @@ | |
| 1 | 
            +
            module Ratis
         | 
| 2 | 
            +
              class Routes
         | 
| 3 | 
            +
                def self.all
         | 
| 4 | 
            +
                  response = Request.get 'Allroutes2'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                  return [] unless response.success?
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  # {:hexcolor=>"0", :route=>"0", :operator=>"AP", :description=>"0 - route", :publicroute=>"0", :hasrealtime=>"Y", :direction=>"*", :operatorname=>"VEOLIA-PHOENIX", :color=>"#000000"}
         | 
| 9 | 
            +
                  routes = {}
         | 
| 10 | 
            +
                  response.to_hash[:allroutes2_response][:routes][:item].each do |item|
         | 
| 11 | 
            +
                    if routes.has_key? item[:route]
         | 
| 12 | 
            +
                      routes[item[:route]] << item
         | 
| 13 | 
            +
                    else
         | 
| 14 | 
            +
                      routes[item[:route]] = [item]
         | 
| 15 | 
            +
                    end
         | 
| 16 | 
            +
                  end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                  routes.map do |short_name, _routes|
         | 
| 19 | 
            +
                    directions = _routes.map{|rte| rte[:direction] }.reject{|dir| dir == '*' }
         | 
| 20 | 
            +
                    Route.new(short_name, directions)
         | 
| 21 | 
            +
                  end.compact.sort_by{|rte| rte.short_name }
         | 
| 22 | 
            +
                end
         | 
| 23 | 
            +
              end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
            end
         | 
    
        data/lib/ratis/version.rb
    CHANGED
    
    
    
        data/ratis.gemspec
    CHANGED
    
    | @@ -16,16 +16,17 @@ Gem::Specification.new do |s| | |
| 16 16 |  | 
| 17 17 | 
             
              s.add_dependency 'savon', '<2.0'
         | 
| 18 18 |  | 
| 19 | 
            -
              s.add_development_dependency 'activesupport'
         | 
| 19 | 
            +
              s.add_development_dependency 'activesupport', '< 4.0'
         | 
| 20 20 | 
             
              s.add_development_dependency 'bundler', '>= 1.0.0'
         | 
| 21 21 | 
             
              s.add_development_dependency 'chronic'
         | 
| 22 22 | 
             
              s.add_development_dependency 'hashdiff'
         | 
| 23 23 | 
             
              s.add_development_dependency 'rake'
         | 
| 24 | 
            -
              s.add_development_dependency 'redcarpet'
         | 
| 24 | 
            +
              s.add_development_dependency 'redcarpet', '~> 2.1.1'
         | 
| 25 25 | 
             
              s.add_development_dependency 'rspec', '~> 2.13.0'
         | 
| 26 26 | 
             
              s.add_development_dependency 'rspec-instafail'
         | 
| 27 27 | 
             
              s.add_development_dependency 'ruby-debug'
         | 
| 28 | 
            -
              s.add_development_dependency ' | 
| 28 | 
            +
              s.add_development_dependency 'nokogiri', '< 1.6.0'
         | 
| 29 | 
            +
              # s.add_development_dependency 'simplecov'
         | 
| 29 30 | 
             
              s.add_development_dependency 'vcr'
         | 
| 30 31 | 
             
              s.add_development_dependency 'webmock'
         | 
| 31 32 | 
             
              s.add_development_dependency 'yard'
         | 
    
        data/spec/ratis/next_bus_spec.rb
    CHANGED
    
    | @@ -188,7 +188,7 @@ describe Ratis::NextBus do | |
| 188 188 | 
             
                    expect(service.direction).to eq('W')
         | 
| 189 189 | 
             
                    expect(service.servicetype).to eq('W')
         | 
| 190 190 | 
             
                    expect(service.route).to eq('108')
         | 
| 191 | 
            -
                    expect(service.operator).to eq(' | 
| 191 | 
            +
                    expect(service.operator).to eq('FTE')
         | 
| 192 192 |  | 
| 193 193 | 
             
                    service = response.services.last
         | 
| 194 194 | 
             
                    expect(service).to be_a(OpenStruct)
         | 
| @@ -200,7 +200,7 @@ describe Ratis::NextBus do | |
| 200 200 | 
             
                    expect(service.direction).to eq('W')
         | 
| 201 201 | 
             
                    expect(service.servicetype).to eq('W')
         | 
| 202 202 | 
             
                    expect(service.route).to eq('108')
         | 
| 203 | 
            -
                    expect(service.operator).to eq(' | 
| 203 | 
            +
                    expect(service.operator).to eq('FTE')
         | 
| 204 204 | 
             
                  end
         | 
| 205 205 |  | 
| 206 206 | 
             
                  it "should raise error if datetime condition is not a DateTime or Time" do
         | 
| @@ -126,7 +126,7 @@ describe Ratis::Point2Point do | |
| 126 126 |  | 
| 127 127 | 
             
                  it 'gets the trips within each group' do
         | 
| 128 128 | 
             
                    schedule = Ratis::Point2Point.where(@conditions.dup)
         | 
| 129 | 
            -
                    schedule.groups[0].should have( | 
| 129 | 
            +
                    schedule.groups[0].should have(18).trips
         | 
| 130 130 | 
             
                    schedule.groups[1].should have(16).trips
         | 
| 131 131 | 
             
                    schedule.groups[2].should have(4).trips
         | 
| 132 132 | 
             
                  end
         | 
    
        data/spec/ratis/route_spec.rb
    CHANGED
    
    | @@ -4,72 +4,21 @@ describe Ratis::Route do | |
| 4 4 | 
             
              before do
         | 
| 5 5 | 
             
                Ratis.reset
         | 
| 6 6 | 
             
                Ratis.configure do |config|
         | 
| 7 | 
            -
                  config.endpoint | 
| 8 | 
            -
                  config.namespace | 
| 7 | 
            +
                  config.endpoint   = 'http://soap.valleymetro.org/cgi-bin-soap-web-262/soap.cgi'
         | 
| 8 | 
            +
                  config.namespace  = 'PX_WEB'
         | 
| 9 9 | 
             
                end
         | 
| 10 10 | 
             
              end
         | 
| 11 11 |  | 
| 12 | 
            -
              describe '#all' do
         | 
| 13 12 |  | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
                      0, N, S
         | 
| 18 | 
            -
                      1, E, W
         | 
| 19 | 
            -
                    </Routes>
         | 
| 20 | 
            -
                  BODY
         | 
| 21 | 
            -
             | 
| 22 | 
            -
                  @all_routes = Ratis::Route.all
         | 
| 23 | 
            -
                end
         | 
| 24 | 
            -
             | 
| 25 | 
            -
                it 'only makes one request' do
         | 
| 26 | 
            -
                  an_atis_request.should have_been_made.times 1
         | 
| 13 | 
            +
              describe '#initialize' do
         | 
| 14 | 
            +
                it "description" do
         | 
| 15 | 
            +
                  pending
         | 
| 27 16 | 
             
                end
         | 
| 28 | 
            -
             | 
| 29 | 
            -
                it 'gets all routes' do
         | 
| 30 | 
            -
                  @all_routes.should have(2).items
         | 
| 31 | 
            -
                end
         | 
| 32 | 
            -
             | 
| 33 | 
            -
                it 'gets all route directions' do
         | 
| 34 | 
            -
                  @all_routes.each do |route|
         | 
| 35 | 
            -
                    route.should have(2).directions
         | 
| 36 | 
            -
                  end
         | 
| 37 | 
            -
                end
         | 
| 38 | 
            -
             | 
| 39 17 | 
             
              end
         | 
| 40 18 |  | 
| 41 19 | 
             
              describe '#timetable' do
         | 
| 42 | 
            -
             | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 45 | 
            -
                before do
         | 
| 46 | 
            -
                  resp = atis_response_timetable({ :route => '0', :direction => 'N', :service_type => 'W', :operator => 'OP', :effective => '01/15/12' })
         | 
| 47 | 
            -
                  stub_atis_request.to_return( atis_response 'Timetable', '1.1', '0', resp)
         | 
| 48 | 
            -
             | 
| 49 | 
            -
                  @timetable = route.timetable :direction => 'N', :service_type => 'W'
         | 
| 20 | 
            +
                it "description" do
         | 
| 21 | 
            +
                  pending
         | 
| 50 22 | 
             
                end
         | 
| 51 | 
            -
             | 
| 52 | 
            -
                it 'only makes one request' do
         | 
| 53 | 
            -
                  an_atis_request.should have_been_made.times 1
         | 
| 54 | 
            -
                end
         | 
| 55 | 
            -
             | 
| 56 | 
            -
                it 'assigns settings correctly' do
         | 
| 57 | 
            -
                  @timetable.should_not be_nil
         | 
| 58 | 
            -
             | 
| 59 | 
            -
                  @timetable.route_short_name.should eql '0'
         | 
| 60 | 
            -
                  @timetable.direction.should eql 'N'
         | 
| 61 | 
            -
                  @timetable.service_type.should eql 'W'
         | 
| 62 | 
            -
                  @timetable.operator.should eql 'OP'
         | 
| 63 | 
            -
                  @timetable.effective.should eql '01/15/12'
         | 
| 64 | 
            -
                end
         | 
| 65 | 
            -
             | 
| 66 23 | 
             
              end
         | 
| 67 | 
            -
             | 
| 68 | 
            -
              it 'should initialize' do
         | 
| 69 | 
            -
                route = Ratis::Route.new '123', ['N', 'S']
         | 
| 70 | 
            -
             | 
| 71 | 
            -
                route.short_name.should eql '123'
         | 
| 72 | 
            -
                route.directions.should eql ['N', 'S']
         | 
| 73 | 
            -
              end
         | 
| 74 | 
            -
             | 
| 75 | 
            -
            end
         | 
| 24 | 
            +
            end
         | 
| @@ -0,0 +1,54 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe Ratis::Routes do
         | 
| 4 | 
            +
              before do
         | 
| 5 | 
            +
                Ratis.reset
         | 
| 6 | 
            +
                Ratis.configure do |config|
         | 
| 7 | 
            +
                  config.endpoint   = 'http://soap.valleymetro.org/cgi-bin-soap-web-262/soap.cgi'
         | 
| 8 | 
            +
                  config.namespace  = 'PX_WEB'
         | 
| 9 | 
            +
                end
         | 
| 10 | 
            +
              end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              let(:empty_body){ {:allroutes2_response => {:routes => []}} }
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              describe '#all' do
         | 
| 15 | 
            +
                it 'returns all routes' do
         | 
| 16 | 
            +
                  response = Ratis::Routes.all
         | 
| 17 | 
            +
                  expect(response).to have(111).items
         | 
| 18 | 
            +
                  expect(response.all?{|rte| rte.is_a?(Ratis::Route) }).to be_true
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                it 'only makes one request' do
         | 
| 22 | 
            +
                  Ratis::Request.should_receive(:get).once.and_call_original
         | 
| 23 | 
            +
                  Ratis::Routes.all
         | 
| 24 | 
            +
                end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                it 'requests the correct SOAP action' do
         | 
| 27 | 
            +
                  Ratis::Request.should_receive(:get) do |action, options|
         | 
| 28 | 
            +
                                   action.should eq('Allroutes2')
         | 
| 29 | 
            +
                                 end.and_return(double('response', :success? => false, :body => empty_body)) # false only to stop further running
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                  Ratis::Routes.all
         | 
| 32 | 
            +
                end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                it 'should set directions and short_name to variables' do
         | 
| 35 | 
            +
                  response = Ratis::Routes.all
         | 
| 36 | 
            +
                  route    = response.first
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                  expect(response).to be_a(Array)
         | 
| 39 | 
            +
                  expect(route).to be_a(Ratis::Route)
         | 
| 40 | 
            +
                  expect(route.short_name).to eq('0')
         | 
| 41 | 
            +
                  expect(route.directions).to have(2).directions
         | 
| 42 | 
            +
                  expect(route.directions).to include('N')
         | 
| 43 | 
            +
                  expect(route.directions).to include('S')
         | 
| 44 | 
            +
                end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
              describe '#timetable' do
         | 
| 49 | 
            +
                it "description" do
         | 
| 50 | 
            +
                  pending
         | 
| 51 | 
            +
                end
         | 
| 52 | 
            +
              end
         | 
| 53 | 
            +
             | 
| 54 | 
            +
            end
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -1,5 +1,5 @@ | |
| 1 | 
            -
            require 'simplecov'
         | 
| 2 | 
            -
            SimpleCov.start
         | 
| 1 | 
            +
            # require 'simplecov'
         | 
| 2 | 
            +
            # SimpleCov.start
         | 
| 3 3 |  | 
| 4 4 | 
             
            project_root = File.expand_path(File.dirname(__FILE__) + "/..")
         | 
| 5 5 | 
             
            $LOAD_PATH << "#{project_root}/lib"
         | 
| @@ -12,6 +12,7 @@ require 'ratis' | |
| 12 12 | 
             
            require 'vcr'
         | 
| 13 13 | 
             
            require 'chronic'
         | 
| 14 14 |  | 
| 15 | 
            +
            # Dir[("#{project_root}/lib/ratis/**/*.rb")].each { |f| require f }
         | 
| 15 16 | 
             
            Dir[("#{project_root}/spec/support/**/*.rb")].each { |f| require f }
         | 
| 16 17 |  | 
| 17 18 | 
             
            RSpec.configure do |config|
         | 
| @@ -1,4 +1,5 @@ | |
| 1 1 | 
             
            --- 
         | 
| 2 | 
            +
            recorded_with: VCR 2.5.0
         | 
| 2 3 | 
             
            http_interactions: 
         | 
| 3 4 | 
             
            - request: 
         | 
| 4 5 | 
             
                method: post
         | 
| @@ -20,12 +21,12 @@ http_interactions: | |
| 20 21 | 
             
                    aW50MnBvaW50PjwvZW52OkJvZHk+PC9lbnY6RW52ZWxvcGU+
         | 
| 21 22 |  | 
| 22 23 | 
             
                headers: 
         | 
| 23 | 
            -
                  Content-Type: 
         | 
| 24 | 
            -
                  - text/xml;charset=UTF-8
         | 
| 25 | 
            -
                  Content-Length: 
         | 
| 26 | 
            -
                  - "576"
         | 
| 27 24 | 
             
                  Soapaction: 
         | 
| 28 25 | 
             
                  - "\"PX_WEB#Point2point\""
         | 
| 26 | 
            +
                  Content-Length: 
         | 
| 27 | 
            +
                  - "576"
         | 
| 28 | 
            +
                  Content-Type: 
         | 
| 29 | 
            +
                  - text/xml;charset=UTF-8
         | 
| 29 30 | 
             
                  Accept: 
         | 
| 30 31 | 
             
                  - "*/*"
         | 
| 31 32 | 
             
              response: 
         | 
| @@ -35,12 +36,12 @@ http_interactions: | |
| 35 36 | 
             
                headers: 
         | 
| 36 37 | 
             
                  Content-Length: 
         | 
| 37 38 | 
             
                  - "0"
         | 
| 38 | 
            -
                  Location: 
         | 
| 39 | 
            -
                  - http://www.iana.org/domains/example/
         | 
| 40 39 | 
             
                  Connection: 
         | 
| 41 40 | 
             
                  - Keep-Alive
         | 
| 42 41 | 
             
                  Server: 
         | 
| 43 42 | 
             
                  - BigIP
         | 
| 43 | 
            +
                  Location: 
         | 
| 44 | 
            +
                  - http://www.iana.org/domains/example/
         | 
| 44 45 | 
             
                body: 
         | 
| 45 46 | 
             
                  base64_string: ""
         | 
| 46 47 | 
             
                http_version: 
         | 
| @@ -51,26 +52,26 @@ http_interactions: | |
| 51 52 | 
             
                body: 
         | 
| 52 53 | 
             
                  base64_string: |
         | 
| 53 54 | 
             
                    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48ZW52OkVu
         | 
| 54 | 
            -
                     | 
| 55 | 
            -
                     | 
| 56 | 
            -
                     | 
| 57 | 
            -
                     | 
| 58 | 
            -
                     | 
| 59 | 
            -
                     | 
| 60 | 
            -
                     | 
| 61 | 
            -
                     | 
| 62 | 
            -
                     | 
| 63 | 
            -
                     | 
| 64 | 
            -
                     | 
| 55 | 
            +
                    dmVsb3BlIHhtbG5zOndzZGw9IlBYX1dFQiIgeG1sbnM6ZW52PSJodHRwOi8v
         | 
| 56 | 
            +
                    c2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VudmVsb3BlLyIgeG1sbnM6eHNk
         | 
| 57 | 
            +
                    PSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNp
         | 
| 58 | 
            +
                    PSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSI+
         | 
| 59 | 
            +
                    PGVudjpCb2R5PjxQb2ludDJwb2ludCB4bWxucz0iUFhfV0VCIj48T3JpZ2lu
         | 
| 60 | 
            +
                    bGF0PjMzLjQ0NjkzMTwvT3JpZ2lubGF0PjxEZXN0aW5hdGlvbmxhdD4zMy40
         | 
| 61 | 
            +
                    NDcwOTg8L0Rlc3RpbmF0aW9ubGF0PjxSb3V0ZXNvbmx5Plk8L1JvdXRlc29u
         | 
| 62 | 
            +
                    bHk+PFN0YXJ0dGltZT4xNzAwPC9TdGFydHRpbWU+PE9yaWdpbmxvbmc+LTEx
         | 
| 63 | 
            +
                    Mi4wOTc5MDM8L09yaWdpbmxvbmc+PERlc3RpbmF0aW9ubG9uZz4tMTEyLjA3
         | 
| 64 | 
            +
                    NzIxMzwvRGVzdGluYXRpb25sb25nPjxEYXRlPjA3LzE1LzIwMTM8L0RhdGU+
         | 
| 65 | 
            +
                    PEVuZHRpbWU+MTgwMDwvRW5kdGltZT48Um91dGVzPjE8L1JvdXRlcz48L1Bv
         | 
| 65 66 | 
             
                    aW50MnBvaW50PjwvZW52OkJvZHk+PC9lbnY6RW52ZWxvcGU+
         | 
| 66 67 |  | 
| 67 68 | 
             
                headers: 
         | 
| 68 | 
            -
                  Content-Type: 
         | 
| 69 | 
            -
                  - text/xml;charset=UTF-8
         | 
| 70 69 | 
             
                  Soapaction: 
         | 
| 71 70 | 
             
                  - "\"PX_WEB#Point2point\""
         | 
| 72 71 | 
             
                  Content-Length: 
         | 
| 73 72 | 
             
                  - "576"
         | 
| 73 | 
            +
                  Content-Type: 
         | 
| 74 | 
            +
                  - text/xml;charset=UTF-8
         | 
| 74 75 | 
             
                  Accept: 
         | 
| 75 76 | 
             
                  - "*/*"
         | 
| 76 77 | 
             
              response: 
         | 
| @@ -78,18 +79,18 @@ http_interactions: | |
| 78 79 | 
             
                  code: 200
         | 
| 79 80 | 
             
                  message: OK
         | 
| 80 81 | 
             
                headers: 
         | 
| 81 | 
            -
                   | 
| 82 | 
            -
                  -  | 
| 83 | 
            -
                  Date: 
         | 
| 84 | 
            -
                  - Fri, 14 Jun 2013 17:03:34 GMT
         | 
| 82 | 
            +
                  Soapserver: 
         | 
| 83 | 
            +
                  - SOAP::Lite/Perl/0.55
         | 
| 85 84 | 
             
                  Content-Length: 
         | 
| 86 85 | 
             
                  - "4558"
         | 
| 87 86 | 
             
                  Connection: 
         | 
| 88 87 | 
             
                  - close
         | 
| 88 | 
            +
                  Content-Type: 
         | 
| 89 | 
            +
                  - text/xml; charset=utf-8
         | 
| 90 | 
            +
                  Date: 
         | 
| 91 | 
            +
                  - Fri, 12 Jul 2013 00:35:04 GMT
         | 
| 89 92 | 
             
                  Server: 
         | 
| 90 93 | 
             
                  - Apache/2.2.3 (CentOS)
         | 
| 91 | 
            -
                  Soapserver: 
         | 
| 92 | 
            -
                  - SOAP::Lite/Perl/0.55
         | 
| 93 94 | 
             
                body: 
         | 
| 94 95 | 
             
                  base64_string: |
         | 
| 95 96 | 
             
                    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48U09BUC1F
         | 
| @@ -196,5 +197,4 @@ http_interactions: | |
| 196 197 | 
             
                    RU5WOkVudmVsb3BlPg==
         | 
| 197 198 |  | 
| 198 199 | 
             
                http_version: 
         | 
| 199 | 
            -
              recorded_at: Fri,  | 
| 200 | 
            -
            recorded_with: VCR 2.4.0
         | 
| 200 | 
            +
              recorded_at: Fri, 12 Jul 2013 00:35:04 GMT
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: ratis
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 11
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 3
         | 
| 8 | 
            -
              -  | 
| 9 | 
            -
              -  | 
| 10 | 
            -
              version: 3. | 
| 8 | 
            +
              - 3
         | 
| 9 | 
            +
              - 0
         | 
| 10 | 
            +
              version: 3.3.0
         | 
| 11 11 | 
             
            platform: ruby
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Burst Software
         | 
| @@ -15,7 +15,7 @@ autorequire: | |
| 15 15 | 
             
            bindir: bin
         | 
| 16 16 | 
             
            cert_chain: []
         | 
| 17 17 |  | 
| 18 | 
            -
            date: 2013- | 
| 18 | 
            +
            date: 2013-07-12 00:00:00 Z
         | 
| 19 19 | 
             
            dependencies: 
         | 
| 20 20 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 21 21 | 
             
              name: savon
         | 
| @@ -38,12 +38,13 @@ dependencies: | |
| 38 38 | 
             
              requirement: &id002 !ruby/object:Gem::Requirement 
         | 
| 39 39 | 
             
                none: false
         | 
| 40 40 | 
             
                requirements: 
         | 
| 41 | 
            -
                - -  | 
| 41 | 
            +
                - - <
         | 
| 42 42 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 43 | 
            -
                    hash:  | 
| 43 | 
            +
                    hash: 27
         | 
| 44 44 | 
             
                    segments: 
         | 
| 45 | 
            +
                    - 4
         | 
| 45 46 | 
             
                    - 0
         | 
| 46 | 
            -
                    version: "0"
         | 
| 47 | 
            +
                    version: "4.0"
         | 
| 47 48 | 
             
              type: :development
         | 
| 48 49 | 
             
              version_requirements: *id002
         | 
| 49 50 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -110,12 +111,14 @@ dependencies: | |
| 110 111 | 
             
              requirement: &id007 !ruby/object:Gem::Requirement 
         | 
| 111 112 | 
             
                none: false
         | 
| 112 113 | 
             
                requirements: 
         | 
| 113 | 
            -
                - -  | 
| 114 | 
            +
                - - ~>
         | 
| 114 115 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 115 | 
            -
                    hash:  | 
| 116 | 
            +
                    hash: 9
         | 
| 116 117 | 
             
                    segments: 
         | 
| 117 | 
            -
                    -  | 
| 118 | 
            -
                     | 
| 118 | 
            +
                    - 2
         | 
| 119 | 
            +
                    - 1
         | 
| 120 | 
            +
                    - 1
         | 
| 121 | 
            +
                    version: 2.1.1
         | 
| 119 122 | 
             
              type: :development
         | 
| 120 123 | 
             
              version_requirements: *id007
         | 
| 121 124 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -163,17 +166,19 @@ dependencies: | |
| 163 166 | 
             
              type: :development
         | 
| 164 167 | 
             
              version_requirements: *id010
         | 
| 165 168 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 166 | 
            -
              name:  | 
| 169 | 
            +
              name: nokogiri
         | 
| 167 170 | 
             
              prerelease: false
         | 
| 168 171 | 
             
              requirement: &id011 !ruby/object:Gem::Requirement 
         | 
| 169 172 | 
             
                none: false
         | 
| 170 173 | 
             
                requirements: 
         | 
| 171 | 
            -
                - -  | 
| 174 | 
            +
                - - <
         | 
| 172 175 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 173 | 
            -
                    hash:  | 
| 176 | 
            +
                    hash: 15
         | 
| 174 177 | 
             
                    segments: 
         | 
| 178 | 
            +
                    - 1
         | 
| 179 | 
            +
                    - 6
         | 
| 175 180 | 
             
                    - 0
         | 
| 176 | 
            -
                    version:  | 
| 181 | 
            +
                    version: 1.6.0
         | 
| 177 182 | 
             
              type: :development
         | 
| 178 183 | 
             
              version_requirements: *id011
         | 
| 179 184 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -263,6 +268,7 @@ files: | |
| 263 268 | 
             
            - lib/ratis/route_pattern/stop.rb
         | 
| 264 269 | 
             
            - lib/ratis/route_stops.rb
         | 
| 265 270 | 
             
            - lib/ratis/route_stops/stop.rb
         | 
| 271 | 
            +
            - lib/ratis/routes.rb
         | 
| 266 272 | 
             
            - lib/ratis/schedule_nearby.rb
         | 
| 267 273 | 
             
            - lib/ratis/stop.rb
         | 
| 268 274 | 
             
            - lib/ratis/timetable.rb
         | 
| @@ -287,6 +293,7 @@ files: | |
| 287 293 | 
             
            - spec/ratis/route_pattern_spec.rb
         | 
| 288 294 | 
             
            - spec/ratis/route_spec.rb
         | 
| 289 295 | 
             
            - spec/ratis/route_stops_spec.rb
         | 
| 296 | 
            +
            - spec/ratis/routes_spec.rb
         | 
| 290 297 | 
             
            - spec/ratis/schedule_nearby_spec.rb
         | 
| 291 298 | 
             
            - spec/ratis/timetable_spec.rb
         | 
| 292 299 | 
             
            - spec/ratis/walk_spec.rb
         |