syobocalite 0.1.1 → 1.0.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: f7f070e10f14d7a0c05cb53c7174b79743733ea920021b19eda731a690925847
4
- data.tar.gz: bf7cb84980a92810e73bfa70ac0ed432851f14517617ce56b260ad80ede919fb
3
+ metadata.gz: 27047202eef018b20e894d68c9c77a429a3bed348228239889e0cf76925b8f3a
4
+ data.tar.gz: 8c8c19bbd0c9c140f8c61802fd6d8a8f6f136c9fa5226344001026c5ff7345ad
5
5
  SHA512:
6
- metadata.gz: d0d529f375366b4ebf8f551365bcf9dda0f299717a1fcf571e3d6aad04367ee998b4da09e22491cafdff79c321468bc47ec9dae69e205b7b8c873b1bcd5b95ab
7
- data.tar.gz: 93fe3b38ae5498d3f76fa232f88eca0fc5ccde2b11de8e1504f3741329833e22910a6e465fcd79f16534f3f0b99acf54a4d966dbd552b1c12bd875b9eb703837
6
+ metadata.gz: c1f677c0e2848b61a575b5d008b7b47f5a6e91d5a28ad1755a0d4cd5272ade7ba29802e57178047c2b0baf789a30f4289c940a7e80705ff1b09330e8cddeddd8
7
+ data.tar.gz: df34dd8b948c3ffbc14b975a7475f4116ae846712c9fc95c81f752be50091986c8099fcb1d0c8ecf75b9aa7f41869f79239e232b893789ece21e78ced5f34a96
@@ -0,0 +1,138 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ schedule:
6
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
7
+
8
+ env:
9
+ CI: "true"
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ${{ matrix.runner }}
14
+
15
+ strategy:
16
+ fail-fast: false
17
+
18
+ matrix:
19
+ ruby:
20
+ - 2.5.0
21
+ - 2.6.0
22
+ - 2.7.0
23
+ - 2.8.0-dev
24
+ include:
25
+ - ruby: 2.5.0
26
+ runner: ubuntu-latest
27
+ - ruby: 2.6.0
28
+ runner: ubuntu-latest
29
+ - ruby: 2.7.0
30
+ runner: ubuntu-latest
31
+ - ruby: 2.8.0-dev
32
+ runner: ubuntu-latest
33
+
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+
37
+ - name: Set up rbenv
38
+ uses: masa-iwasaki/setup-rbenv@1.1.0
39
+
40
+ - name: Cache RBENV_ROOT
41
+ uses: actions/cache@v1
42
+ id: cache_rbenv
43
+ with:
44
+ path: ~/.rbenv/versions
45
+ key: v1-rbenv-${{ runner.os }}-${{ matrix.ruby }}
46
+ if: "!endsWith(matrix.ruby, '-dev')"
47
+
48
+ - name: Reinstall libssl-dev
49
+ run: |
50
+ set -xe
51
+ sudo apt-get remove -y libssl-dev
52
+ sudo apt-get install -y libssl-dev=1.0.2g-1ubuntu4.15
53
+ if: matrix.runner == 'ubuntu-16.04'
54
+
55
+ - name: Install Ruby
56
+ run: |
57
+ set -xe
58
+ eval "$(rbenv init -)"
59
+ rbenv install -s $RBENV_VERSION
60
+
61
+ gem install bundler --no-document -v 1.17.3 || true
62
+ env:
63
+ RBENV_VERSION: ${{ matrix.ruby }}
64
+ continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}
65
+
66
+ - name: Generate unique cache key
67
+ run: uuidgen > uuid.txt
68
+
69
+ - name: Cache vendor/bundle
70
+ uses: actions/cache@v1
71
+ id: cache_gem
72
+ with:
73
+ path: vendor/bundle
74
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('uuid.txt') }}
75
+ restore-keys: |
76
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
77
+ continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}
78
+
79
+ - name: bundle update
80
+ run: |
81
+ set -xe
82
+ eval "$(rbenv init -)"
83
+ bundle config path vendor/bundle
84
+ bundle update --jobs $(nproc) --retry 3
85
+ env:
86
+ RBENV_VERSION: ${{ matrix.ruby }}
87
+ continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}
88
+
89
+ - name: Setup Code Climate Test Reporter
90
+ uses: aktions/codeclimate-test-reporter@v1
91
+ with:
92
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
93
+ command: before-build
94
+ continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}
95
+
96
+ - name: Run test
97
+ run: |
98
+ set -xe
99
+ eval "$(rbenv init -)"
100
+ bundle exec rspec
101
+ env:
102
+ RBENV_VERSION: ${{ matrix.ruby }}
103
+ continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}
104
+
105
+ - name: Teardown Code Climate Test Reporter
106
+ uses: aktions/codeclimate-test-reporter@v1
107
+ with:
108
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
109
+ command: after-build
110
+ if: always()
111
+ continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}
112
+
113
+ - name: Slack Notification (not success)
114
+ uses: homoluctus/slatify@v2.0.0
115
+ if: "! success()"
116
+ with:
117
+ job_name: ${{ format('*build* ({0})', matrix.ruby) }}
118
+ type: ${{ job.status }}
119
+ icon_emoji: ":octocat:"
120
+ url: ${{ secrets.SLACK_WEBHOOK }}
121
+ token: ${{ secrets.GITHUB_TOKEN }}
122
+
123
+ notify:
124
+ needs:
125
+ - test
126
+
127
+ runs-on: ubuntu-latest
128
+
129
+ steps:
130
+ - name: Slack Notification (success)
131
+ uses: homoluctus/slatify@v2.0.0
132
+ if: always()
133
+ with:
134
+ job_name: '*build*'
135
+ type: ${{ job.status }}
136
+ icon_emoji: ":octocat:"
137
+ url: ${{ secrets.SLACK_WEBHOOK }}
138
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -1,7 +1,18 @@
1
1
  ## master
