telepost 0.3.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdead157318cc6dc047c19b372c7f488d111e869a86bfd435d9e5577fc3c07f9
4
- data.tar.gz: e13c181e9352426f91c6d61c11fde3a9e5997eaf8a79156a328cfb16c552a96f
3
+ metadata.gz: f0edb0901c60fb97a116c0c8906d64533bec0d8fe2f4c1b801bcca26e877c44b
4
+ data.tar.gz: b8ef137fbb03e9a3dc12373741ad12a56df81e7f139c24f8fbf1f91d5036b633
5
5
  SHA512:
6
- metadata.gz: 7d31175e0889f2f5842101116165c3bf3fe0c646d8dec336f48a289a69a23914e32dc966b57990d1148ba46a95c7b888324f344bcb3501f10483407f551340ef
7
- data.tar.gz: 8c348b5bf2b689d4f9ac4bd17f772721c785f7fb482004ff967c5ffc66b66a0d42287b5b3b77b470378f372b7886a4d99ca95ee40a2eb3555682c0359871a487
6
+ metadata.gz: 86784f5f376383033d1c862993ea2426780b07bfbdc402ff17d7ea56ceeac8cec63e63e7077bd32475ed2fdfb395f08329144193cfd3d895d292479e5f8e3ebc
7
+ data.tar.gz: 99501c8ec53323c14a0684eff1067bd89456285aa47344974de5ab1c860044f8afdc9959464e8ff9a9f5fb30cdeddc3a61dd9a434e6df796abcc8667f328f903
data/.0pdd.yml CHANGED
@@ -1,8 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2018-2024 Yegor Bugayenko
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the 'Software'), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+ ---
1
23
  errors:
2
24
  - yegor256@gmail.com
3
- # alerts:
4
- # github:
5
- # - yegor256
6
25
 
7
26
  tags:
8
27
  - pdd
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: actionlint
22
+ 'on':
23
+ push:
24
+ branches:
25
+ - master
26
+ pull_request:
27
+ branches:
28
+ - master
29
+ jobs:
30
+ actionlint:
31
+ runs-on: ubuntu-24.04
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - name: Download actionlint
35
+ id: get_actionlint
36
+ # yamllint disable-line rule:line-length
37
+ run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
38
+ shell: bash
39
+ - name: Check workflow files
40
+ run: ${{ steps.get_actionlint.outputs.executable }} -color
41
+ shell: bash
@@ -0,0 +1,38 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: codecov
22
+ on:
23
+ push:
24
+ branches:
25
+ - master
26
+ jobs:
27
+ codecov:
28
+ runs-on: ubuntu-24.04
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: 3.2
34
+ - run: bundle update
35
+ - run: bundle exec rake
36
+ - uses: codecov/codecov-action@v4
37
+ with:
38
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,30 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: copyrights
22
+ 'on':
23
+ push:
24
+ pull_request:
25
+ jobs:
26
+ copyrights:
27
+ runs-on: ubuntu-24.04
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: yegor256/copyrights-action@0.0.5
@@ -0,0 +1,38 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: markdown-lint
22
+ 'on':
23
+ push:
24
+ branches:
25
+ - master
26
+ pull_request:
27
+ branches:
28
+ - master
29
+ paths-ignore: ['paper/**', 'sandbox/**']
30
+ concurrency:
31
+ group: markdown-lint-${{ github.ref }}
32
+ cancel-in-progress: true
33
+ jobs:
34
+ markdown-lint:
35
+ runs-on: ubuntu-24.04
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ - uses: articulate/actions-markdownlint@v1
@@ -0,0 +1,34 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: pdd
22
+ on:
23
+ push:
24
+ branches:
25
+ - master
26
+ pull_request:
27
+ branches:
28
+ - master
29
+ jobs:
30
+ pdd:
31
+ runs-on: ubuntu-24.04
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - uses: volodya-lombrozo/pdd-action@master
@@ -0,0 +1,43 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: rake
22
+ on:
23
+ push:
24
+ branches:
25
+ - master
26
+ pull_request:
27
+ branches:
28
+ - master
29
+ jobs:
30
+ test:
31
+ name: test
32
+ strategy:
33
+ matrix:
34
+ os: [ubuntu-24.04, macos-12, windows-2022]
35
+ ruby: [3.2, 3.3]
36
+ runs-on: ${{ matrix.os }}
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ${{ matrix.ruby }}
42
+ - run: bundle update
43
+ - run: bundle exec rake
@@ -0,0 +1,30 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: xcop
22
+ on:
23
+ push:
24
+ pull_request:
25
+ jobs:
26
+ xcop:
27
+ runs-on: ubuntu-24.04
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: g4s8/xcop-action@master
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
- Gemfile.lock
2
1
  *.gem
