usno-imagery 0.1.2 → 0.1.3
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/.travis.yml +13 -0
 - data/README.md +48 -2
 - data/lib/usno/imagery.rb +41 -0
 - data/lib/usno/imagery/callisto.rb +6 -0
 - data/lib/usno/imagery/europa.rb +6 -0
 - data/lib/usno/imagery/ganymede.rb +6 -0
 - data/lib/usno/imagery/io.rb +6 -0
 - data/lib/usno/imagery/jupiter.rb +6 -0
 - data/lib/usno/imagery/mars.rb +6 -0
 - data/lib/usno/imagery/mercury.rb +6 -0
 - data/lib/usno/imagery/moon.rb +6 -0
 - data/lib/usno/imagery/venus.rb +13 -0
 - data/lib/usno/imagery/version.rb +1 -1
 - data/samples/rise +0 -0
 - data/test/test_helper.rb +2 -4
 - data/test/unit/usno/imagery/callisto_test.rb +32 -0
 - data/test/unit/usno/imagery/europa_test.rb +32 -0
 - data/test/unit/usno/imagery/ganymede_test.rb +32 -0
 - data/test/unit/usno/imagery/io_test.rb +32 -0
 - data/test/unit/usno/imagery/jupiter_test.rb +32 -0
 - data/test/unit/usno/imagery/mars_test.rb +32 -0
 - data/test/unit/usno/imagery/mercury_test.rb +32 -0
 - data/test/unit/usno/imagery/moon_test.rb +33 -0
 - data/test/unit/usno/imagery/venus_test.rb +41 -0
 - metadata +30 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 2f654cefba23e4a353a4c83f41334f0e0e59ed4c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 18e3bc626eb939f31c4533b74f119825d7d80a89
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 41617555b39d85c5cea44a75db1d6b10ef922c2d060ba81344b332e9d3c0240711df8d15934282161112372ed4cfb66b6e44c3027204a05a51514f653ddcfa43
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 968a73b0db6d2df7b7bfa87dfa2bb6f9e9fecd23ed0ca7169450b8acca9a9d239474a05fc25e4a1255dbd7c3a8f5a784a0cddfa17023acf5ddb59eb772b61b04
         
     | 
    
        data/.travis.yml
    ADDED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,6 +1,8 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # USNO::Imagery [](https://codeclimate.com/github/rthbound/usno-imagery)
         
     | 
| 
      
 1 
     | 
    
         
            +
            # USNO::Imagery [](https://codeclimate.com/github/rthbound/usno-imagery)[](https://coveralls.io/r/rthbound/usno-imagery?branch=master)[](https://travis-ci.org/rthbound/usno-imagery)
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            Builds URLs for consuming USNO's imagery data services
         
     | 
| 
      
 3 
     | 
    
         
            +
            Builds URLs for consuming USNO's imagery data services. Example:
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            
         
     | 
| 
       4 
6 
     | 
    
         | 
| 
       5 
7 
     | 
    
         
             
            ## Installation
         
     | 
| 
       6 
8 
     | 
    
         | 
| 
         @@ -44,6 +46,50 @@ USNO::Imagery::Earth::Set.new.call.data 
     | 
|
| 
       44 
46 
     | 
    
         
             
              #=> "http://api.usno.navy.mil/imagery/earth.png?view=set"
         
     | 
| 
       45 
