breacan 0.9.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 114f3618a6e60278a633ce4d583fff573e4064abf8fabdf1179a8662bc8e986f
4
- data.tar.gz: b56af77f0a6089ba2803667d36c895f61174acca76fa6bafd3d2932c1f8c1841
3
+ metadata.gz: da54b144e5c9d9e76e2685ef2d489590990f8b9dbbc709471ed914b4ce463746
4
+ data.tar.gz: 1cd80012d7aa3a44547e0abcdc740fdf6b744587200645e35e8f2d330fc02726
5
5
  SHA512:
6
- metadata.gz: b7b14d22955ba9e12ed37eae9c21555df800201c79229d4a2a7b6630ff89a5f8855ba63bf0c8fc8f8fd774c22bf159dad5f282fd5f8ec2e9ef7f3c15135a72bc
7
- data.tar.gz: f0ed5cad10a8c7e128d9c5424cff5665ec12aea67ce7067c66e21ee4fcd0d477ddccb91ca34fb564522cf56748db978cac9dc637c2d4cc86f4d05b3f0ce60ecc
6
+ metadata.gz: 1132d892c27e59a258a91eea1b15ea6e19f0622601a94aeaa8c4212c01e4cec6d4b40c0205826183ff8108e8ea9245ca0229b92c4698c8e2eaf908d4656e1f2e
7
+ data.tar.gz: '00688123bd5770cf72e145bfffb0e4f47864399cca8db8270680e79a6c0105339fd23b07e791b93f86336be61624f9d99eb1f60c00caad7ff966a7f457314b80'
@@ -0,0 +1,48 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ pull_request:
7
+ branches: [ "master" ]
8
+
9
+ jobs:
10
+ build:
11
+ name: Build + Publish
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ packages: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ - name: Set up Ruby
20
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
21
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
22
+ # uses: ruby/setup-ruby@v1
23
+ uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
24
+ with:
25
+ ruby-version: 3
26
+
27
+ - name: Publish to GPR
28
+ run: |
29
+ mkdir -p $HOME/.gem
30
+ touch $HOME/.gem/credentials
31
+ chmod 0600 $HOME/.gem/credentials
32
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
33
+ gem build *.gemspec
34
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
35
+ env:
36
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
37
+ OWNER: ${{ github.repository_owner }}
38
+
39
+ - name: Publish to RubyGems
40
+ run: |
41
+ mkdir -p $HOME/.gem
42
+ touch $HOME/.gem/credentials
43
+ chmod 0600 $HOME/.gem/credentials
44
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
45
+ gem build *.gemspec
46
+ gem push *.gem
47
+ env:
48
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
data/breacan.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "sawyer", "~> 0.6"
22
- spec.add_dependency "activesupport", "~>4.2"
22
+ spec.add_dependency "activesupport"
23
23
  spec.add_development_dependency "bundler", "~> 1.7"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
25
 
@@ -62,7 +62,13 @@ module Breacan
62
62
  r = request :get, url, parse_query_and_convenience_headers(options.merge({cursor: nextc}))
63
63
  if r.is_a?(Sawyer::Resource)
64
64
  res ||= {}
65
- res.to_hash.deep_merge!(r.to_hash)
65
+ res = res.deep_merge(r) do |key, this_val, other_val|
66
+ if this_val.is_a?(Array) && other_val.is_a?(Array)
67
+ this_val + other_val
68
+ else
69
+ other_val
70
+ end
71
+ end
66
72
  elsif r.is_a?(Array)
67
73
  res ||= []
68
74
  res.concat(r)
@@ -3,7 +3,11 @@ require 'breacan/error'
3
3
 
4
4
  module Breacan
5
5
  module Response
6
- class Custom < Faraday::Response::Middleware
6
+ # NOTE: Since faraday v.2, `Faraday::Response::Middleware` has been removed. We can use `Faraday::Middleware` instead.
7
+ # ref: https://github.com/lostisland/faraday/blob/c9cc1b30ecebcd57beffa67d275f68742b5b05c5/UPGRADING.md?plain=1#L128
8
+ middleware_base = defined?(Faraday::Response::Middleware) ? Faraday::Response::Middleware : Faraday::Middleware
9
+
10
+ class Custom < middleware_base
7
11
  private
8
12
 
9
13
  def on_complete(res)
@@ -1,3 +1,3 @@
1
1
  module Breacan
2
- VERSION = '0.9.0'
2
+ VERSION = '0.11.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breacan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - linyows
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-22 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sawyer
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.2'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '4.2'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -74,6 +74,7 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - ".github/workflows/gem-push.yml"
77
78
  - ".gitignore"
78
79
  - Gemfile
79
80
  - LICENSE.txt
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  requirements: []
124
- rubygems_version: 3.0.3
125
+ rubygems_version: 3.4.10
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: Simple Ruby wrapper for Slack API.