hackerrank 0.1.0 → 0.2.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/.travis.yml +2 -2
- data/README.md +5 -1
- data/hackerrank.gemspec +2 -2
- data/lib/hackerrank.rb +1 -0
- data/lib/hackerrank/base.rb +3 -3
- data/lib/hackerrank/candidate.rb +6 -2
- data/lib/hackerrank/template.rb +9 -0
- data/lib/hackerrank/test.rb +4 -0
- data/lib/hackerrank/version.rb +1 -1
- metadata +6 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 4895676533771049a86c62b063d08a6773a6eaab
         | 
| 4 | 
            +
              data.tar.gz: 7da5cc5693a78d6f96754e38f75cd81d07acc26c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 285022fa415899601e3f03258d637b7be9cb5d2815bc45d331869ff792abfab325c6d80534d1d3c597f90fe5b61e39b3f7b6a5c5d3a2bff066dd6e3def75a4c9
         | 
| 7 | 
            +
              data.tar.gz: 4384b64e6776c1bafb3ff3f7b4231e40e2241c80697688e14fa9e6887e3b1bdef001fab62013dfc5bddeb9860db09d9878d7225fbc67b4114d14f046df2b042f
         | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -1,3 +1,5 @@ | |
| 1 | 
            +
            [](https://travis-ci.org/contratadome/hackerrank)
         | 
| 2 | 
            +
             | 
| 1 3 | 
             
            # Hackerrank
         | 
| 2 4 |  | 
| 3 5 | 
             
            Ruby wrapper to the HackerRank V2 API
         | 
| @@ -32,6 +34,8 @@ HackerRank::Test.delete '12345' | |
| 32 34 | 
             
            HackerRank::Candidate.all test_id: 12345
         | 
| 33 35 | 
             
            HackerRank::Candidate.find 64553, test_id: 12345
         | 
| 34 36 | 
             
            HackerRank::Candidate.create test_id: 12345, username: 'dc.rec1@gmail.com'
         | 
| 37 | 
            +
             | 
| 38 | 
            +
            HackerRank::Template.all
         | 
| 35 39 | 
             
            ```
         | 
| 36 40 |  | 
| 37 41 | 
             
            ## Development
         | 
| @@ -42,7 +46,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To | |
| 42 46 |  | 
| 43 47 | 
             
            ## Contributing
         | 
| 44 48 |  | 
| 45 | 
            -
            Bug reports and pull requests are welcome on GitHub at https://github.com/ | 
| 49 | 
            +
            Bug reports and pull requests are welcome on GitHub at https://github.com/dcrec1/hackerrank. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
         | 
| 46 50 |  | 
| 47 51 |  | 
| 48 52 | 
             
            ## License
         | 
    
        data/hackerrank.gemspec
    CHANGED
    
    | @@ -7,10 +7,10 @@ Gem::Specification.new do |spec| | |
| 7 7 | 
             
              spec.name          = "hackerrank"
         | 
| 8 8 | 
             
              spec.version       = HackerRank::VERSION
         | 
| 9 9 | 
             
              spec.authors       = ["Diego Carrion"]
         | 
| 10 | 
            -
              spec.email         = [" | 
| 10 | 
            +
              spec.email         = ["dc.rec1@gmail.com"]
         | 
| 11 11 |  | 
| 12 12 | 
             
              spec.summary       = %q{Ruby wrapper to the HackerRank V2 API}
         | 
| 13 | 
            -
              spec.homepage      = "https://github.com/ | 
| 13 | 
            +
              spec.homepage      = "https://github.com/dcrec1/hackerrank"
         | 
| 14 14 | 
             
              spec.license       = "MIT"
         | 
| 15 15 |  | 
| 16 16 | 
             
              spec.files         = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
         | 
    
        data/lib/hackerrank.rb
    CHANGED
    
    
    
        data/lib/hackerrank/base.rb
    CHANGED
    
    | @@ -30,12 +30,12 @@ module HackerRank | |
| 30 30 |  | 
| 31 31 | 
             
                private
         | 
| 32 32 |  | 
| 33 | 
            -
                def self.request(method, path,  | 
| 34 | 
            -
                  HTTParty.send(method, "#{BASE_URI}#{@collection_path.call( | 
| 33 | 
            +
                def self.request(method, path, body_params, query_params = {})
         | 
| 34 | 
            +
                  HTTParty.send(method, "#{BASE_URI}#{@collection_path.call(body_params)}#{path}", { query: auth.merge(query_params), body: body_params })[response_key]
         | 
| 35 35 | 
             
                end
         | 
| 36 36 |  | 
| 37 37 | 
             
                def self.auth
         | 
| 38 | 
            -
                  {  | 
| 38 | 
            +
                  { access_token: HackerRank.access_token }
         | 
| 39 39 | 
             
                end
         | 
| 40 40 | 
             
              end
         | 
| 41 41 | 
             
            end
         | 
    
        data/lib/hackerrank/candidate.rb
    CHANGED
    
    | @@ -1,9 +1,13 @@ | |
| 1 1 | 
             
            module HackerRank
         | 
| 2 2 | 
             
              class Candidate < Base
         | 
| 3 | 
            -
                collection_path -> (params) { "/tests/#{params | 
| 3 | 
            +
                collection_path -> (params) { "/tests/#{params.delete(:test_id)}/candidates" }
         | 
| 4 4 |  | 
| 5 5 | 
             
                def self.find_by_username(username, params)
         | 
| 6 | 
            -
                  request :get, "/view", params | 
| 6 | 
            +
                  request :get, "/view", params, { username: username }
         | 
| 7 | 
            +
                end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                def self.response_key
         | 
| 10 | 
            +
                  'data'
         | 
| 7 11 | 
             
                end
         | 
| 8 12 | 
             
              end
         | 
| 9 13 | 
             
            end
         | 
    
        data/lib/hackerrank/test.rb
    CHANGED
    
    
    
        data/lib/hackerrank/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: hackerrank
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Diego Carrion
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2017-03-03 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: httparty
         | 
| @@ -96,7 +96,7 @@ dependencies: | |
| 96 96 | 
             
                    version: '0'
         | 
| 97 97 | 
             
            description: 
         | 
| 98 98 | 
             
            email:
         | 
| 99 | 
            -
            -  | 
| 99 | 
            +
            - dc.rec1@gmail.com
         | 
| 100 100 | 
             
            executables: []
         | 
| 101 101 | 
             
            extensions: []
         | 
| 102 102 | 
             
            extra_rdoc_files: []
         | 
| @@ -115,9 +115,10 @@ files: | |
| 115 115 | 
             
            - lib/hackerrank.rb
         | 
| 116 116 | 
             
            - lib/hackerrank/base.rb
         | 
| 117 117 | 
             
            - lib/hackerrank/candidate.rb
         | 
| 118 | 
            +
            - lib/hackerrank/template.rb
         | 
| 118 119 | 
             
            - lib/hackerrank/test.rb
         | 
| 119 120 | 
             
            - lib/hackerrank/version.rb
         | 
| 120 | 
            -
            homepage: https://github.com/ | 
| 121 | 
            +
            homepage: https://github.com/dcrec1/hackerrank
         | 
| 121 122 | 
             
            licenses:
         | 
| 122 123 | 
             
            - MIT
         | 
| 123 124 | 
             
            metadata: {}
         | 
| @@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 137 138 | 
             
                  version: '0'
         | 
| 138 139 | 
             
            requirements: []
         | 
| 139 140 | 
             
            rubyforge_project: 
         | 
| 140 | 
            -
            rubygems_version: 2. | 
| 141 | 
            +
            rubygems_version: 2.6.6
         | 
| 141 142 | 
             
            signing_key: 
         | 
| 142 143 | 
             
            specification_version: 4
         | 
| 143 144 | 
             
            summary: Ruby wrapper to the HackerRank V2 API
         |