47 
     | 
    
         
             
            ```
         
     | 
| 
       46 
48 
     | 
    
         | 
| 
      
 49 
     | 
    
         
            +
            #### Other USNO::Imagery libraries
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 52 
     | 
    
         
            +
            # For an image of our Moon at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 53 
     | 
    
         
            +
            USNO::Imagery::Moon.new(time: Time.now).call.data
         
     | 
| 
      
 54 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/moon.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
            # For an image of Mercury at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 57 
     | 
    
         
            +
            USNO::Imagery::Mercury.new(time: Time.now).call.data
         
     | 
| 
      
 58 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/mercury.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            # For an image of Venus at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 61 
     | 
    
         
            +
            USNO::Imagery::Venus.new(time: Time.now).call.data
         
     | 
| 
      
 62 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/venus.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
            # For a radar image of Venus at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 65 
     | 
    
         
            +
            USNO::Imagery::Venus.new(time: Time.now, radar: true).call.data
         
     | 
| 
      
 66 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/venus-radar.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
            # For an image of Mars at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 69 
     | 
    
         
            +
            USNO::Imagery::Mars.new(time: Time.now).call.data
         
     | 
| 
      
 70 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/mars.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
            # For an image of Jupiter at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 73 
     | 
    
         
            +
            USNO::Imagery::Jupiter.new(time: Time.now).call.data
         
     | 
| 
      
 74 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/jupiter.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
            # For an image of Jupiter's moon Io at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 77 
     | 
    
         
            +
            USNO::Imagery::Io.new(time: Time.now).call.data
         
     | 
| 
      
 78 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/io.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
            # For an image of Jupiter's moon Europa at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 81 
     | 
    
         
            +
            USNO::Imagery::Europa.new(time: Time.now).call.data
         
     | 
| 
      
 82 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/europa.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
            # For an image of Jupiter's moon Ganymede at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 85 
     | 
    
         
            +
            USNO::Imagery::Ganymede.new(time: Time.now).call.data
         
     | 
| 
      
 86 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/ganymede.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
            # For an image of Jupiter's moon Callisto at any time between 1700 & 2100 A.D.
         
     | 
| 
      
 89 
     | 
    
         
            +
            USNO::Imagery::Callisto.new(time: Time.now).call.data
         
     | 
| 
      
 90 
     | 
    
         
            +
              #=> "http://api.usno.navy.mil/imagery/callisto.png?date=11/17/2013&time=1:13"
         
     | 
| 
      
 91 
     | 
    
         
            +
            ```
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
       47 
93 
     | 
    
         
             
            ## Contributing
         
     | 
| 
       48 
94 
     | 
    
         | 
| 
       49 
95 
     | 
    
         
             
            1. Fork it
         
     | 
    
        data/lib/usno/imagery.rb
    CHANGED
    
    | 
         @@ -14,5 +14,46 @@ module USNO 
     | 
|
| 
       14 
14 
     | 
    
         
             
              module Imagery
         
     | 
| 
       15 
15 
     | 
    
         
             
                module Earth
         
     | 
| 
       16 
16 
     | 
    
         
             
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                class View < PayDirt::Base
         
     | 
| 
      
 19 
     | 
    
         
            +
                  def initialize(options = {})
         
     | 
| 
      
 20 
     | 
    
         
            +
                    options = {
         
     | 
| 
      
 21 
     | 
    
         
            +
                      time:     Time.now,
         
     | 
| 
      
 22 
     | 
    
         
            +
                      root_url: "http://api.usno.navy.mil/",
         
     | 
| 
      
 23 
     | 
    
         
            +
                      resource: self.class.name.downcase.split("::")[1..-1].join("/") + ".png"
         
     | 
| 
      
 24 
     | 
    
         
            +
                    }.merge(options)
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                    # sets instance variables from key value pairs,
         
     | 
| 
      
 27 
     | 
    
         
            +
                    # will fail if any keys given before options aren't in options
         
     | 
| 
      
 28 
     | 
    
         
            +
                    load_options(:time, :root_url, :resource, options)
         
     | 
| 
      
 29 
     | 
    
         
            +
                  end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                  def call
         
     | 
| 
      
 32 
     | 
    
         
            +
                    result(true, query_for(@root_url + @resource))
         
     | 
| 
      
 33 
     | 
    
         
            +
                  end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                  private
         
     | 
| 
      
 36 
     | 
    
         
            +
                  def query_for(resource)
         
     | 
