line-bot-api 1.19.0 → 1.20.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: a8864bff59b1e7a50a3f63bd2aef939319c9731b9facbb4116d0aa4bb7894101
4
- data.tar.gz: df898ac583f61824837b3e92f98867be4aafb74fbdc5b89ad094edf164e098ee
3
+ metadata.gz: 06c883b0ee3ec91de695af601b3e147a9da46b4e75688522adbc76d98ef03758
4
+ data.tar.gz: 2fb79d8e282e2e832a9f66dad91f51db41bf9381ad7f015fb4efb5e6bac592af
5
5
  SHA512:
6
- metadata.gz: 921d2f1896c8c60759eeccbd3ca40a57bd2d401558a1d5d5bedceb967f00d1be6d56b1d886987e7883cd9b2b43541b555ec895759607235265accd787aed6653
7
- data.tar.gz: 3a50ac3a250aa087eb7285a7a1144e4f64c15443acaca6d28e747f979198902ef887bc589fad8e31aa74fb526820ebc3eff1e4413f83460b227caa327021e172
6
+ metadata.gz: '05859f1da6840e6803ee814b335af6b854db5832d52a6f9b5760a56cd38a33d2f6c2655ea82b8b3026855714454d74ae231ec66739677f28147743973511a793'
7
+ data.tar.gz: 25dc42c2df495b0221d74306cf831f68ab72004808a92f72d415e50b75837b937dc95f49f3bd8673ee2b16475d829f3e5d14c189f4170b5a0b645f5217f934db
@@ -15,7 +15,7 @@
15
15
  module Line
16
16
  module Bot
17
17
  module API
18
- VERSION = "1.19.0"
18
+ VERSION = "1.20.0"
19
19
  end
20
20
  end
21
21
  end
@@ -492,6 +492,31 @@ module Line
492
492
  delete(endpoint, endpoint_path, credentials)
493
493
  end
494
494
 
495
+ # Set rich menu alias
496
+ #
497
+ # @param rich_menu_id [String] ID of an uploaded rich menu
498
+ # @param rich_menu_alias_id [String] string of alias words rich menu
499
+ #
500
+ # @return [Net::HTTPResponse]
501
+ def set_rich_menus_alias(rich_menu_id, rich_menu_alias_id)
502
+ channel_token_required
503
+
504
+ endpoint_path = '/bot/richmenu/alias'
505
+ post(endpoint, endpoint_path, { richMenuId: rich_menu_id, richMenuAliasId: rich_menu_alias_id }.to_json, credentials)
506
+ end
507
+
508
+ # Unset rich menu alias
509
+ #
510
+ # @param rich_menu_alias_id [String] string of alias words rich menu
511
+ #
512
+ # @return [Net::HTTPResponse]
513
+ def unset_rich_menus_alias(rich_menu_alias_id)
514
+ channel_token_required
515
+
516
+ endpoint_path = "/bot/richmenu/alias/#{rich_menu_alias_id}"
517
+ delete(endpoint, endpoint_path, credentials)
518
+ end
519
+
495
520
  # Link a rich menu to a user
496
521
  #
497
522
  # If you want to link a rich menu to multiple users,
@@ -954,7 +979,7 @@ module Line
954
979
  def validate_signature(content, channel_signature)
955
980
  return false if !channel_signature || !channel_secret
956
981
 
957
- hash = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, channel_secret, content)
982
+ hash = OpenSSL::HMAC.digest(OpenSSL::Digest.new('SHA256'), channel_secret, content)
958
983
  signature = Base64.strict_encode64(hash)
959
984
 
960
985
  variable_secure_compare(channel_signature, signature)
@@ -986,6 +1011,7 @@ module Line
986
1011
  if file.respond_to?(:content_type)
987
1012
  content_type = file.content_type
988
1013
  raise ArgumentError, "invalid content type: #{content_type}" unless ['image/jpeg', 'image/png'].include?(content_type)
1014
+
989
1015
  content_type
990
1016
  else
991
1017
  case file.path
@@ -38,10 +38,8 @@ module Line
38
38
  http.use_ssl = true
39
39
  end
40
40
 
41
- if http_options
42
- http_options.each do |key, value|
43
- http.send("#{key}=", value)
44
- end
41
+ http_options&.each do |key, value|
42
+ http.send("#{key}=", value)
45
43
  end
46
44
 
47
45
  http
data/line-bot-api.gemspec CHANGED
@@ -17,10 +17,9 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.required_ruby_version = '>= 2.0.0'
20
+ spec.required_ruby_version = '>= 2.4.0'
21
21
 
22
22
  spec.add_development_dependency "addressable", "~> 2.3"
23
- spec.add_development_dependency "bundler", "~> 1.11" if RUBY_VERSION < "2.3"
24
23
  spec.add_development_dependency 'rake', "~> 13.0"
25
24
  spec.add_development_dependency "rspec", "~> 3.0"
26
25
  spec.add_development_dependency "webmock", "~> 3.8"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: line-bot-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - LINE Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2021-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -114,15 +114,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 2.0.0
117
+ version: 2.4.0
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.7.6
124
+ rubygems_version: 3.1.4
126
125
  signing_key:
127
126
  specification_version: 4
128
127
  summary: SDK of the LINE Messaging API