ruboty-kokodeikku 0.0.7 → 0.1.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
- SHA1:
3
- metadata.gz: 744584cebd84178ed8a311a5167e3308709bd03f
4
- data.tar.gz: c7a7d1826bd808b4a75c705ccd01251d7da8eee7
2
+ SHA256:
3
+ metadata.gz: 07bd1af2d2c255017fb2239162238b16abd5745dbb15113a542a04992e7c581f
4
+ data.tar.gz: baba8fa03fcc9af537686de1bffe9463e73b5f14270fd5aa5e66dae7b942d23e
5
5
  SHA512:
6
- metadata.gz: fc68893be40b92145c1b3815c880f7b03e851278ca929a4acd4a742a2d0aa6534bfe6c58928864f45e10b58538599e3d2ba7f9c4a3ecad39a8d15722b4970c6d
7
- data.tar.gz: 4f732f0f92ac70f00f60404d15dcb391f28713a106c884b90eb0347cb7ea9980325afa25e9494a3ea8dc2779f2b8bf80749d1cd4bc3a9b7f33d45c89d8e90ba7
6
+ metadata.gz: 69f2127ed04d9be18874b8011a63fd46f6f59fcb0a38b967310cb3280bdbbc3770e0e56421e3ffe21472b7a6b9ccf3130ea3171e2f80e179ad3edfa4f7b54310
7
+ data.tar.gz: e0a62579f47e793523effd9856e1be2ab4f1158d5f195d0eda9a1be4f3645dbd33d05da78e0388169a001377c3d307b6add030cc0ebae54c347b54123ddf0638
@@ -0,0 +1,23 @@
1
+ changelog:
2
+ categories:
3
+ - title: Added
4
+ labels:
5
+ - add
6
+ - title: Changed
7
+ labels:
8
+ - change
9
+ - title: Deprecated
10
+ labels:
11
+ - deprecate
12
+ - title: Fixed
13
+ labels:
14
+ - fix
15
+ - title: Removed
16
+ labels:
17
+ - remove
18
+ - title: Security
19
+ labels:
20
+ - security
21
+ - title: Others
22
+ labels:
23
+ - "*"
@@ -0,0 +1,37 @@
1
+ # This file is machine-generated by `gh actions-lock`.
2
+ # Do not edit by hand; run `gh actions-lock` to update.
3
+ # Docs: https://gh.io/actions-lockfile
4
+ version: 'v0.0.3'
5
+ workflows:
6
+ '.github/workflows/bump-request.yml':
7
+ - 'actions/checkout@v7.0.1'
8
+ - 'r7kamura/bump-request@v0.7.1'
9
+ - 'ruby/setup-ruby@v1.336.0'
10
+ '.github/workflows/ci.yml':
11
+ - 'actions/checkout@v7.0.1'
12
+ - 'ruby/setup-ruby@v1.336.0'
13
+ '.github/workflows/release.yml': []
14
+ dependencies:
15
+ 'actions/checkout@v7.0.1':
16
+ ref: 'v7.0.1'
17
+ commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
18
+ owner_id: 44036562
19
+ repo_id: 197814629
20
+ 'actions/setup-node@v7.1.0':
21
+ ref: 'v7.1.0'
22
+ commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1'
23
+ owner_id: 44036562
24
+ repo_id: 189476904
25
+ 'r7kamura/bump-request@v0.7.1':
26
+ ref: 'v0.7.1'
27
+ commit: 'sha1-b27937188d404bc0c2fd442403e6de1d20f9b349'
28
+ owner_id: 111689
29
+ repo_id: 533135195
30
+ uses:
31
+ - 'actions/checkout@v7.0.1'
32
+ - 'actions/setup-node@v7.1.0'
33
+ 'ruby/setup-ruby@v1.336.0':
34
+ ref: 'v1.336.0'
35
+ commit: 'sha1-de492cf36cbab201753d720ce4f4e336cd688c94'
36
+ owner_id: 210414
37
+ repo_id: 231208785
@@ -0,0 +1,26 @@
1
+ name: bump-request
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: Version to change to.
8
+ required: true
9
+ type: string
10
+
11
+ jobs:
12
+ run:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v7.0.1
16
+ - name: Set up Ruby
17
+ uses: ruby/setup-ruby@v1.336.0
18
+ with:
19
+ ruby-version: 3.3
20
+ bundler-cache: true
21
+ - uses: r7kamura/bump-request@v0.7.1
22
+ with:
23
+ command: |
24
+ sed -i -r 's/([0-9]+\.[0-9]+\.[0-9]+)/${{ inputs.version }}/' lib/ruboty/kokodeikku/version.rb
25
+ bundle install
26
+ version: ${{ inputs.version }}
@@ -0,0 +1,27 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ name: Ruby ${{ matrix.ruby }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ ruby:
17
+ - '3.3'
18
+ - '3.4'
19
+ - '4.0'
20
+ steps:
21
+ - uses: actions/checkout@v7.0.1
22
+ - run: sudo apt-get update && sudo apt-get install -y libmecab-dev mecab-ipadic-utf8
23
+ - uses: ruby/setup-ruby@v1.336.0
24
+ with:
25
+ ruby-version: ${{ matrix.ruby }}
26
+ bundler-cache: true
27
+ - run: bundle exec ruby -e 'require "ruboty"; require "ruboty/kokodeikku"'
@@ -0,0 +1,11 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ release:
10
+ uses: r7kamura/workflows/.github/workflows/gem-release.yml@main
11
+ if: github.repository_owner == 'r7kamura'
data/README.md CHANGED
@@ -16,5 +16,6 @@ heroku config:set \
16
16
  ## ENV
17
17
  ```
18
18
  KOKODEIKKU_CHANNEL - Pass comma-separated names to specify channels (optional)
19
+ KOKODEIKKU_PREFIX - Pass optional prefix message (default: `"ここで一句"`)
19
20
  KOKODEIKKU_RULE - Pass optional song rule (default: `"5,7,5"`)
20
21
  ```
@@ -6,8 +6,9 @@ module Ruboty
6
6
  class Kokodeikku < Base
7
7
  env 'KOKODEIKKU_CHANNEL', "if specified, kokodeikku will be enabled only on the specified channels (separated by comma)", optional: true
8
8
 
9
- PREFIX = "ここで一句 "
9
+ DEFAULT_PREFIX = "ここで一句"
10
10
 
11
+ env :KOKODEIKKU_PREFIX, 'Pass optional prefix message (default: ここで一句)', optional: true
11
12
  env :KOKODEIKKU_RULE, 'Pass optional song rule (default: "5,7,5")', optional: true
12
13
 
13
14
  on(
@@ -20,8 +21,8 @@ module Ruboty
20
21
  def kokodeikku(message)
21
22
  return if channels && !channels.include?(message.to)
22
23
 
23
- if message.from != robot.name && !message.body.start_with?(PREFIX) && (song = reviewer.find(message.body))
24
- message.reply("#{PREFIX}#{song.phrases.map(&:join).join(' ')}")
24
+ if message.from != robot.name && !message.body.start_with?("#{prefix} ") && (song = reviewer.find(message.body))
25
+ message.reply("#{prefix} #{song.phrases.map(&:join).join(' ')}")
25
26
  end
26
27
  end
27
28
 
@@ -35,6 +36,10 @@ module Ruboty
35
36
  end
36
37
  end
37
38
 
39
+ def prefix
40
+ ENV["KOKODEIKKU_PREFIX"] || DEFAULT_PREFIX
41
+ end
42
+
38
43
  def reviewer
39
44
  @reviewer ||= Ikku::Reviewer.new(rule: rule)
40
45
  end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Kokodeikku
3
- VERSION = "0.0.7"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -9,6 +9,11 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["r7kamura@gmail.com"]
10
10
  spec.summary = "Ruboty plug-in to find haiku from our daily conversations."
11
11
  spec.homepage = "https://github.com/r7kamura/ruboty-kokodeikku"
12
+
13
+ spec.metadata["homepage_uri"] = spec.homepage
14
+ spec.metadata["source_code_uri"] = spec.homepage
15
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/releases"
16
+ spec.metadata["rubygems_mfa_required"] = "true"
12
17
  spec.license = "MIT"
13
18
 
14
19
  spec.files = `git ls-files -z`.split("\x0")
@@ -16,8 +21,9 @@ Gem::Specification.new do |spec|
16
21
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
22
  spec.require_paths = ["lib"]
18
23
 
19
- spec.add_runtime_dependency "ikku", ">= 0.1.1"
24
+ spec.required_ruby_version = ">= 3.3"
25
+
26
+ spec.add_runtime_dependency "ikku", ">= 0.2.0"
20
27
  spec.add_runtime_dependency "ruboty"
21
- spec.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rake"
23
29
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-kokodeikku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2015-02-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ikku
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.1.1
18
+ version: 0.2.0
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 0.1.1
25
+ version: 0.2.0
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: ruboty
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -38,43 +37,32 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.7'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.7'
55
40
  - !ruby/object:Gem::Dependency
56
41
  name: rake
57
42
  requirement: !ruby/object:Gem::Requirement
58
43
  requirements:
59
- - - "~>"
44
+ - - ">="
60
45
  - !ruby/object:Gem::Version
61
- version: '10.0'
46
+ version: '0'
62
47
  type: :development
63
48
  prerelease: false
64
49
  version_requirements: !ruby/object:Gem::Requirement
65
50
  requirements:
66
- - - "~>"
51
+ - - ">="
67
52
  - !ruby/object:Gem::Version
68
- version: '10.0'
69
- description:
53
+ version: '0'
70
54
  email:
71
55
  - r7kamura@gmail.com
72
56
  executables: []
73
57
  extensions: []
74
58
  extra_rdoc_files: []
75
59
  files:
60
+ - ".github/release.yml"
61
+ - ".github/workflows/actions.lock"
62
+ - ".github/workflows/bump-request.yml"
63
+ - ".github/workflows/ci.yml"
64
+ - ".github/workflows/release.yml"
76
65
  - ".gitignore"
77
- - CHANGELOG.md
78
66
  - Gemfile
79
67
  - LICENSE.txt
80
68
  - README.md
@@ -87,8 +75,11 @@ files:
87
75
  homepage: https://github.com/r7kamura/ruboty-kokodeikku
88
76
  licenses:
89
77
  - MIT
90
- metadata: {}
91
- post_install_message:
78
+ metadata:
79
+ homepage_uri: https://github.com/r7kamura/ruboty-kokodeikku
80
+ source_code_uri: https://github.com/r7kamura/ruboty-kokodeikku
81
+ changelog_uri: https://github.com/r7kamura/ruboty-kokodeikku/releases
82
+ rubygems_mfa_required: 'true'
92
83
  rdoc_options: []
93
84
  require_paths:
94
85
  - lib
@@ -96,17 +87,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
87
  requirements:
97
88
  - - ">="
98
89
  - !ruby/object:Gem::Version
99
- version: '0'
90
+ version: '3.3'
100
91
  required_rubygems_version: !ruby/object:Gem::Requirement
101
92
  requirements:
102
93
  - - ">="
103
94
  - !ruby/object:Gem::Version
104
95
  version: '0'
105
96
  requirements: []
106
- rubyforge_project:
107
- rubygems_version: 2.4.5
108
- signing_key:
97
+ rubygems_version: 4.0.20
109
98
  specification_version: 4
110
99
  summary: Ruboty plug-in to find haiku from our daily conversations.
111
100
  test_files: []
112
- has_rdoc:
data/CHANGELOG.md DELETED
@@ -1,20 +0,0 @@
1
- ## 0.0.7
2
- - Add KOKODEIKKU_RULE to change song rule
3
-
4
- ## 0.0.6
5
- - Add KOKODEIKKU_CHANNEL env
6
-
7
- ## 0.0.5
8
- - Use ikku 0.1.1
9
-
10
- ## 0.0.4
11
- - Prevent to compose ikku from its own message
12
-
13
- ## 0.0.3
14
- - Fix bug
15
-
16
- ## 0.0.2
17
- - Add dependency on ikku
18
-
19
- ## 0.0.1
20
- - 1st Release