| 
      
 37 
     | 
    
         
            +
                    "#{resource}?#{time}"
         
     | 
| 
      
 38 
     | 
    
         
            +
                  end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                  def date
         
     | 
| 
      
 41 
     | 
    
         
            +
                    @time.utc.strftime("%m/%d/%Y")
         
     | 
| 
      
 42 
     | 
    
         
            +
                  end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                  def time
         
     | 
| 
      
 45 
     | 
    
         
            +
                    @time ? "&date=#{ date }&time=#{ @time.utc.strftime("%k:%M").lstrip }" : ""
         
     | 
| 
      
 46 
     | 
    
         
            +
                  end
         
     | 
| 
      
 47 
     | 
    
         
            +
                end
         
     | 
| 
       17 
48 
     | 
    
         
             
              end
         
     | 
| 
       18 
49 
     | 
    
         
             
            end
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
            require_relative "imagery/ganymede"
         
     | 
| 
      
 52 
     | 
    
         
            +
            require_relative "imagery/io"
         
     | 
| 
      
 53 
     | 
    
         
            +
            require_relative "imagery/europa"
         
     | 
| 
      
 54 
     | 
    
         
            +
            require_relative "imagery/jupiter"
         
     | 
| 
      
 55 
     | 
    
         
            +
            require_relative "imagery/mars"
         
     | 
| 
      
 56 
     | 
    
         
            +
            require_relative "imagery/mercury"
         
     | 
| 
      
 57 
     | 
    
         
            +
            require_relative "imagery/venus"
         
     | 
| 
      
 58 
     | 
    
         
            +
            require_relative "imagery/moon"
         
     | 
| 
      
 59 
     | 
    
         
            +
            require_relative "imagery/callisto"
         
     | 
    
        data/lib/usno/imagery/version.rb
    CHANGED
    
    
    
        data/samples/rise
    ADDED
    
    | 
         Binary file 
     | 
    
        data/test/test_helper.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Callisto do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Callisto
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 18 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y")
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/callisto.png?"
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Europa do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Europa
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 18 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/europa.png?"
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Ganymede do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Ganymede
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 18 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/ganymede.png?"
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Io do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Io
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 18 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/io.png?"
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Jupiter do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Jupiter
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 18 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/jupiter.png?"
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Mars do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Mars
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 18 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/mars.png?"
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Mercury do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Mercury
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 12 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 18 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 25 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/mercury.png?"
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,33 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Moon do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Moon
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  view: "full",
         
     | 
| 
      
 8 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 9 
     | 
    
         
            +
                }
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 14 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 22 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 26 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 30 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/moon.png?"
         
     | 
| 
      
 31 
     | 
    
         
            +
                end
         
     | 
| 
      
 32 
     | 
    
         
            +
              end
         
     | 
| 
      
 33 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,41 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe USNO::Imagery::Venus do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                @subject = USNO::Imagery::Venus
         
     | 
| 
      
 6 
     | 
    
         
            +
                @params = {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  view: "full",
         
     | 
| 
      
 8 
     | 
    
         
            +
                  time: Time.now
         
     | 
| 
      
 9 
     | 
    
         
            +
                }
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              describe "as a class" do
         
     | 
| 
      
 13 
     | 
    
         
            +
                it "initializes properly" do
         
     | 
| 
      
 14 
     | 
    
         
            +
                  @subject.new(@params).must_respond_to :call
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              describe "as an instance" do
         
     | 
| 
      
 19 
     | 
    
         
            +
                it "executes successfully" do
         
     | 
| 
      
 20 
     | 
    
         
            +
                  result = @subject.new(@params).call
         
     | 
| 
      
 21 
     | 
    
         
            +
                  result.successful?.must_equal true
         
     | 
| 
      
 22 
     | 
    
         
            +
                  result.must_be_kind_of PayDirt::Result
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                it "returns the proper url" do
         
     | 