3
2
  .bundle/
4
3
  .DS_Store
5
4
  rdoc/
6
5
  .idea/
6
+ .yardoc/
7
+ doc/
data/.rubocop.yml CHANGED
@@ -1,6 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2018-2024 Yegor Bugayenko
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the 'Software'), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+ ---
1
23
  AllCops:
24
+ Exclude:
25
+ - 'bin/**/*'
26
+ - 'assets/**/*'
27
+ - 'vendor/**/*'
28
+ - 'j/**/*'
2
29
  DisplayCopNames: true
3
- TargetRubyVersion: 2.5
30
+ TargetRubyVersion: 3.2
31
+ NewCops: enable
32
+ SuggestExtensions: false
4
33
 
5
34
  Layout/EmptyLineAfterGuardClause:
6
35
  Enabled: false
@@ -16,5 +45,5 @@ Metrics/PerceivedComplexity:
16
45
  Max: 10
17
46
  Metrics/ParameterLists:
18
47
  Max: 10
19
- Layout/AlignParameters:
48
+ Layout/ParameterAlignment:
20
49
  Enabled: false
data/.rultor.yml CHANGED
@@ -1,12 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2018-2024 Yegor Bugayenko
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the 'Software'), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+ ---
23
+ docker:
24
+ image: yegor256/rultor-ruby
1
25
  assets:
2
26
  rubygems.yml: yegor256/home#assets/rubygems.yml
3
27
  install: |-
4
- export GEM_HOME=~/.ruby
5
- export GEM_PATH=$GEM_HOME:$GEM_PATH
28
+ pdd -f /dev/null
29
+ sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
6
30
  release:
31
+ pre: false
7
32
  script: |-
8
- bundle install
9
- rake
33
+ bundle exec rake
10
34
  rm -rf *.gem
11
35
  sed -i "s/0\.0\.0/${tag}/g" telepost.gemspec
12
36
  git add telepost.gemspec
@@ -14,13 +38,6 @@ release:
14
38
  gem build telepost.gemspec
15
39
  chmod 0600 ../rubygems.yml
16
40
  gem push *.gem --config-file ../rubygems.yml
17
- commanders:
18
- - yegor256
19
- architect:
20
- - yegor256
21
41
  merge:
22
- commanders: []
23
42
  script: |-
24
- bundle install
25
43
  bundle exec rake
26
- deploy: {}
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2019 Yegor Bugayenko
3
+ # Copyright (c) 2018-2024 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -21,5 +21,11 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  source 'https://rubygems.org'
24
- ruby '~>2.3'
25
24
  gemspec
