populr 0.1.3 → 0.1.4
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/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/populr.rb +7 -3
- data/populr.gemspec +3 -3
- data/spec/populr_spec.rb +1 -1
- data/spec/restful_model_collection_spec.rb +4 -0
- metadata +16 -14
    
        data/Rakefile
    CHANGED
    
    | @@ -15,10 +15,10 @@ require 'jeweler' | |
| 15 15 | 
             
            Jeweler::Tasks.new do |gem|
         | 
| 16 16 | 
             
              # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
         | 
| 17 17 | 
             
              gem.name = "populr"
         | 
| 18 | 
            -
              gem.homepage = "http://github.com/ | 
| 18 | 
            +
              gem.homepage = "http://github.com/populr/populr_api_ruby"
         | 
| 19 19 | 
             
              gem.license = "MIT"
         | 
| 20 20 | 
             
              gem.summary = %Q{Gem for interacting with the Populr.me API}
         | 
| 21 | 
            -
              gem.description = %Q{Gem for interacting with the Populr.me API}
         | 
| 21 | 
            +
              gem.description = %Q{Gem for interacting with the Populr.me API that allows you to create and publish one-page websites, subscribe to web hooks and receive events when those pages are interacted with. Visit http://www.populr.me/ for more information. }
         | 
| 22 22 | 
             
              gem.email = "ben@populr.me"
         | 
| 23 23 | 
             
              gem.authors = ["Ben Gotow"]
         | 
| 24 24 | 
             
              # dependencies defined in Gemfile
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.1. | 
| 1 | 
            +
            0.1.4
         | 
    
        data/lib/populr.rb
    CHANGED
    
    | @@ -23,6 +23,7 @@ class Populr | |
| 23 23 |  | 
| 24 24 | 
             
              attr_accessor :api_server
         | 
| 25 25 | 
             
              attr_reader :api_key
         | 
| 26 | 
            +
              attr_reader :api_version
         | 
| 26 27 |  | 
| 27 28 |  | 
| 28 29 | 
             
              def self.interpret_response(result, options = {})
         | 
| @@ -45,8 +46,10 @@ class Populr | |
| 45 46 |  | 
| 46 47 |  | 
| 47 48 |  | 
| 48 | 
            -
              def initialize(api_key)
         | 
| 49 | 
            -
                 | 
| 49 | 
            +
              def initialize(api_key, api_server = 'https://api.populr.me')
         | 
| 50 | 
            +
                raise "When overriding the Populr API server address, you must include https://" unless api_server.include?('://')
         | 
| 51 | 
            +
                @api_server = api_server
         | 
| 52 | 
            +
                @api_version = 'v0'
         | 
| 50 53 | 
             
                @api_key = api_key
         | 
| 51 54 | 
             
              end
         | 
| 52 55 |  | 
| @@ -71,7 +74,8 @@ class Populr | |
| 71 74 | 
             
              end
         | 
| 72 75 |  | 
| 73 76 | 
             
              def url_for_path(path)
         | 
| 74 | 
            -
                 | 
| 77 | 
            +
                protocol, domain = @api_server.split('//')
         | 
| 78 | 
            +
                "#{protocol}//#{@api_key}:@#{domain}/#{@api_version}#{path}"
         | 
| 75 79 | 
             
              end
         | 
| 76 80 |  | 
| 77 81 |  | 
    
        data/populr.gemspec
    CHANGED
    
    | @@ -5,12 +5,12 @@ | |
| 5 5 |  | 
| 6 6 | 
             
            Gem::Specification.new do |s|
         | 
| 7 7 | 
             
              s.name = "populr"
         | 
| 8 | 
            -
              s.version = "0.1. | 
| 8 | 
            +
              s.version = "0.1.4"
         | 
| 9 9 |  | 
| 10 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 11 | 
             
              s.authors = ["Ben Gotow"]
         | 
| 12 12 | 
             
              s.date = "2013-04-18"
         | 
| 13 | 
            -
              s.description = "Gem for interacting with the Populr.me API"
         | 
| 13 | 
            +
              s.description = "Gem for interacting with the Populr.me API that allows you to create and publish one-page websites, subscribe to web hooks and receive events when those pages are interacted with. Visit http://www.populr.me/ for more information. "
         | 
| 14 14 | 
             
              s.email = "ben@populr.me"
         | 
| 15 15 | 
             
              s.extra_rdoc_files = [
         | 
| 16 16 | 
             
                "LICENSE.md",
         | 
| @@ -42,7 +42,7 @@ Gem::Specification.new do |s| | |
| 42 42 | 
             
                "spec/spec_helper.rb",
         | 
| 43 43 | 
             
                "spec/tracer_spec.rb"
         | 
| 44 44 | 
             
              ]
         | 
| 45 | 
            -
              s.homepage = "http://github.com/ | 
| 45 | 
            +
              s.homepage = "http://github.com/populr/populr_api_ruby"
         | 
| 46 46 | 
             
              s.licenses = ["MIT"]
         | 
| 47 47 | 
             
              s.require_paths = ["lib"]
         | 
| 48 48 | 
             
              s.rubygems_version = "1.8.10"
         | 
    
        data/spec/populr_spec.rb
    CHANGED
    
    | @@ -25,7 +25,7 @@ describe 'Populr' do | |
| 25 25 |  | 
| 26 26 | 
             
              describe "#url_for_path" do
         | 
| 27 27 | 
             
                it "should return the url for a provided path" do
         | 
| 28 | 
            -
                  @populr.url_for_path('/wobble').should == " | 
| 28 | 
            +
                  @populr.url_for_path('/wobble').should == "https://#{@populr.api_key}:@api.populr.me/v0/wobble"
         | 
| 29 29 | 
             
                end
         | 
| 30 30 | 
             
              end
         | 
| 31 31 |  | 
| @@ -52,6 +52,10 @@ describe 'RestfulModelCollection' do | |
| 52 52 |  | 
| 53 53 | 
             
              describe "#first" do
         | 
| 54 54 | 
             
                it "should return the first item in the all collection" do
         | 
| 55 | 
            +
                  result = double('result')
         | 
| 56 | 
            +
                  result.stub(:body).and_return("[{\"_id\":\"5107089add02dcaecc000003\",\"created_at\":\"2013-01-28T23:24:10Z\",\"domain\":\"generic\",\"name\":\"Untitled\",\"password\":null,\"slug\":\"\",\"tracers\":[{\"_id\":\"5109b5e0dd02dc5976000001\",\"created_at\":\"2013-01-31T00:08:00Z\",\"name\":\"Facebook\"},{\"_id\":\"5109b5f5dd02dc4c43000002\",\"created_at\":\"2013-01-31T00:08:21Z\",\"name\":\"Twitter\"}],\"published_pop_url\":\"http://group3.lvh.me\",\"unpopulated_api_tags\":[],\"unpopulated_api_regions\":[],\"label_names\":[]}]")
         | 
| 57 | 
            +
                  result.stub(:code).and_return(200)
         | 
| 58 | 
            +
                  RestClient.should_receive(:get).and_yield(nil, nil, result)
         | 
| 55 59 | 
             
                  @collection.first.should == @collection.all.first
         | 
| 56 60 | 
             
                end
         | 
| 57 61 | 
             
              end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: populr
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.4
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -13,7 +13,7 @@ date: 2013-04-18 00:00:00.000000000 Z | |
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: rest-client
         | 
| 16 | 
            -
              requirement: & | 
| 16 | 
            +
              requirement: &70154768151180 !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                none: false
         | 
| 18 18 | 
             
                requirements:
         | 
| 19 19 | 
             
                - - ! '>='
         | 
| @@ -21,10 +21,10 @@ dependencies: | |
| 21 21 | 
             
                    version: '1.6'
         | 
| 22 22 | 
             
              type: :runtime
         | 
| 23 23 | 
             
              prerelease: false
         | 
| 24 | 
            -
              version_requirements: * | 
| 24 | 
            +
              version_requirements: *70154768151180
         | 
| 25 25 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 26 26 | 
             
              name: shoulda
         | 
| 27 | 
            -
              requirement: & | 
| 27 | 
            +
              requirement: &70154768150640 !ruby/object:Gem::Requirement
         | 
| 28 28 | 
             
                none: false
         | 
| 29 29 | 
             
                requirements:
         | 
| 30 30 | 
             
                - - ! '>='
         | 
| @@ -32,10 +32,10 @@ dependencies: | |
| 32 32 | 
             
                    version: '0'
         | 
| 33 33 | 
             
              type: :development
         | 
| 34 34 | 
             
              prerelease: false
         | 
| 35 | 
            -
              version_requirements: * | 
| 35 | 
            +
              version_requirements: *70154768150640
         | 
| 36 36 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 37 37 | 
             
              name: rdoc
         | 
| 38 | 
            -
              requirement: & | 
| 38 | 
            +
              requirement: &70154768150060 !ruby/object:Gem::Requirement
         | 
| 39 39 | 
             
                none: false
         | 
| 40 40 | 
             
                requirements:
         | 
| 41 41 | 
             
                - - ~>
         | 
| @@ -43,10 +43,10 @@ dependencies: | |
| 43 43 | 
             
                    version: '3.12'
         | 
| 44 44 | 
             
              type: :development
         | 
| 45 45 | 
             
              prerelease: false
         | 
| 46 | 
            -
              version_requirements: * | 
| 46 | 
            +
              version_requirements: *70154768150060
         | 
| 47 47 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 48 48 | 
             
              name: bundler
         | 
| 49 | 
            -
              requirement: & | 
| 49 | 
            +
              requirement: &70154768149560 !ruby/object:Gem::Requirement
         | 
| 50 50 | 
             
                none: false
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 52 | 
             
                - - ~>
         | 
| @@ -54,10 +54,10 @@ dependencies: | |
| 54 54 | 
             
                    version: 1.3.5
         | 
| 55 55 | 
             
              type: :development
         | 
| 56 56 | 
             
              prerelease: false
         | 
| 57 | 
            -
              version_requirements: * | 
| 57 | 
            +
              version_requirements: *70154768149560
         | 
| 58 58 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 59 59 | 
             
              name: jeweler
         | 
| 60 | 
            -
              requirement: & | 
| 60 | 
            +
              requirement: &70154768148980 !ruby/object:Gem::Requirement
         | 
| 61 61 | 
             
                none: false
         | 
| 62 62 | 
             
                requirements:
         | 
| 63 63 | 
             
                - - ~>
         | 
| @@ -65,8 +65,10 @@ dependencies: | |
| 65 65 | 
             
                    version: 1.8.4
         | 
| 66 66 | 
             
              type: :development
         | 
| 67 67 | 
             
              prerelease: false
         | 
| 68 | 
            -
              version_requirements: * | 
| 69 | 
            -
            description: Gem for interacting with the Populr.me API
         | 
| 68 | 
            +
              version_requirements: *70154768148980
         | 
| 69 | 
            +
            description: ! 'Gem for interacting with the Populr.me API that allows you to create
         | 
| 70 | 
            +
              and publish one-page websites, subscribe to web hooks and receive events when those
         | 
| 71 | 
            +
              pages are interacted with. Visit http://www.populr.me/ for more information. '
         | 
| 70 72 | 
             
            email: ben@populr.me
         | 
| 71 73 | 
             
            executables: []
         | 
| 72 74 | 
             
            extensions: []
         | 
| @@ -98,7 +100,7 @@ files: | |
| 98 100 | 
             
            - spec/restful_model_spec.rb
         | 
| 99 101 | 
             
            - spec/spec_helper.rb
         | 
| 100 102 | 
             
            - spec/tracer_spec.rb
         | 
| 101 | 
            -
            homepage: http://github.com/ | 
| 103 | 
            +
            homepage: http://github.com/populr/populr_api_ruby
         | 
| 102 104 | 
             
            licenses:
         | 
| 103 105 | 
             
            - MIT
         | 
| 104 106 | 
             
            post_install_message: 
         | 
| @@ -113,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 113 115 | 
             
                  version: '0'
         | 
| 114 116 | 
             
                  segments:
         | 
| 115 117 | 
             
                  - 0
         | 
| 116 | 
            -
                  hash: - | 
| 118 | 
            +
                  hash: -3561322991411093630
         | 
| 117 119 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 118 120 | 
             
              none: false
         | 
| 119 121 | 
             
              requirements:
         |