| 
      
 26 
     | 
    
         
            +
                  result = @subject.new(@params).call.data
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 29 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 30 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/venus.png?"
         
     | 
| 
      
 31 
     | 
    
         
            +
                end
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                it "it supports a radar view of Venus" do
         
     | 
| 
      
 34 
     | 
    
         
            +
                  result = @subject.new(@params.merge({radar: true})).call.data
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%k:%M").lstrip
         
     | 
| 
      
 37 
     | 
    
         
            +
                  result.must_include @params[:time].strftime("%m/%d/%Y").lstrip
         
     | 
| 
      
 38 
     | 
    
         
            +
                  result.must_include "http://api.usno.navy.mil/imagery/venus-radar.png?"
         
     | 
| 
      
 39 
     | 
    
         
            +
                end
         
     | 
| 
      
 40 
     | 
    
         
            +
              end
         
     | 
| 
      
 41 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: usno-imagery
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ryan T. Hosford
         
     | 
| 
         @@ -116,11 +116,13 @@ extensions: [] 
     | 
|
| 
       116 
116 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       117 
117 
     | 
    
         
             
            files:
         
     | 
| 
       118 
118 
     | 
    
         
             
            - .gitignore
         
     | 
| 
      
 119 
     | 
    
         
            +
            - .travis.yml
         
     | 
| 
       119 
120 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       120 
121 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       121 
122 
     | 
    
         
             
            - README.md
         
     | 
| 
       122 
123 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       123 
124 
     | 
    
         
             
            - lib/usno/imagery.rb
         
     | 
| 
      
 125 
     | 
    
         
            +
            - lib/usno/imagery/callisto.rb
         
     | 
| 
       124 
126 
     | 
    
         
             
            - lib/usno/imagery/earth/call.rb
         
     | 
| 
       125 
127 
     | 
    
         
             
            - lib/usno/imagery/earth/call_with_time.rb
         
     | 
| 
       126 
128 
     | 
    
         
             
            - lib/usno/imagery/earth/earth_view.rb
         
     | 
| 
         @@ -130,14 +132,32 @@ files: 
     | 
|
| 
       130 
132 
     | 
    
         
             
            - lib/usno/imagery/earth/set.rb
         
     | 
| 
       131 
133 
     | 
    
         
             
            - lib/usno/imagery/earth/sun.rb
         
     | 
| 
       132 
134 
     | 
    
         
             
            - lib/usno/imagery/earth/view.rb
         
     | 
| 
      
 135 
     | 
    
         
            +
            - lib/usno/imagery/europa.rb
         
     | 
| 
      
 136 
     | 
    
         
            +
            - lib/usno/imagery/ganymede.rb
         
     | 
| 
      
 137 
     | 
    
         
            +
            - lib/usno/imagery/io.rb
         
     | 
| 
      
 138 
     | 
    
         
            +
            - lib/usno/imagery/jupiter.rb
         
     | 
| 
      
 139 
     | 
    
         
            +
            - lib/usno/imagery/mars.rb
         
     | 
| 
      
 140 
     | 
    
         
            +
            - lib/usno/imagery/mercury.rb
         
     | 
| 
      
 141 
     | 
    
         
            +
            - lib/usno/imagery/moon.rb
         
     | 
| 
      
 142 
     | 
    
         
            +
            - lib/usno/imagery/venus.rb
         
     | 
| 
       133 
143 
     | 
    
         
             
            - lib/usno/imagery/version.rb
         
     | 
| 
      
 144 
     | 
    
         
            +
            - samples/rise
         
     | 
| 
       134 
145 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
      
 146 
     | 
    
         
            +
            - test/unit/usno/imagery/callisto_test.rb
         
     | 
| 
       135 
147 
     | 
    
         
             
            - test/unit/usno/imagery/earth/map_test.rb
         
     | 
| 
       136 
148 
     | 
    
         
             
            - test/unit/usno/imagery/earth/moon_test.rb
         
     | 
| 
       137 
