Skip to content

Commit

Permalink
Merge pull request #148 from hirakiuc/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
hirakiuc authored Nov 4, 2022
2 parents 3b11926 + d8fb825 commit bbba4e8
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 66 deletions.
40 changes: 0 additions & 40 deletions .circleci/config.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on: [ pull_request, push ]

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
ruby: [ '3.1']
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cache-version: ${{ runner.os }}-${{ runner.ruby }}-${{ hashFiles('Gemfile.lock', 'tinybucket.gemspec') }}
- name: Install dependencies
run: bundle install
- name: Run spec & publish coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: bundle exec rake spec
coverageLocations: ${{ github.workspace }}/coverage/coverage.json:simplecov
7 changes: 6 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AllCops:
TargetRubyVersion: 2.7
Include:
- 'lib/**/*.rb'
Exclude:
Expand Down Expand Up @@ -42,7 +43,7 @@ CyclomaticComplexity:
Next:
Enabled: false

Layout/AlignHash:
Layout/HashAlignment:
Enabled: false

Style/RaiseArgs:
Expand Down Expand Up @@ -84,3 +85,7 @@ Style/SafeNavigation:

Lint/DuplicateMethods:
Enabled: false

Naming/MethodParameterName:
MinNameLength: 1
AllowNamesEndingNumbers: false
11 changes: 5 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in bitbucket.gemspec
gemspec

gem 'simple-auth', '~> 0.3.1'
gem 'simple-auth', '~> 0.5.0'
gem 'yard', '~> 0.9.12'
gem 'yardstick', '~> 0.9.9'

Expand All @@ -19,14 +19,13 @@ group :development, :test do
gem 'guard-rubocop'
gem 'gem-release'

gem 'rake', '~> 10.4'
gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.4'
gem 'rspec-mocks', '~> 3.4'
gem 'webmock', '~> 1.24'
gem 'rubocop', '~> 0.52.1'
gem 'webmock', '~> 3.12.1'
gem 'rubocop', '~> 1.11.0'
end

group :test do
gem 'simplecov', '~> 0.13.0', require: false
gem 'codeclimate-test-reporter', '~> 1.0.8', require: nil
gem 'simplecov', '~> 0.21.2', require: false
end
1 change: 1 addition & 0 deletions lib/faraday_middleware/follow_oauth_redirects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def include_body_params?(env)

def signature_params(params)
return params if params.empty?

params.reject { |_k, v| v.respond_to?(:content_type) }
end
end
Expand Down
4 changes: 1 addition & 3 deletions lib/tinybucket/api/comments_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ module Api
class CommentsApi < BaseApi
include Tinybucket::Api::Helper::CommentsHelper

attr_accessor :repo_owner, :repo_slug

attr_accessor :commented_to
attr_accessor :repo_owner, :repo_slug, :commented_to

# Send 'GET a list of comments' request.
#
Expand Down
4 changes: 2 additions & 2 deletions lib/tinybucket/api/commits_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def approve(revision, options = {})
result = post_path(path_to_approve(revision), options)
(result['approved'] == true)
rescue Tinybucket::Error::Conflict => e
logger.debug 'Already approved: ' + e.inspect
logger.debug "Already approved: #{e.inspect}"
true
end

Expand All @@ -73,7 +73,7 @@ def unapprove(revision, options = {})
delete_path(path_to_approve(revision), options)
true
rescue Tinybucket::Error::NotFound => e
logger.debug 'Already unapproved: ' + e.inspect
logger.debug "Already unapproved: #{e.inspect}"
true
end

Expand Down
2 changes: 1 addition & 1 deletion lib/tinybucket/api/helper/api_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def build_path(base_path, *components)
else
component.to_s
end
path + '/' + part
"#{path}/#{part}"
end
rescue ArgumentError => e
raise ArgumentError, "Failed to build request URL: #{e}"
Expand Down
1 change: 1 addition & 0 deletions lib/tinybucket/api/helper/repos_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module ReposHelper
def path_to_list(options)
owner = options[:owner]
return base_path if owner.blank?

build_path(base_path, [owner, 'owner'])
end

Expand Down
4 changes: 2 additions & 2 deletions lib/tinybucket/api/pull_requests_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def approve(pr_id, options = {})
result = post_path(path_to_approve(pr_id), options)
(result['approved'] == true)
rescue Tinybucket::Error::Conflict => e
logger.debug 'Already approved: ' + e.inspect
logger.debug "Already approved: #{e.inspect}"
true
end

Expand All @@ -80,7 +80,7 @@ def unapprove(pr_id, options = {})
delete_path(path_to_approve(pr_id), options)
true
rescue Tinybucket::Error::NotFound => e
logger.debug 'Already unapproved: ' + e.inspect
logger.debug "Already unapproved: #{e.inspect}"
true
end

Expand Down
1 change: 1 addition & 0 deletions lib/tinybucket/model/concerns/acceptable_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def self.acceptable_attributes(*attrs)

def self.acceptable_attribute?(key)
return false if @_acceptable_attributes.nil?

@_acceptable_attributes.include?(key.intern)
end

Expand Down
3 changes: 1 addition & 2 deletions lib/tinybucket/model/concerns/reloadable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ def loaded?

def reload
@_loaded = false
# rubocop:disable all

self.load
# rubocop:enable all
end

private
Expand Down
1 change: 1 addition & 0 deletions lib/tinybucket/model/concerns/repository_keys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def inject_repo_keys(result)
when Tinybucket::Model::Page
result.items.map do |m|
next unless m.class.concern_included?(:RepositoryKeys)

m.repo_keys = repo_keys
end
when Tinybucket::Model::Base
Expand Down
3 changes: 1 addition & 2 deletions lib/tinybucket/model/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ module Model
# This attribute is a array of model instance created with
# 'values' attribute in json.
class Page
attr_reader :attrs
attr_reader :items
attr_reader :attrs, :items

# Initialize with json and Model class.
#
Expand Down
8 changes: 5 additions & 3 deletions spec/support/api_response_macros.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ def api_path(path, params = {})
def query_string(params)
return '' if params.empty?

'?' + params.each_pair.map do |k, v|
URI.escape(k.to_s) + '=' + URI.escape(v.to_s)
end.join('&')
key_values = params.to_a.map do |v|
[v[0].to_s, v[1].to_s]
end

'?' + URI.encode_www_form(key_values)
end

def fixture_json(method, path, ext)
Expand Down
8 changes: 4 additions & 4 deletions tinybucket.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Gem::Specification.new do |spec|

spec.add_runtime_dependency 'activemodel', ['>= 4.1.6']
spec.add_runtime_dependency 'activesupport', ['>= 4.1.6']
spec.add_runtime_dependency 'faraday', ['~> 0.9']
spec.add_runtime_dependency 'faraday_middleware', ['~> 0.10']
spec.add_runtime_dependency 'faraday-http-cache', ['~> 1.2']
spec.add_runtime_dependency 'faraday', ['~> 1.3']
spec.add_runtime_dependency 'faraday_middleware', ['~> 1.0']
spec.add_runtime_dependency 'faraday-http-cache', ['~> 2.2']
spec.add_runtime_dependency 'simple_oauth', ['~> 0.3']

spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'bundler', '>= 2.2.33'
end

0 comments on commit bbba4e8

Please sign in to comment.