Skip to content

Commit 6b84ed4

Browse files
committed
NO-ISSUE Move version file as line/bot/version.rb
1 parent f478b3d commit 6b84ed4

10 files changed

Lines changed: 21 additions & 23 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ jobs:
3333
VERSION=${VERSION#v}
3434
echo "VERSION=$VERSION" >> $GITHUB_ENV
3535
36-
sed -i "s/VERSION = \".*\"/VERSION = \"$VERSION\"/" lib/line/bot/api/version.rb
36+
sed -i "s/VERSION = \".*\"/VERSION = \"$VERSION\"/" lib/line/bot/version.rb
3737
38-
cat lib/line/bot/api/version.rb
38+
cat lib/line/bot/version.rb
3939
4040
# commit
4141
git config user.name github-actions
4242
git config user.email github-actions@github.com
4343
44-
git add lib/line/bot/api/version.rb
44+
git add lib/line/bot/version.rb
4545
git commit -m "Set version to $VERSION"
4646
- uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
4747

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
line-bot-api (2.0.0)
4+
line-bot-api (0.0.1.pre.test)
55
multipart-post (~> 2.4.1)
66

77
GEM

lib/line/bot/v1/api/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Line
1616
module Bot
1717
module API
1818
# @deprecated
19-
# Use {Line::Bot::V2::VERSION} instead.
19+
# Use {Line::Bot::VERSION} instead.
2020
VERSION = "1.29.0"
2121
end
2222
end

lib/line/bot/v2/http_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'uri'
33
require 'json'
44
require 'net/http/post/multipart'
5-
require 'line/bot/v2/version'
5+
require 'line/bot/version'
66

77
module Line
88
module Bot
@@ -20,7 +20,7 @@ class HttpClient
2020
# NOTE: line-bot-sdk-ruby users should not use this. Breaking changes may occur, so use at your own risk.
2121
def initialize(base_url:, http_headers: {}, http_options: {})
2222
@base_url = base_url
23-
@http_headers = { 'User-Agent' => "LINE-BotSDK-Ruby/#{Line::Bot::V2::VERSION}" }.merge(http_headers)
23+
@http_headers = { 'User-Agent' => "LINE-BotSDK-Ruby/#{Line::Bot::VERSION}" }.merge(http_headers)
2424
@http_options = http_options
2525
end
2626

lib/line/bot/v2/version.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/line/bot/version.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module Line
2+
module Bot
3+
# This version is updated before releasing a new version in the release process.
4+
# You don't have to update this version manually.
5+
VERSION = "0.0.1-test"
6+
end
7+
end

line-bot-api.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = File.read("#{__dir__}/lib/line/bot/v2/version.rb").match(/VERSION *= *['"]([^'"]+)/)[1] or raise
1+
version = File.read("#{__dir__}/lib/line/bot/version.rb").match(/VERSION *= *['"]([^'"]+)/)[1] or raise
22
raise "Invalid version format <#{version}>" unless version.match?(/\A\d+\.\d+\.\d+(?:[+-][\w.-]+)?\z/)
33

44
Gem::Specification.new do |spec|

sig/line/bot/v2/version.rbs

Lines changed: 0 additions & 7 deletions
This file was deleted.

sig/line/bot/version.rbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Line
2+
module Bot
3+
VERSION: String
4+
end
5+
end

spec/line/bot/v2/misc_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@
990990
expect(status_code).to eq(response_code)
991991
expect(body.user_id).to eq(user_id)
992992
expect(WebMock).to have_requested(:get, path).
993-
with(headers: { 'User-Agent' => "LINE-BotSDK-Ruby/#{Line::Bot::V2::VERSION}" })
993+
with(headers: { 'User-Agent' => "LINE-BotSDK-Ruby/#{Line::Bot::VERSION}" })
994994
end
995995
end
996996

0 commit comments

Comments
 (0)