pla 0.3.0 → 0.4.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.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/lib/pla.rb +10 -2
- data/lib/pla/in_port.rb +7 -0
- data/pla.gemspec +1 -1
- metadata +2 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 9b563329bb284dc1d88d82963b5ee5312208daa4
         | 
| 4 | 
            +
              data.tar.gz: d743f239e67902f784d91b5f051fed534b47531a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 784ad73ef881942547a48d4ef0400149be5b39ad9f9f893744fde462d6eb856cbf8e60a3eece3329572f8ddd221d7f9dceb6b995eed6e21762b04d3feb3e0f79
         | 
| 7 | 
            +
              data.tar.gz: 255e5bd0b487f5a9916cd4758fd540d9d8a59cd5baeec7c36d9e8c2089664c136a1009c83e61cec80f9369e7428c4936521f86477079c9d24cd95aff45d5785f
         | 
    
        data/README.md
    CHANGED
    
    | @@ -25,14 +25,12 @@ require 'pla' | |
| 25 25 |  | 
| 26 26 | 
             
            arrivals = PLA.arrivals
         | 
| 27 27 | 
             
            departures = PLA.departures
         | 
| 28 | 
            -
             | 
| 29 | 
            -
            # Note: all is an amalgam of arrivals and departures.
         | 
| 30 | 
            -
            # the 'movements' on the PLA website is incomplete; it just
         | 
| 31 | 
            -
            # shows movements within the port
         | 
| 28 | 
            +
            in_port = PLA.in-port
         | 
| 32 29 | 
             
            all = PLA.all
         | 
| 33 30 |  | 
| 34 31 | 
             
            puts arrivals
         | 
| 35 32 | 
             
            puts departures
         | 
| 33 | 
            +
            puts in_port
         | 
| 36 34 | 
             
            puts all
         | 
| 37 35 |  | 
| 38 36 | 
             
            # Find next ten boats set to arrive
         | 
| @@ -46,6 +44,9 @@ puts PLA.find_all_by_country 'Panama' | |
| 46 44 |  | 
| 47 45 | 
             
            # Find all movements by a particular vessel
         | 
| 48 46 | 
             
            puts PLA.find_all_by_vessel_name 'feo swan'
         | 
| 47 | 
            +
             | 
| 48 | 
            +
            # Listing the movements of a vessel by time
         | 
| 49 | 
            +
            puts PLA.find_all_by_vessel_name('balmoral').sort_by{|s| s[:timestamp]}
         | 
| 49 50 | 
             
            ```
         | 
| 50 51 |  | 
| 51 52 | 
             
            Licence
         | 
    
        data/lib/pla.rb
    CHANGED
    
    | @@ -1,5 +1,6 @@ | |
| 1 1 | 
             
            require 'pla/arrivals'
         | 
| 2 2 | 
             
            require 'pla/departures'
         | 
| 3 | 
            +
            require 'pla/in_port'
         | 
| 3 4 |  | 
| 4 5 | 
             
            class PLA
         | 
| 5 6 | 
             
              def self.arrivals
         | 
| @@ -10,9 +11,16 @@ class PLA | |
| 10 11 | 
             
                PLA::Departures.new.records
         | 
| 11 12 | 
             
              end
         | 
| 12 13 |  | 
| 14 | 
            +
              def self.in_port
         | 
| 15 | 
            +
                PLA::InPort.new.records
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
             | 
| 13 18 | 
             
              def self.all
         | 
| 14 | 
            -
                [ | 
| 15 | 
            -
             | 
| 19 | 
            +
                [
         | 
| 20 | 
            +
                  self.arrivals,
         | 
| 21 | 
            +
                  self.departures,
         | 
| 22 | 
            +
                  self.in_port
         | 
| 23 | 
            +
                ].flatten.uniq
         | 
| 16 24 | 
             
              end
         | 
| 17 25 |  | 
| 18 26 | 
             
              def self.find movement_type, field, key
         | 
    
        data/lib/pla/in_port.rb
    ADDED
    
    
    
        data/pla.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: pla
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.4.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - jspc
         | 
| @@ -99,6 +99,7 @@ files: | |
| 99 99 | 
             
            - lib/pla.rb
         | 
| 100 100 | 
             
            - lib/pla/arrivals.rb
         | 
| 101 101 | 
             
            - lib/pla/departures.rb
         | 
| 102 | 
            +
            - lib/pla/in_port.rb
         | 
| 102 103 | 
             
            - lib/pla/movement.rb
         | 
| 103 104 | 
             
            - lib/pla/movements.rb
         | 
| 104 105 | 
             
            - lib/pla/vessel.rb
         |