From 28e0e56cb0a35ea406775a17fcaa6a7dc58be7d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 08:26:23 +0000 Subject: [PATCH 1/3] Bump addressable from 2.8.4 to 2.9.0 Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.8.4 to 2.9.0. - [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md) - [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.8.4...addressable-2.9.0) --- updated-dependencies: - dependency-name: addressable dependency-version: 2.9.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 790c916..fb61192 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,8 +8,8 @@ PATH GEM remote: http://rubygems.org/ specs: - addressable (2.8.4) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) bigdecimal (4.0.1) crack (0.4.5) rexml @@ -25,7 +25,7 @@ GEM mini_mime (1.1.5) multi_xml (0.8.0) bigdecimal (>= 3.1, < 5) - public_suffix (5.0.1) + public_suffix (7.0.5) rake (13.0.6) rexml (3.4.2) rspec (3.12.0) From bd3039935482c6c1ab0b31e28d86d72283b198de Mon Sep 17 00:00:00 2001 From: SamuelMoreira Date: Thu, 9 Apr 2026 10:41:02 +0100 Subject: [PATCH 2/3] Add GH action check --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..badcd35 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Run RSpec + run: bundle exec rspec From 6e098370ce387b73c09970bed105fec1eeca52de Mon Sep 17 00:00:00 2001 From: SamuelMoreira Date: Thu, 9 Apr 2026 11:10:41 +0100 Subject: [PATCH 3/3] Modernize gem --- .ruby-version | 1 + Gemfile | 3 +++ Gemfile.lock | 11 +++++++++-- lib/soundcloud/client.rb | 2 +- soundcloud.gemspec | 3 ++- spec/soundcloud_spec.rb | 10 +++++----- 6 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..fcdb2e1 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +4.0.0 diff --git a/Gemfile b/Gemfile index 3273628..72ff1c6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,9 @@ source 'http://rubygems.org' gem 'rake', '>= 10.1' +gem 'ostruct' +gem 'logger' +gem 'base64' group :test do gem 'rspec', '>= 3' diff --git a/Gemfile.lock b/Gemfile.lock index fb61192..8bfd684 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,12 +4,14 @@ PATH soundcloud (0.3.4.1) hashie httparty (>= 0.16.4) + logger GEM remote: http://rubygems.org/ specs: addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) + base64 (0.3.0) bigdecimal (4.0.1) crack (0.4.5) rexml @@ -22,9 +24,11 @@ GEM csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) + logger (1.7.0) mini_mime (1.1.5) multi_xml (0.8.0) bigdecimal (>= 3.1, < 5) + ostruct (0.6.3) public_suffix (7.0.5) rake (13.0.6) rexml (3.4.2) @@ -56,7 +60,10 @@ PLATFORMS ruby DEPENDENCIES - bundler (~> 2.1) + base64 + bundler (>= 2.1) + logger + ostruct rake (>= 10.1) rspec (>= 3) simplecov (>= 0.7) @@ -64,4 +71,4 @@ DEPENDENCIES webmock (>= 1.13) BUNDLED WITH - 2.1.4 + 4.0.3 diff --git a/lib/soundcloud/client.rb b/lib/soundcloud/client.rb index 210ffd1..53bf042 100644 --- a/lib/soundcloud/client.rb +++ b/lib/soundcloud/client.rb @@ -102,7 +102,7 @@ def authorize_url(options={}) "#{param_name}=#{CGI.escape value}" unless value.nil? end.compact.join("&") store_options(options) - "https://#{host}#{AUTHORIZE_PATH}?response_type=code_and_token&client_id=#{client_id}&redirect_uri=#{URI.escape(redirect_uri)}&#{additional_params}" + "https://#{host}#{AUTHORIZE_PATH}?response_type=code_and_token&client_id=#{client_id}&redirect_uri=#{CGI.escape(redirect_uri)}&#{additional_params}" end def exchange_token(options={}) diff --git a/soundcloud.gemspec b/soundcloud.gemspec index 3de682e..6b3e66b 100644 --- a/soundcloud.gemspec +++ b/soundcloud.gemspec @@ -17,8 +17,9 @@ Gem::Specification.new do |spec| spec.add_dependency('httparty', '>= 0.16.4') spec.add_dependency('hashie') + spec.add_dependency('logger') - spec.add_development_dependency('bundler', '~> 2.1') + 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 f06a4c4..0b3caf9 100644 --- a/spec/soundcloud_spec.rb +++ b/spec/soundcloud_spec.rb @@ -140,23 +140,23 @@ describe "#authorize_url" do it "generates a authorize_url" do - expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http://come.back.to/me&") + expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http%3A%2F%2Fcome.back.to%2Fme&") end it "generates a authorize_url and include the passed display parameter" do - expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me", :display => "popup")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http://come.back.to/me&display=popup") + expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me", :display => "popup")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http%3A%2F%2Fcome.back.to%2Fme&display=popup") end it "generates a authorize_url and include the passed state parameter" do - expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me", :state => "hell&yeah")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http://come.back.to/me&state=hell%26yeah") + expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me", :state => "hell&yeah")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http%3A%2F%2Fcome.back.to%2Fme&state=hell%26yeah") end it "generates a authorize_url and include the passed scope parameter" do - expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me", :scope => "non-expiring")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http://come.back.to/me&scope=non-expiring") + expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me", :scope => "non-expiring")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http%3A%2F%2Fcome.back.to%2Fme&scope=non-expiring") end it "generates a authorize_url and include the passed scope and state parameter" do - expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me", :scope => "non-expiring", :state => "blub")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http://come.back.to/me&state=blub&scope=non-expiring") + expect(subject.authorize_url(:redirect_uri => "http://come.back.to/me", :scope => "non-expiring", :state => "blub")).to eq("https://soundcloud.com/connect?response_type=code_and_token&client_id=client&redirect_uri=http%3A%2F%2Fcome.back.to%2Fme&state=blub&scope=non-expiring") end end