diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..2326f23 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,31 @@ +## Change description + +> Description here + +## Type of change +- [ ] Bug fix (fixes an issue) +- [ ] New feature (adds functionality) + +## Related issues + +> Fix [#1]() + +## Checklists + +### Development + +- [ ] Lint rules pass locally +- [ ] Application changes have been tested thoroughly +- [ ] Automated tests covering modified code pass + +### Security + +- [ ] Security impact of change has been considered +- [ ] Code follows company security practices and guidelines + +### Code review + +- [ ] Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as necessary +- [ ] "Ready for review" label attached and reviewers assigned +- [ ] Changes have been reviewed by at least one other contributor +- [ ] Pull request linked to task tracker where applicable diff --git a/.gitignore b/.gitignore index 53940f7..5dc0695 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -Gemfile.lock /coverage /pkg diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..8587df7 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,65 @@ +PATH + remote: . + specs: + soundcloud (0.3.4.1) + hashie + httparty (>= 0.16.4) + +GEM + remote: http://rubygems.org/ + specs: + addressable (2.8.4) + public_suffix (>= 2.0.2, < 6.0) + crack (0.4.5) + rexml + diff-lcs (1.5.0) + docile (1.4.0) + hashdiff (1.0.1) + hashie (5.0.0) + httparty (0.21.0) + mini_mime (>= 1.0.0) + multi_xml (>= 0.5.2) + mini_mime (1.1.2) + multi_xml (0.6.0) + public_suffix (5.0.1) + rake (13.0.6) + rexml (3.2.8) + strscan (>= 3.0.9) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.4) + strscan (3.1.0) + webmock (3.18.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (~> 2.1) + rake (>= 10.1) + rspec (>= 3) + simplecov (>= 0.7) + soundcloud! + webmock (>= 1.13) + +BUNDLED WITH + 2.1.4 diff --git a/lib/soundcloud.rb b/lib/soundcloud.rb index cd569d9..40be011 100644 --- a/lib/soundcloud.rb +++ b/lib/soundcloud.rb @@ -1,5 +1,5 @@ require 'hashie' -require 'httmultiparty' +require 'httparty' require 'uri' require 'soundcloud/array_response_wrapper' diff --git a/lib/soundcloud/client.rb b/lib/soundcloud/client.rb index d9f67ea..210ffd1 100644 --- a/lib/soundcloud/client.rb +++ b/lib/soundcloud/client.rb @@ -2,7 +2,7 @@ module SoundCloud class Client - include HTTMultiParty + include HTTParty USER_AGENT = "SoundCloud Ruby Wrapper #{SoundCloud::VERSION}" CLIENT_ID_PARAM_NAME = :client_id API_SUBHOST = 'api' @@ -134,7 +134,7 @@ def exchange_token(options={}) params.merge!(:client_id => client_id, :client_secret => client_secret) response = handle_response(false) { - self.class.post("https://#{api_host}#{TOKEN_PATH}", :query => params) + self.class.post("https://#{api_host}#{TOKEN_PATH}", :body => params) } @options.merge!(:access_token => response.access_token, :refresh_token => response.refresh_token) diff --git a/lib/soundcloud/version.rb b/lib/soundcloud/version.rb index 1f0ab3e..103d6a7 100644 --- a/lib/soundcloud/version.rb +++ b/lib/soundcloud/version.rb @@ -1,3 +1,3 @@ module SoundCloud - VERSION = '0.3.4' + VERSION = '0.3.4.1' end diff --git a/soundcloud.gemspec b/soundcloud.gemspec index 85e07a9..3de682e 100644 --- a/soundcloud.gemspec +++ b/soundcloud.gemspec @@ -15,10 +15,10 @@ Gem::Specification.new do |spec| spec.required_rubygems_version = '>= 1.3.5' - spec.add_dependency('httmultiparty', '~> 0.3.0') + spec.add_dependency('httparty', '>= 0.16.4') spec.add_dependency('hashie') - spec.add_development_dependency('bundler', '~> 1.0') + spec.add_development_dependency('bundler', '~> 2.1') spec.files = Dir.glob("lib/**/*") + %w(LICENSE.md README.md) spec.require_path = 'lib' diff --git a/spec/soundcloud_spec.rb b/spec/soundcloud_spec.rb index a80e9de..f06a4c4 100644 --- a/spec/soundcloud_spec.rb +++ b/spec/soundcloud_spec.rb @@ -221,7 +221,7 @@ it "calls authorize endpoint to exchange token and store them when refresh token is passed" do allow(subject.class).to receive(:post) - expect(SoundCloud::Client).to receive(:post).with('https://api.soundcloud.com/oauth2/token', :query => { + expect(SoundCloud::Client).to receive(:post).with('https://api.soundcloud.com/oauth2/token', :body => { :grant_type => 'refresh_token', :refresh_token => 'refresh', :client_id => 'client', @@ -234,7 +234,7 @@ it "calls authorize endpoint to exchange token and store them when credentials are passed" do subject - expect(SoundCloud::Client).to receive(:post).with('https://api.soundcloud.com/oauth2/token', :query => { + expect(SoundCloud::Client).to receive(:post).with('https://api.soundcloud.com/oauth2/token', :body => { :grant_type => 'password', :username => 'foo@bar.com', :password => 'pass', @@ -247,7 +247,7 @@ end it "calls authorize endpoint to exchange token and store them when code and redirect_uri are passed" do - expect(subject.class).to receive(:post).with('https://api.soundcloud.com/oauth2/token', :query => { + expect(subject.class).to receive(:post).with('https://api.soundcloud.com/oauth2/token', :body => { :grant_type => 'authorization_code', :redirect_uri => 'http://somewhere.com/bla', :code => 'pass',