25
+
26
+ gem 'minitest', '5.25.1', require: false
27
+ gem 'rake', '13.2.1', require: false
28
+ gem 'rubocop', '1.66.1', require: false
29
+ gem 'rubocop-rspec', '3.0.5', require: false
30
+ gem 'simplecov', '0.22.0', require: false
31
+ gem 'yard', '0.9.37', require: false
data/Gemfile.lock ADDED
@@ -0,0 +1,103 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ telepost (0.0.0)
5
+ telegram-bot-ruby (~> 1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ bigdecimal (3.1.8)
12
+ concurrent-ruby (1.3.4)
13
+ docile (1.4.1)
14
+ dry-core (1.0.1)
15
+ concurrent-ruby (~> 1.0)
16
+ zeitwerk (~> 2.6)
17
+ dry-inflector (1.1.0)
18
+ dry-logic (1.5.0)
19
+ concurrent-ruby (~> 1.0)
20
+ dry-core (~> 1.0, < 2)
21
+ zeitwerk (~> 2.6)
22
+ dry-struct (1.6.0)
23
+ dry-core (~> 1.0, < 2)
24
+ dry-types (>= 1.7, < 2)
25
+ ice_nine (~> 0.11)
26
+ zeitwerk (~> 2.6)
27
+ dry-types (1.7.2)
28
+ bigdecimal (~> 3.0)
29
+ concurrent-ruby (~> 1.0)
30
+ dry-core (~> 1.0)
31
+ dry-inflector (~> 1.0)
32
+ dry-logic (~> 1.4)
33
+ zeitwerk (~> 2.6)
34
+ faraday (2.12.0)
35
+ faraday-net_http (>= 2.0, < 3.4)
36
+ json
37
+ logger
38
+ faraday-multipart (1.0.4)
39
+ multipart-post (~> 2)
40
+ faraday-net_http (3.3.0)
41
+ net-http
42
+ ice_nine (0.11.2)
43
+ json (2.7.2)
44
+ language_server-protocol (3.17.0.3)
45
+ logger (1.6.1)
46
+ minitest (5.25.1)
47
+ multipart-post (2.4.1)
48
+ net-http (0.4.1)
49
+ uri
50
+ parallel (1.26.3)
51
+ parser (3.3.5.0)
52
+ ast (~> 2.4.1)
53
+ racc
54
+ racc (1.8.1)
55
+ rainbow (3.1.1)
56
+ rake (13.2.1)
57
+ regexp_parser (2.9.2)
58
+ rubocop (1.66.1)
59
+ json (~> 2.3)
60
+ language_server-protocol (>= 3.17.0)
61
+ parallel (~> 1.10)
62
+ parser (>= 3.3.0.2)
63
+ rainbow (>= 2.2.2, < 4.0)
64
+ regexp_parser (>= 2.4, < 3.0)
65
+ rubocop-ast (>= 1.32.2, < 2.0)
66
+ ruby-progressbar (~> 1.7)
67
+ unicode-display_width (>= 2.4.0, < 3.0)
68
+ rubocop-ast (1.32.3)
69
+ parser (>= 3.3.1.0)
70
+ rubocop-rspec (3.0.5)
71
+ rubocop (~> 1.61)
72
+ ruby-progressbar (1.13.0)
73
+ simplecov (0.22.0)
74
+ docile (~> 1.1)
75
+ simplecov-html (~> 0.11)
76
+ simplecov_json_formatter (~> 0.1)
77
+ simplecov-html (0.13.1)
78
+ simplecov_json_formatter (0.1.4)
79
+ telegram-bot-ruby (1.0.0)
80
+ dry-struct (~> 1.6)
81
+ faraday (~> 2.0)
82
+ faraday-multipart (~> 1.0)
83
+ zeitwerk (~> 2.6)
84
+ unicode-display_width (2.6.0)
85
+ uri (0.13.1)
86
+ yard (0.9.37)
87
+ zeitwerk (2.6.18)
88
+
89
+ PLATFORMS
90
+ arm64-darwin-22
91
+ ruby
92
+
93
+ DEPENDENCIES
94
+ minitest (= 5.25.1)
95
+ rake (= 13.2.1)
96
+ rubocop (= 1.66.1)
97
+ rubocop-rspec (= 3.0.5)
98
+ simplecov (= 0.22.0)
99
+ telepost!
100
+ yard (= 0.9.37)
101
+
102
+ BUNDLED WITH
103
+ 2.5.18
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Yegor Bugayenko
3
+ Copyright (c) 2018-2024 Yegor Bugayenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,24 +1,24 @@
1
- <img src="/logo.svg" width="64px" height="64px"/>
1
+ # Ruby Telegram Client
2
2
 
3
3
  [![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
4
4
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/telepost)](http://www.rultor.com/p/yegor256/telepost)
5
5
  [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
6
6
 
7
- [![Build Status](https://travis-ci.org/yegor256/telepost.svg)](https://travis-ci.org/yegor256/telepost)
7
+ [![rake](https://github.com/yegor256/telepost/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/telepost/actions/workflows/rake.yml)
8
8
  [![Gem Version](https://badge.fury.io/rb/telepost.svg)](http://badge.fury.io/rb/telepost)
9
9
  [![Maintainability](https://api.codeclimate.com/v1/badges/21aec58faee3866bdfbb/maintainability)](https://codeclimate.com/github/yegor256/telepost/maintainability)
10
10
  [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/telepost/master/frames)
11
-
12
11
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/telepost)](https://hitsofcode.com/view/github/yegor256/telepost)
13
12
 
14
- Telepost is a simple gateway to Telegram, which can post messages and respond to primitive requests.
13
+ Telepost is a simple gateway to Telegram, which can post messages
14
+ and respond to primitive requests.
15
15
 
16
16
  First, get your token from [@BotFather](https://t.me/BotFather).
17
17
 
18
18
  Then, install it:
19
19
 
20
20
  ```bash
21
- $ gem install telepost
21
+ gem install telepost
22
22
  ```
23
23
 
24
24
  Then, use it like this:
@@ -50,14 +50,16 @@ That's it.
50
50
 
51
51
  ## How to contribute
52
52
 
53
- Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
53
+ Read
54
+ [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
54
55
  Make sure you build is green before you contribute
55
- your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
56
+ your pull request. You will need to have
57
+ [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
56
58
  [Bundler](https://bundler.io/) installed. Then:
57
59
 
58
- ```
59
- $ bundle update
60
- $ bundle exec rake
60
+ ```bash
61
+ bundle update
62
+ bundle exec rake
61
63
  ```
62
64
 
63
65
  If it's clean and you don't see any error messages, submit your pull request.
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2019 Yegor Bugayenko
3
+ # Copyright (c) 2018-2024 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -34,7 +34,7 @@ def version
34
34
  Gem::Specification.load(Dir['*.gemspec'].first).version
35
35
  end
36
36
 
37
- task default: %i[clean test rubocop]
37
+ task default: %i[clean test yard rubocop]
38
38
 
39
39
  require 'rake/testtask'
40
40
  desc 'Run all unit tests'
@@ -44,16 +44,15 @@ Rake::TestTask.new(:test) do |test|
44
44
  test.verbose = false
45
45
  end
46
46
 
47
- require 'rdoc/task'
48
- RDoc::Task.new do |rdoc|
49
- rdoc.main = 'README.md'
50
- rdoc.rdoc_dir = 'rdoc'
51
- rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')
52
- end
53
-
54
47
  require 'rubocop/rake_task'
55
48
  desc 'Run RuboCop on all directories'
56
49
  RuboCop::RakeTask.new(:rubocop) do |task|
57
50
  task.fail_on_error = true
58
51
  task.requires << 'rubocop-rspec'
59
52
  end
53
+
54
+ require 'yard'
55
+ desc 'Build Yard documentation'
56
+ YARD::Rake::YardocTask.new do |t|
57
+ t.files = ['lib/**/*.rb']
58
+ end
data/lib/telepost.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # (The MIT License)
4
4
  #
5
- # Copyright (c) 2018-2019 Yegor Bugayenko
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -22,7 +22,7 @@
22
22
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
23
  # SOFTWARE.
24
24
 
25
- require 'telebot'
25
+ require 'telegram/bot'
26
26
 
27
27
  # Telepost is a simple gateway to Telegram, which can post messages and
28
28
  # respond to primitive requests:
@@ -37,12 +37,13 @@ require 'telebot'
37
37
  # {README}[https://github.com/yegor256/telepost/blob/master/README.md] file.
38
38
  #
39
39
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
40
- # Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
40
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
41
41
  # License:: MIT
42
42
  class Telepost
43
43
  # Fake one
44
44
  class Fake
45
45
  attr_reader :sent
46
+
46
47
  def initialize
47
48
  @sent = []
48
49
  end
@@ -70,25 +71,16 @@ class Telepost
70
71
  # to the @BotFather in Telegram.
71
72
  def initialize(token, chats: [])
72
73
  @token = token
73
- @client = Telebot::Client.new(token)
74
74
  @chats = chats
75
+ @bot = Telegram::Bot::Client.new(@token)
75
76
  end
76
77
 
77
78
  # You can run a chat bot to listen to the messages coming to it, in
78
79
  # a separate thread.
79
80
  def run
80
- Telebot::Bot.new(@token).run do |chat, message|
81
- if block_given?
82
- yield(chat, message)
83
- elsif !chat.nil?
84
- id = message.chat.id
85
- if id.positive?
86
- post(
87
- message.chat.id,
88
- "This is your chat ID: `#{message.chat.id}`."
89
- )
90
- end
91
- end
81
+ raise 'Block must be given' unless block_given?
82
+ @bot.listen do |message|
83
+ yield(message.chat.id, message.text)
92
84
  end
93
85
  rescue Net::OpenTimeout
94
86
  retry
@@ -109,14 +101,11 @@ class Telepost
109
101
  # be the admin there). The lines provided will be
110
102
  # concatenated with a space between them.
111
103
  def post(chat, *lines)
112
- msg = lines.join(' ')
113
- @client.send_message(
104
+ @bot.send_message(
114
105
  chat_id: chat,
115
106
  parse_mode: 'Markdown',
116
107
  disable_web_page_preview: true,
117
- text: msg
108
+ text: lines.join(' ')
118
109
  )
119
- rescue Telebot::Error => e
120
- raise CantPost, "#{e.message}: \"#{msg}\""
121
110
  end
122
111
  end
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:base"
5
+ ]
6
+ }
data/telepost.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # (The MIT License)
4
4
  #
5
- # Copyright (c) 2018-2019 Yegor Bugayenko
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -23,15 +23,12 @@
23
23
  # SOFTWARE.
24
24
 
25
25
  require 'English'
26
+
26
27
  Gem::Specification.new do |s|
27
- s.specification_version = 2 if s.respond_to? :specification_version=
28
- if s.respond_to? :required_rubygems_version=
29
- s.required_rubygems_version = Gem::Requirement.new('>= 0')
30
- end
31
- s.rubygems_version = '2.5.1'
32
- s.required_ruby_version = '>=2.5'
28
+ s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
29
+ s.required_ruby_version = '>=3.2'
33
30
  s.name = 'telepost'
34
- s.version = '0.3.2'
31
+ s.version = '0.5.0'
35
32
  s.license = 'MIT'
36
33
  s.summary = 'Simple Telegram posting Ruby gem'
37
34
  s.description = 'Simple Telegram posting Ruby gem'
@@ -39,13 +36,8 @@ Gem::Specification.new do |s|
39
36
  s.email = 'yegor256@gmail.com'
40
37
  s.homepage = 'http://github.com/yegor256/telepost'
41
38
  s.files = `git ls-files`.split($RS)
42
- s.test_files = s.files.grep(%r{^(test)/})
43
39
  s.rdoc_options = ['--charset=UTF-8']
44
40
  s.extra_rdoc_files = ['README.md']
45
- s.add_runtime_dependency 'telebot', '0.1.2'
46
- s.add_development_dependency 'minitest', '5.11.3'
47
- s.add_development_dependency 'rake', '12.3.1'
48
- s.add_development_dependency 'rdoc', '4.3.0'
49
- s.add_development_dependency 'rubocop', '0.62.0'
50
- s.add_development_dependency 'rubocop-rspec', '1.31.0'
41
+ s.add_dependency 'telegram-bot-ruby', '~> 1.0'
42
+ s.metadata['rubygems_mfa_required'] = 'true'
51
43
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # (The MIT License)
4
4
  #
5
- # Copyright (c) 2018-2019 Yegor Bugayenko
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -27,7 +27,7 @@ require_relative '../lib/telepost'
27
27
 
28
28
  # Telepost test.
29
29
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko
30
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
31
31
  # License:: MIT
32
32
  class TelepostTest < Minitest::Test
33
33
  def test_fake_posting
@@ -36,4 +36,13 @@ class TelepostTest < Minitest::Test
36
36
  tp.post('This is', 'a simple', 'message')
37
37
  assert_equal(1, tp.sent.count)
38
38
  end
39
+
40
+ def test_real_posting
41
+ skip
42
+ tp = Telepost.new(
43
+ '1088589765:...',
44
+ chats: [-1_001_438_256_738] # codexia channel
45
+ )
46
+ tp.spam('This is just a test message')
47
+ end
39
48
  end
metadata CHANGED
@@ -1,99 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telepost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-13 00:00:00.000000000 Z
11
+ date: 2024-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: telebot
14
+ name: telegram-bot-ruby
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.2
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.2
27
- - !ruby/object:Gem::Dependency
28
- name: minitest
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '='
32
- - !ruby/object:Gem::Version
33
- version: 5.11.3
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '='
39
- - !ruby/object:Gem::Version
40
- version: 5.11.3
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '='
46
- - !ruby/object:Gem::Version
47
- version: 12.3.1
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 12.3.1
55
- - !ruby/object:Gem::Dependency
56
- name: rdoc
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '='
60
- - !ruby/object:Gem::Version
61
- version: 4.3.0
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '='
67
- - !ruby/object:Gem::Version
68
- version: 4.3.0
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '='
74
- - !ruby/object:Gem::Version
75
- version: 0.62.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
82
- version: 0.62.0
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop-rspec
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '='
88
- - !ruby/object:Gem::Version
89
- version: 1.31.0
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '='
95
- - !ruby/object:Gem::Version
96
- version: 1.31.0
26
+ version: '1.0'
97
27
  description: Simple Telegram posting Ruby gem
98
28
  email: yegor256@gmail.com
99
29
  executables: []
@@ -102,25 +32,33 @@ extra_rdoc_files:
102
32
  - README.md
103
33
  files:
104
34
  - ".0pdd.yml"
35
+ - ".github/workflows/actionlint.yml"
36
+ - ".github/workflows/codecov.yml"
37
+ - ".github/workflows/copyrights.yml"
38
+ - ".github/workflows/markdown-lint.yml"
39
+ - ".github/workflows/pdd.yml"
40
+ - ".github/workflows/rake.yml"
41
+ - ".github/workflows/xcop.yml"
105
42
  - ".gitignore"
106
43
  - ".pdd"
107
44
  - ".rubocop.yml"
108
45
  - ".rultor.yml"
109
- - ".travis.yml"
110
46
  - Gemfile
47
+ - Gemfile.lock
111
48
  - LICENSE.txt
112
49
  - README.md
113
50
  - Rakefile
114
- - appveyor.yml
115
51
  - lib/telepost.rb
116
52
  - logo.svg
53
+ - renovate.json
117
54
  - telepost.gemspec
118
55
  - test/test_telepost.rb
119
56
  homepage: http://github.com/yegor256/telepost
120
57
  licenses:
121
58
  - MIT
122
- metadata: {}
123
- post_install_message:
59
+ metadata:
60
+ rubygems_mfa_required: 'true'
61
+ post_install_message:
124
62
  rdoc_options:
125
63
  - "--charset=UTF-8"
126
64
  require_paths:
@@ -129,16 +67,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
67
  requirements:
130
68
  - - ">="
131
69
  - !ruby/object:Gem::Version
132
- version: '2.5'
70
+ version: '3.2'
133
71
  required_rubygems_version: !ruby/object:Gem::Requirement
134
72
  requirements:
135
73
  - - ">="
136
74
  - !ruby/object:Gem::Version
137
75
  version: '0'
138
76
  requirements: []
139
- rubygems_version: 3.0.1
140
- signing_key:
141
- specification_version: 2
77
+ rubygems_version: 3.4.10
78
+ signing_key:
79
+ specification_version: 4
142
80
  summary: Simple Telegram posting Ruby gem
143
- test_files:
144
- - test/test_telepost.rb
81
+ test_files: []
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6.0
4
- branches:
5
- only:
6
- - master
7
- install:
8
- - bundle install
9
- script:
10
- - set -e
11
- - rake
12
-
data/appveyor.yml DELETED
@@ -1,38 +0,0 @@
1
- version: '{build}'
2
- skip_tags: true
3
- clone_depth: 10
4
- branches:
5
- only:
6
- - master
7
- except:
8
- - gh-pages
9
- os: Windows Server 2012
10
- environment:
11
- matrix:
12
- - ruby_version: "23-x64"
13
- - ruby_version: "24-x64"
14
- - ruby_version: "25-x64"
15
- install:
16
- - ps: |
17
- $Env:PATH = "C:\Ruby${Env:ruby_version}\bin;${Env:PATH}"
18
- if ($Env:ruby_version -match "^23" ) {
19
- # RubyInstaller; download OpenSSL headers from OpenKnapsack Project
20
- $Env:openssl_dir = "C:\Ruby${Env:ruby_version}"
21
- appveyor DownloadFile http://dl.bintray.com/oneclick/OpenKnapsack/x64/openssl-1.0.2j-x64-windows.tar.lzma
22
- 7z e openssl-1.0.2j-x64-windows.tar.lzma
23
- 7z x -y -oC:\Ruby${Env:ruby_version} openssl-1.0.2j-x64-windows.tar
24
- } else {
25
- # RubyInstaller2; openssl package seems to be installed already
26
- $Env:openssl_dir = "C:\msys64\mingw64"
27
- }
28
- - bundle config --local path vendor/bundle
29
- - bundle config build.openssl --with-openssl-dir=%openssl_dir%
30
- - ruby -v
31
- - bundle -v
32
- build_script:
33
- - bundle update
34
- - bundle install
35
- test_script:
36
- - bundle exec rake --quiet
37
- cache:
38
- - vendor/bundle