2
- [full changelog](https://github.com/sue445/syobocalite/compare/v0.1.1...master)
2
+ [full changelog](https://github.com/sue445/syobocalite/compare/v1.0.0...master)
3
3
 
4
- ## 0.1.0
4
+ ## 1.0.0
5
+ [full changelog](https://github.com/sue445/syobocalite/compare/v0.1.1...v1.0.0)
6
+
7
+ ### BREAKING CHANGES :bomb
8
+ * Drop support ruby 2.3 and 2.4
9
+ * https://github.com/sue445/syobocalite/pull/14
10
+
11
+ ### Refactorings
12
+ * Resolved. warning on ruby 2.7
13
+ * https://github.com/sue445/syobocalite/pull/13
14
+
15
+ ## 0.1.1
5
16
  [full changelog](https://github.com/sue445/syobocalite/compare/v0.1.0...v0.1.1)
6
17
 
7
18
  * Refactor `Syobocalite::Program#Initialize`
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Lite client for [Syoboi calendar](http://cal.syoboi.jp/) API.
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/syobocalite.svg)](https://badge.fury.io/rb/syobocalite)
6
- [![Build Status](https://travis-ci.org/sue445/syobocalite.svg?branch=master)](https://travis-ci.org/sue445/syobocalite)
6
+ [![Build Status](https://github.com/sue445/syobocalite/workflows/test/badge.svg?branch=master)](https://github.com/sue445/syobocalite/actions?query=workflow%3Atest)
7
7
  [![Coverage Status](https://coveralls.io/repos/github/sue445/syobocalite/badge.svg?branch=master)](https://coveralls.io/github/sue445/syobocalite?branch=master)
8
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/9f77793acf8d5c24886e/maintainability)](https://codeclimate.com/github/sue445/syobocalite/maintainability)
9
9
 
@@ -44,6 +44,11 @@ Syobocalite.search(start_at: start_at, end_at: end_at)
44
44
 
45
45
  `Syobocalite.search` returns `Array` of [`Syobocalite::Program`](lib/syobocalite/program.rb)
46
46
 
47
+ ## vs. [syobocal](https://github.com/xmisao/syobocal)
48
+ * Supports only `http://cal.syoboi.jp/cal_chk.php`
49
+ * Supports `Time` and [`ActiveSupport::TimeWithZone`](https://api.rubyonrails.org/classes/ActiveSupport/TimeWithZone.html)
50
+ * Returns array of PORO (NOT array of `Hash`)
51
+
47
52
  ## Development
48
53
 
49
54
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -10,5 +10,25 @@ require "syobocalite"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
+ class Syobocalite::Program
14
+ def to_fixture
15
+ <<~RUBY
16
+ Syobocalite::Program.new(
17
+ pid: #{pid},
18
+ tid: #{tid},
19
+ st_time: "#{st_time.strftime("%Y-%m-%d %H:%M:%S")}".in_time_zone,
20
+ ed_time: "#{ed_time.strftime("%Y-%m-%d %H:%M:%S")}".in_time_zone,
21
+ ch_name: "#{ch_name}",
22
+ ch_id: #{ch_id},
23
+ count: #{count},
24
+ st_offset: #{st_offset},
25
+ sub_title: "#{sub_title}",
26
+ title: "#{title}",
27
+ prog_comment: "#{prog_comment}",
28
+ )
29
+ RUBY
30
+ end
31
+ end
32
+
13
33
  require "irb"
14
34
  IRB.start(__FILE__)
@@ -41,7 +41,7 @@ module Syobocalite
41
41
  "User-Agent" => "Syobocalite v#{Syobocalite::VERSION}",
42
42
  }
43
43
 
44
- open("http://cal.syoboi.jp/cal_chk.php?#{params.to_param}", headers).read
44
+ URI.open("http://cal.syoboi.jp/cal_chk.php?#{params.to_param}", headers).read
45
45
  end
46
46
  private_class_method :fetch
47
47
  end
@@ -9,11 +9,11 @@ module Syobocalite
9
9
  attr_accessor :tid
10
10
 
11
11
  # @!attribute st_time
12
- # @return [TimeWithZone]
12
+ # @return [ActiveSupport::TimeWithZone]
13
13
  attr_accessor :st_time
14
14
 
15
15
  # @!attribute ed_time
16
- # @return [TimeWithZone]
16
+ # @return [ActiveSupport::TimeWithZone]
17
17
  attr_accessor :ed_time
18
18
 
19
19
  # @!attribute ch_name
@@ -46,8 +46,8 @@ module Syobocalite
46
46
 
47
47
  # @param pid [Integer]
48
48
  # @param tid [Integer]
49
- # @param st_time [TimeWithZone]
50
- # @param ed_time [TimeWithZone]
49
+ # @param st_time [ActiveSupport::TimeWithZone]
50
+ # @param ed_time [ActiveSupport::TimeWithZone]
51
51
  # @param ch_name [String]
52
52
  # @param ch_id [Integer]
53
53
  # @param count [Integer]
@@ -1,3 +1,3 @@
1
1
  module Syobocalite
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -34,11 +34,12 @@ Gem::Specification.new do |spec|
34
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
35
  spec.require_paths = ["lib"]
36
36
 
37
+ spec.required_ruby_version = ">= 2.5.0"
38
+
37
39
  spec.add_dependency "activesupport"
38
40
  spec.add_dependency "multi_xml"
39
41
 
40
- spec.add_development_dependency "bundler", "~> 1.16"
41
- spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0.0"
42
+ spec.add_development_dependency "bundler", ">= 1.16"
42
43
  spec.add_development_dependency "coveralls"
43
44
  spec.add_development_dependency "pry-byebug"
44
45
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syobocalite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-09 00:00:00.000000000 Z
11
+ date: 2020-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -42,30 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.16'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.16'
55
- - !ruby/object:Gem::Dependency
56
- name: codeclimate-test-reporter
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 1.0.0
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 1.0.0
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: coveralls
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -172,9 +158,9 @@ extensions: []
172
158
  extra_rdoc_files: []
173
159
  files:
174
160
  - ".coveralls.yml"
161
+ - ".github/workflows/test.yml"
175
162
  - ".gitignore"
176
163
  - ".rspec"
177
- - ".travis.yml"
178
164
  - ".yardopts"
179
165
  - CHANGELOG.md
180
166
  - Gemfile
@@ -202,15 +188,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
202
188
  requirements:
203
189
  - - ">="
204
190
  - !ruby/object:Gem::Version
205
- version: 2.3.0
191
+ version: 2.5.0
206
192
  required_rubygems_version: !ruby/object:Gem::Requirement
207
193
  requirements:
208
194
  - - ">="
209
195
  - !ruby/object:Gem::Version
210
196
  version: '0'
211
197
  requirements: []
212
- rubyforge_project:
213
- rubygems_version: 2.7.7
198
+ rubygems_version: 3.1.2
214
199
  signing_key:
215
200
  specification_version: 4
216
201
  summary: Lite client for Syoboi calendar
@@ -1,26 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3
4
- - 2.4
5
- - 2.5
6
- - ruby-head
7
- bundler_args: "--jobs=4"
8
- cache: bundler
9
- before_install:
10
- - gem update --system --no-document
11
- - gem install bundler --no-document
12
- before_script:
13
- - export CODECLIMATE_REPO_TOKEN=82d5b98775f7517294816845556790951867aba59db59a59178f0bed50a44216
14
- script:
15
- - bundle exec rspec
16
- # - bundle exec codeclimate-test-reporter || true
17
- branches:
18
- only:
19
- - master
20
- matrix:
21
- allow_failures:
22
- - rvm: ruby-head
23
- sudo: false
24
- notifications:
25
- slack:
26
- secure: GZZkyEmKBlwECsm47m+8XOcQhNcXciPsUhXfrAFBfTRxwCCy7myUBXL7aSV9T10N+QQX1rVilkD1zHRgX3U2S/S8xQfafrYiv5ZNDXp6xrNqGPC3WNGGY9PzvhJxpacp05qXxWXR5ml3Uk+1IZIoWJIPNtUVAgVO2gg6eLegHMiR2DwFmylW3nbfY6ozb6lo00rBih/k8KFqKZwo7odbdWN5LMPPH5vzO2f3sTF/3F8KsgxhESoA9hBLymDlcofEJ0gThXIH0T1WQGRmPpjJu5CSt5DAgDJxoJ/DjHy02ZJi/2vy8WnM2TGNI0sGInp/0GYb8AntpnyDw57UF2MCW4pYBqVgGfUxRHunzhLTtUI870BrQN0UHzHvnMgyxXCLZYN7rMqBuptQXRseWXzWovDHBEeGtYaEf41aOCX9bi/KC+k4FEeK6eJIXW5FXBC6TOnQTYvCx1V2BDdqH2jzxfSEtyA7rJlzDr+CajfsT25H+izqUQF7s5JxtcPuYoHXfxN420Qpfylvmje312WnccKXQKqdX4K/MWy+PM2VsU74EWCUy52flMonqKblyPWGn+Eo4LxGGRkq68lzVH02fwlF9QiIX0jjFkLPyHrw2+kxDK4g2S5+VxIOsKq2IYssXuEfGlXHuv3TRLb3Z8taqgS1zqZ5U1pVfQhLkCDSikM=