pixela 1.4.0 → 1.4.1

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: 375d6ec8ab2c9c4be2747ba45a7c820ced86af17de33af609d9dd1113838b029
4
- data.tar.gz: daf59f70e4899e6bb62dd3ea3f2f1e8406d9de8172b47e22b90a462d1cceee2e
3
+ metadata.gz: 53c7211a5d3d1d0b5bc7f843ab52ba13976b0f6a18f1243f338d8adc8110406a
4
+ data.tar.gz: ef86b1344cce92f3a1291f3b37c21a9ab695270f8f0abeda85c44d3afbe8b24d
5
5
  SHA512:
6
- metadata.gz: 44f9c7ff48301f987d0978320fe637b4881680f9c18afecd5034ca475c1207fd23a11113f21588ad596f0e6018f213bfc70902b4d91043c144ba87bb07f367ad
7
- data.tar.gz: ac91d230a786cba5a1a3599fa9cb4ade64a2965dd1c3086be6a57ea9997c02af8937363e246da7d14e9518fa5ead6591767f533ed23f6b32da56562145801349
6
+ metadata.gz: d3f7450e3005b50b3ccb5408d2cd11dd3b1ca12b501f34997df5aed45d2fc4bd9529487e77d24909ca9261371c1c4442856e8bfcb6394c9ce3e83035b4da9709
7
+ data.tar.gz: 311768323e48e9ffe019bd06cc4a33922ad31b2d41efb399b84afef2cc0193e9d52c3870ecdb4983039b4a5c94cf427be1b9245edc9b2f76086f1f6f528194f7
@@ -0,0 +1,123 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ env:
16
+ CI: "true"
17
+
18
+ jobs:
19
+ test:
20
+ runs-on: ubuntu-latest
21
+
22
+ container: ${{ matrix.ruby }}
23
+
24
+ env:
25
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}
26
+
27
+ strategy:
28
+ fail-fast: false
29
+
30
+ matrix:
31
+ ruby:
32
+ - ruby:2.3
33
+ - ruby:2.4
34
+ - ruby:2.5
35
+ - ruby:2.6
36
+ - ruby:2.7
37
+ - rubylang/ruby:master-nightly-bionic
38
+ gemfile:
39
+ - faraday_0.gemfile
40
+ - faraday_1.gemfile
41
+ include:
42
+ - ruby: rubylang/ruby:master-nightly-bionic
43
+ allow_failures: "true"
44
+
45
+ steps:
46
+ - uses: actions/checkout@v2
47
+
48
+
49
+ - name: Cache gemfiles/vendor/bundle
50
+ uses: actions/cache@v1
51
+ id: cache_gem
52
+ with:
53
+ path: gemfiles/vendor/bundle
54
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ github.sha }}
55
+ restore-keys: |
56
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.gemfile }}-
57
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
58
+
59
+ - name: bundle update
60
+ run: |
61
+ set -xe
62
+ bundle config path vendor/bundle
63
+ bundle update --jobs $(nproc) --retry 3
64
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
65
+
66
+ - name: Setup Code Climate Test Reporter
67
+ uses: aktions/codeclimate-test-reporter@v1
68
+ with:
69
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
70
+ command: before-build
71
+ continue-on-error: true
72
+
73
+ - name: Run test
74
+ run: |
75
+ set -xe
76
+ bundle exec rspec
77
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
78
+
79
+ - name: Teardown Code Climate Test Reporter
80
+ uses: aktions/codeclimate-test-reporter@v1
81
+ with:
82
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
83
+ command: after-build
84
+ continue-on-error: true
85
+
86
+ - name: Invoke Pixela webhook
87
+ run: |
88
+ if [ -n "$PIXELA_WEBHOOK_URL" ]; then
89
+ curl -X POST $PIXELA_WEBHOOK_URL -H 'Content-Length:0'
90
+ fi
91
+ env:
92
+ PIXELA_WEBHOOK_URL: ${{ secrets.PIXELA_WEBHOOK_URL }}
93
+ if: always()
94
+ continue-on-error: true
95
+
96
+ - name: Slack Notification (not success)
97
+ uses: homoluctus/slatify@master
98
+ if: "! success()"
99
+ continue-on-error: true
100
+ with:
101
+ job_name: ${{ format('*build* ({0}, {1})', matrix.ruby, matrix.gemfile) }}
102
+ type: ${{ job.status }}
103
+ icon_emoji: ":octocat:"
104
+ url: ${{ secrets.SLACK_WEBHOOK }}
105
+ token: ${{ secrets.GITHUB_TOKEN }}
106
+
107
+ notify:
108
+ needs:
109
+ - test
110
+
111
+ runs-on: ubuntu-latest
112
+
113
+ steps:
114
+ - name: Slack Notification (success)
115
+ uses: homoluctus/slatify@master
116
+ if: always()
117
+ continue-on-error: true
118
+ with:
119
+ job_name: '*build*'
120
+ type: ${{ job.status }}
121
+ icon_emoji: ":octocat:"
122
+ url: ${{ secrets.SLACK_WEBHOOK }}
123
+ token: ${{ secrets.GITHUB_TOKEN }}
data/.gitignore CHANGED
@@ -10,5 +10,5 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
 