149 
     | 
    
         
             
            - test/unit/usno/imagery/earth/rise_test.rb
         
     | 
| 
       138 
150 
     | 
    
         
             
            - test/unit/usno/imagery/earth/set_test.rb
         
     | 
| 
       139 
151 
     | 
    
         
             
            - test/unit/usno/imagery/earth/sun_test.rb
         
     | 
| 
       140 
152 
     | 
    
         
             
            - test/unit/usno/imagery/earth/view_test.rb
         
     | 
| 
      
 153 
     | 
    
         
            +
            - test/unit/usno/imagery/europa_test.rb
         
     | 
| 
      
 154 
     | 
    
         
            +
            - test/unit/usno/imagery/ganymede_test.rb
         
     | 
| 
      
 155 
     | 
    
         
            +
            - test/unit/usno/imagery/io_test.rb
         
     | 
| 
      
 156 
     | 
    
         
            +
            - test/unit/usno/imagery/jupiter_test.rb
         
     | 
| 
      
 157 
     | 
    
         
            +
            - test/unit/usno/imagery/mars_test.rb
         
     | 
| 
      
 158 
     | 
    
         
            +
            - test/unit/usno/imagery/mercury_test.rb
         
     | 
| 
      
 159 
     | 
    
         
            +
            - test/unit/usno/imagery/moon_test.rb
         
     | 
| 
      
 160 
     | 
    
         
            +
            - test/unit/usno/imagery/venus_test.rb
         
     | 
| 
       141 
161 
     | 
    
         
             
            - usno-imagery.gemspec
         
     | 
| 
       142 
162 
     | 
    
         
             
            homepage: ''
         
     | 
| 
       143 
163 
     | 
    
         
             
            licenses:
         
     | 
| 
         @@ -165,9 +185,18 @@ specification_version: 4 
     | 
|
| 
       165 
185 
     | 
    
         
             
            summary: Consumes USNO's imagery data services
         
     | 
| 
       166 
186 
     | 
    
         
             
            test_files:
         
     | 
| 
       167 
187 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
      
 188 
     | 
    
         
            +
            - test/unit/usno/imagery/callisto_test.rb
         
     | 
| 
       168 
189 
     | 
    
         
             
            - test/unit/usno/imagery/earth/map_test.rb
         
     | 
| 
       169 
190 
     | 
    
         
             
            - test/unit/usno/imagery/earth/moon_test.rb
         
     | 
| 
       170 
191 
     | 
    
         
             
            - test/unit/usno/imagery/earth/rise_test.rb
         
     | 
| 
       171 
192 
     | 
    
         
             
            - test/unit/usno/imagery/earth/set_test.rb
         
     | 
| 
       172 
193 
     | 
    
         
             
            - test/unit/usno/imagery/earth/sun_test.rb
         
     | 
| 
       173 
194 
     | 
    
         
             
            - test/unit/usno/imagery/earth/view_test.rb
         
     | 
| 
      
 195 
     | 
    
         
            +
            - test/unit/usno/imagery/europa_test.rb
         
     | 
| 
      
 196 
     | 
    
         
            +
            - test/unit/usno/imagery/ganymede_test.rb
         
     | 
| 
      
 197 
     | 
    
         
            +
            - test/unit/usno/imagery/io_test.rb
         
     | 
| 
      
 198 
     | 
    
         
            +
            - test/unit/usno/imagery/jupiter_test.rb
         
     | 
| 
      
 199 
     | 
    
         
            +
            - test/unit/usno/imagery/mars_test.rb
         
     | 
| 
      
 200 
     | 
    
         
            +
            - test/unit/usno/imagery/mercury_test.rb
         
     | 
| 
      
 201 
     | 
    
         
            +
            - test/unit/usno/imagery/moon_test.rb
         
     | 
| 
      
 202 
     | 
    
         
            +
            - test/unit/usno/imagery/venus_test.rb
         
     |