clearbit 0.1.6 → 0.1.7.pre
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/bin/clearbit +2 -2
- data/{apihub.gemspec → clearbit.gemspec} +1 -1
- data/examples/logo.rb +4 -0
- data/lib/clearbit.rb +2 -0
- data/lib/clearbit/company_search.rb +18 -0
- data/lib/clearbit/logo.rb +39 -0
- data/lib/clearbit/version.rb +1 -1
- metadata +10 -7
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f17cc8ca100cf101bd462ffeca2cacb7e8dd5969
         | 
| 4 | 
            +
              data.tar.gz: 5b338dd73e8ab2be9c0d790c8bbc550f708f1f33
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 6c6fbd82648fd28a1f3811beba2deffe93aa0015ded42015edc552bbb7190328dc0c94ab650c9db1f4b910f95b17654f884e78bee9b3cfef637474df6a0c6c02
         | 
| 7 | 
            +
              data.tar.gz: 27b5f136e9677c56ae2e678892adcbd93c30ff738d116f5fe88240da48b6fabe22bf8c92fc93dd264bba0b1a1e6fa1fdaba41655ad124e19e80c324088a47702
         | 
    
        data/bin/clearbit
    CHANGED
    
    
    
        data/examples/logo.rb
    ADDED
    
    
    
        data/lib/clearbit.rb
    CHANGED
    
    | @@ -20,6 +20,8 @@ module Clearbit | |
| 20 20 |  | 
| 21 21 | 
             
              autoload :Base, 'clearbit/base'
         | 
| 22 22 | 
             
              autoload :Company, 'clearbit/company'
         | 
| 23 | 
            +
              autoload :CompanySearch, 'clearbit/company_search'
         | 
| 24 | 
            +
              autoload :Logo, 'clearbit/logo'
         | 
| 23 25 | 
             
              autoload :Mash, 'clearbit/mash'
         | 
| 24 26 | 
             
              autoload :Person, 'clearbit/person'
         | 
| 25 27 | 
             
              autoload :PersonCompany, 'clearbit/person_company'
         | 
| @@ -0,0 +1,18 @@ | |
| 1 | 
            +
            module Clearbit
         | 
| 2 | 
            +
              class CompanySearch < Base
         | 
| 3 | 
            +
                endpoint 'https://company.clearbit.com'
         | 
| 4 | 
            +
                path '/v1/companies/search'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                def self.search(query, params = {})
         | 
| 7 | 
            +
                  options  = params.delete(:request) || {}
         | 
| 8 | 
            +
                  options  = options.merge(format: :json)
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                  query    = [query] if query.is_a?(Hash)
         | 
| 11 | 
            +
                  params   = params.merge(query: query)
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  response = post('', params, options)
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                  self.new(response)
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
              end
         | 
| 18 | 
            +
            end
         | 
| @@ -0,0 +1,39 @@ | |
| 1 | 
            +
            module Clearbit
         | 
| 2 | 
            +
              class Logo
         | 
| 3 | 
            +
                ENDPOINT = 'https://logo.clearbit.com'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
                def self.url(values)
         | 
| 6 | 
            +
                  params = values.delete(params) || {}
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  if size = values.delete(:size)
         | 
| 9 | 
            +
                    params.merge!(size: size)
         | 
| 10 | 
            +
                  end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                  if format = values.delete(:format)
         | 
| 13 | 
            +
                    params.merge!(format: format)
         | 
| 14 | 
            +
                  end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                  if greyscale = values.delete(:greyscale)
         | 
| 17 | 
            +
                    params.merge!(greyscale: greyscale)
         | 
| 18 | 
            +
                  end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                  encoded_params = URI.encode_www_form(params)
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                  if domain = values.delete(:domain)
         | 
| 23 | 
            +
                    raise ArgumentError, 'Invalid domain' unless domain =~ /^([a-z0-9]+)*\.[a-z]{2,5}$/
         | 
| 24 | 
            +
                    if encoded_params.empty?
         | 
| 25 | 
            +
                      "#{ENDPOINT}/#{domain}"
         | 
| 26 | 
            +
                    else
         | 
| 27 | 
            +
                      "#{ENDPOINT}/#{domain}?#{encoded_params}"
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  else
         | 
| 30 | 
            +
                    raise ArgumentError, 'Invalid values'
         | 
| 31 | 
            +
                  end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                class << self
         | 
| 36 | 
            +
                  alias_method :[], :url
         | 
| 37 | 
            +
                end
         | 
| 38 | 
            +
              end
         | 
| 39 | 
            +
            end
         | 
    
        data/lib/clearbit/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: clearbit
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.7.pre
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Alex MacCaw
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2015- | 
| 11 | 
            +
            date: 2015-07-15 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -100,14 +100,14 @@ dependencies: | |
| 100 100 | 
             
                requirements:
         | 
| 101 101 | 
             
                - - "~>"
         | 
| 102 102 | 
             
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            -
                    version: 1.0 | 
| 103 | 
            +
                    version: 1.1.0
         | 
| 104 104 | 
             
              type: :runtime
         | 
| 105 105 | 
             
              prerelease: false
         | 
| 106 106 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 107 | 
             
                requirements:
         | 
| 108 108 | 
             
                - - "~>"
         | 
| 109 109 | 
             
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            -
                    version: 1.0 | 
| 110 | 
            +
                    version: 1.1.0
         | 
| 111 111 | 
             
            description: API client for clearbit.com
         | 
| 112 112 | 
             
            email:
         | 
| 113 113 | 
             
            - alex@clearbit.com
         | 
| @@ -120,9 +120,10 @@ files: | |
| 120 120 | 
             
            - Gemfile
         | 
| 121 121 | 
             
            - README.md
         | 
| 122 122 | 
             
            - Rakefile
         | 
| 123 | 
            -
            - apihub.gemspec
         | 
| 124 123 | 
             
            - bin/clearbit
         | 
| 124 | 
            +
            - clearbit.gemspec
         | 
| 125 125 | 
             
            - examples/company.rb
         | 
| 126 | 
            +
            - examples/logo.rb
         | 
| 126 127 | 
             
            - examples/person.rb
         | 
| 127 128 | 
             
            - examples/person_company.rb
         | 
| 128 129 | 
             
            - examples/version.rb
         | 
| @@ -130,7 +131,9 @@ files: | |
| 130 131 | 
             
            - lib/clearbit.rb
         | 
| 131 132 | 
             
            - lib/clearbit/base.rb
         | 
| 132 133 | 
             
            - lib/clearbit/company.rb
         | 
| 134 | 
            +
            - lib/clearbit/company_search.rb
         | 
| 133 135 | 
             
            - lib/clearbit/errors/invalid_webhook_signature.rb
         | 
| 136 | 
            +
            - lib/clearbit/logo.rb
         | 
| 134 137 | 
             
            - lib/clearbit/mash.rb
         | 
| 135 138 | 
             
            - lib/clearbit/person.rb
         | 
| 136 139 | 
             
            - lib/clearbit/person_company.rb
         | 
| @@ -160,9 +163,9 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 160 163 | 
             
                  version: '0'
         | 
| 161 164 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 162 165 | 
             
              requirements:
         | 
| 163 | 
            -
              - - " | 
| 166 | 
            +
              - - ">"
         | 
| 164 167 | 
             
                - !ruby/object:Gem::Version
         | 
| 165 | 
            -
                  version:  | 
| 168 | 
            +
                  version: 1.3.1
         | 
| 166 169 | 
             
            requirements: []
         | 
| 167 170 | 
             
            rubyforge_project: 
         | 
| 168 171 | 
             
            rubygems_version: 2.2.2
         |