13
- Gemfile.lock
13
+ *.lock
14
14
  .env
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
- [full changelog](http://github.com/sue445/pixela/compare/v1.4.0...master)
2
+ [full changelog](http://github.com/sue445/pixela/compare/v1.4.1...master)
3
+
4
+ ## v1.4.1
5
+ [full changelog](http://github.com/sue445/pixela/compare/v1.4.0...v1.4.1)
6
+
7
+ * Support faraday v1.0
8
+ * https://github.com/sue445/pixela/pull/63
3
9
 
4
10
  ## v1.4.0
5
11
  [full changelog](http://github.com/sue445/pixela/compare/v1.3.1...v1.4.0)
data/README.md CHANGED
@@ -3,7 +3,8 @@
3
3
  [Pixela](https://pixe.la/) API client for Ruby
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/pixela.svg)](https://badge.fury.io/rb/pixela)
6
- [![Build Status](https://travis-ci.org/sue445/pixela.svg?branch=master)](https://travis-ci.org/sue445/pixela)
6
+ [![CI activity of pixela-gem](https://pixe.la/v1/users/sue445/graphs/pixela-gem-ci?mode=badge)](https://pixe.la/v1/users/sue445/graphs/pixela-gem-ci.html)
7
+ [![Build Status](https://github.com/sue445/pixela/workflows/test/badge.svg?branch=master)](https://github.com/sue445/pixela/actions?query=workflow%3Atest)
7
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/4c6316222717ee809b57/maintainability)](https://codeclimate.com/github/sue445/pixela/maintainability)
8
9
  [![Coverage Status](https://coveralls.io/repos/github/sue445/pixela/badge.svg)](https://coveralls.io/github/sue445/pixela)
9
10
 
@@ -13,5 +13,5 @@ Dotenv.load
13
13
 
14
14
  Pixela.config.debug_logger = Logger.new(STDOUT)
15
15
 
16
- require "pry"
17
- Pry.start
16
+ require "irb"
17
+ IRB.start
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in pixela.gemspec
6
+ gemspec path: "../"
7
+
8
+ gem "faraday", "~> 0.17"
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in pixela.gemspec
6
+ gemspec path: "../"
7
+
8
+ gem "faraday", "~> 1.0"
@@ -81,7 +81,7 @@ module Pixela
81
81
 
82
82
  def with_error_handling
83
83
  yield
84
- rescue Faraday::ClientError => error
84
+ rescue *faraday_errors => error
85
85
  begin
86
86
  body = JSON.parse(error.response[:body])
87
87
  raise PixelaError, body["message"]
@@ -90,6 +90,14 @@ module Pixela
90
90
  end
91
91
  end
92
92
 
93
+ def faraday_errors
94
+ if Gem::Version.create(Faraday::VERSION) >= Gem::Version.create("1.0.0")
95
+ return [Faraday::ClientError, Faraday::ServerError]
96
+ end
97
+
98
+ [Faraday::Error::ClientError]
99
+ end
100
+
93
101
  def default_headers
94
102
  {
95
103
  "User-Agent" => "Pixela v#{Pixela::VERSION} (https://github.com/sue445/pixela)",
@@ -1,3 +1,3 @@
1
1
  module Pixela
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
@@ -44,12 +44,12 @@ Gem::Specification.new do |spec|
44
44
  spec.add_development_dependency "bundler", ">= 1.16"
45
45
  spec.add_development_dependency "coveralls"
46
46
  spec.add_development_dependency "dotenv"
47
- spec.add_development_dependency "pry-byebug"
48
- spec.add_development_dependency "rake", "~> 10.0"
47
+ spec.add_development_dependency "rake", ">= 10.0"
49
48
  spec.add_development_dependency "rspec", "~> 3.0"
50
49
  spec.add_development_dependency "rspec-its"
51
50
  spec.add_development_dependency "rspec-parameterized"
52
51
  spec.add_development_dependency "simplecov"
52
+ spec.add_development_dependency "unparser", ">= 0.4.5"
53
53
  spec.add_development_dependency "webmock"
54
54
  spec.add_development_dependency "yard"
55
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixela
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-23 00:00:00.000000000 Z
11
+ date: 2020-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -108,32 +108,18 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: pry-byebug
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: rake
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - "~>"
115
+ - - ">="
130
116
  - !ruby/object:Gem::Version
131
117
  version: '10.0'
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - "~>"
122
+ - - ">="
137
123
  - !ruby/object:Gem::Version
138
124
  version: '10.0'
139
125
  - !ruby/object:Gem::Dependency
@@ -192,6 +178,20 @@ dependencies:
192
178
  - - ">="
193
179
  - !ruby/object:Gem::Version
194
180
  version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: unparser
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: 0.4.5
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: 0.4.5
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: webmock
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -229,9 +229,9 @@ extra_rdoc_files: []
229
229
  files:
230
230
  - ".coveralls.yml"
231
231
  - ".env.example"
232
+ - ".github/workflows/test.yml"
232
233
  - ".gitignore"
233
234
  - ".rspec"
234
- - ".travis.yml"
235
235
  - ".yardopts"
236
236
  - CHANGELOG.md
237
237
  - Gemfile
@@ -240,6 +240,8 @@ files:
240
240
  - Rakefile
241
241
  - bin/console
242
242
  - bin/setup
243
+ - gemfiles/faraday_0.gemfile
244
+ - gemfiles/faraday_1.gemfile
243
245
  - lib/pixela.rb
244
246
  - lib/pixela/channel.rb
245
247
  - lib/pixela/client.rb
@@ -279,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
281
  - !ruby/object:Gem::Version
280
282
  version: '0'
281
283
  requirements: []
282
- rubygems_version: 3.0.6
284
+ rubygems_version: 3.1.2
283
285
  signing_key:
284
286
  specification_version: 4
285
287
  summary: Pixela API client for Ruby
@@ -1,40 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3
4
- - 2.4
5
- - 2.5
6
- - 2.6
7
- - ruby-head
8
- bundler_args: "--jobs=2"
9
- cache: bundler
10
- before_install:
11
- - travis_retry gem update --system || travis_retry gem update --system 2.7.8
12
- - travis_retry gem install bundler --no-document || travis_retry gem install bundler --no-document -v 1.17.3
13
- before_script:
14
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
15
- - chmod +x ./cc-test-reporter
16
- - ./cc-test-reporter before-build
17
- script:
18
- - RUBYOPT=$RSPEC_RUBYOPT bundle exec rspec
19
- after_script:
20
- - if [ "$PIXELA_WEBHOOK_URL" != "" ]; then curl -X POST $PIXELA_WEBHOOK_URL -H 'Content-Length:0'; fi
21
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
22
- branches:
23
- only:
24
- - master
25
- notifications:
26
- email: false
27
- slack:
28
- secure: ec/Q9tFK+TjW7ZVOWg8NPfa4IFfbU24ljqObG7YhlaYaIN63MMdMITfy17sQahm2T0x7jhAzxDo1pDTb9XoBs12cu2wogZltv+daZwATWYzipvUxQqge1yywnFn3QLfQyzAl5p1MYkxLpJeVDRD8wunmc2OikR4jMtl5KDk9e2sItHGJdfPY8mFhM+sKaLyy9mbGo02aqRqwhgXGFQg1lZ/D6qPZKPSAd+S+uJgma8En4P292APBN9hsgpjC4HGqiqhPumOyjmdiVZ//4QoYhIEaMGJiwKyv9GwS0cTfk6w9MNFRILhj4tN3kP8ZsI7h5oQy8+x0Deac9joTKMNVarvZkVFZWLZ3p8mthdsRNKZeYxkSgnrhwA/3CFe/THjolfROA61iQqWxFycdIqSieiGHZ57EvHo7HOSD5Kc0017X+UITjiWiKiSQPddPmYm5hl9lo9rBo1RaJRr6B5A2qrw2SBmNfH38+BDTMFZprJLN51LBJ4DEy4R0CClbyIk6DbODsWqQC+W+6sOCWOhrVXSeSVlxPz7hT24ezkcMLMvoA5k9f6Gi2cWWDD9CmRI2Upt+5lx0Ui1/9xbk4RG6/hue8L764jdQ2mqNtrAZJSjdfs9KxapoKFllezdwhNVJS4UoU6PT9DU227cHH3SWHYm9GHu/pQ6kdhBGcr/EMiY=
29
- matrix:
30
- allow_failures:
31
- - rvm: ruby-head
32
- include:
33
- - rvm: 2.6
34
- env: RSPEC_RUBYOPT="--jit"
35
- - rvm: ruby-head
36
- env: RSPEC_RUBYOPT="--jit"
37
- sudo: false
38
- env:
39
- global:
40
- - CC_TEST_REPORTER_ID=67b1bed21e42834690bb57b148b93d6bd23410d8e013afdf6a89d66f36011a95