line_liff 0.1.3 → 0.1.4

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: e78261aed25412d733c11a08a6397897e1302665fa113b1424ed6abdb29dc56d
4
- data.tar.gz: 3d3657f375cdc8e80dd260ab6a86e9da8e6981b77f83186ad84682584ee0b8fd
3
+ metadata.gz: f60dc8aeeb85f8c86561da62e95383f864ed91992b00878b83150f3028f52a9f
4
+ data.tar.gz: fd68e7900ce374581fc36d13f342dbf076f15628442961433e4f5f023635b6fd
5
5
  SHA512:
6
- metadata.gz: 4ef17c166000b7278337089ce5bc1c2b3bb8f381e28d5a77d6b96468769b2d35c7efae9bc51dad24380524b06140e53a47b815215b25f7b88691c8120956f45b
7
- data.tar.gz: 052fe4665a9af0af0e788aee1062c62e21599eceebbfc231c5af66a801aa5d7bb4a5f02096d22c06431eb8b0e24e46ec8acff359848f10560b088fe49bc8e0ba
6
+ metadata.gz: 7431d786f6a92e4b9db0adc9921c17af1792fc4e3e8e5c879635f7c884b39e5b49d56782d1c4db9550d03c71e0fb30c3cc8ed8a6d3adf64b6adf9ca7cf956e8d
7
+ data.tar.gz: 623851bd33667c22760d3769f0205c085c52966df1e36f124abd8b6aad2cb9c02fed05a4fd80e4a6ae365ae7cf5349539e28f92243cc1dc77618da876e3e1cff
@@ -1,3 +1,3 @@
1
1
  module LineLiff
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/line_liff.rb CHANGED
@@ -24,27 +24,33 @@ unless Line::Bot::Request.method_defined? :put
24
24
  end
25
25
  end
26
26
  end
27
- end
27
+ end if defined?(Line::Bot::Request)
28
28
 
29
29
  unless Line::Bot::Client.method_defined? :put
30
30
  module Line
31
31
  module Bot
32
32
  class Client
33
- def put(endpoint_path, payload = nil)
34
- if self.class.method_defined? :credentials?
35
- raise Line::Bot::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
33
+
34
+ def put(endpoint_path, payload = nil,headers={})
35
+ if defined?(Line::Bot::Request)
36
+ if self.class.method_defined? :credentials?
37
+ raise Line::Bot::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
38
+ else
39
+ channel_token_required
40
+ end
41
+ request = Line::Bot::Request.new do |config|
42
+ config.httpclient = httpclient
43
+ config.endpoint = endpoint
44
+ config.endpoint_path = endpoint_path
45
+ config.credentials = credentials
46
+ config.payload = payload if payload
47
+ end
48
+
49
+ return request.put
36
50
  else
37
- channel_token_required
38
- end
39
- request = Line::Bot::Request.new do |config|
40
- config.httpclient = httpclient
41
- config.endpoint = endpoint
42
- config.endpoint_path = endpoint_path
43
- config.credentials = credentials
44
- config.payload = payload if payload
51
+ headers = Line::Bot::API::DEFAULT_HEADERS.merge(headers)
52
+ httpclient.put(endpoint + endpoint_path, payload, headers)
45
53
  end
46
-
47
- request.put
48
54
  end
49
55
  end
50
56
  end
@@ -73,7 +79,7 @@ module Line
73
79
  end
74
80
  def get_liffs
75
81
  endpoint_path = ""
76
- get endpoint_path
82
+ get endpoint_path,credentials
77
83
  end
78
84
 
79
85
  def create_liff type,url,description = nil,features = {}
@@ -84,7 +90,7 @@ module Line
84
90
  description:description,
85
91
  features:features
86
92
  }
87
- post "", payload.to_json
93
+ post "", payload.to_json,credentials
88
94
  end
89
95
  def update_liff liff_id,type=nil,url=nil,description = nil,features = {}
90
96
  payload = {}
@@ -92,11 +98,11 @@ module Line
92
98
  payload[:description] = description
93
99
  payload[:features] = features
94
100
  payload.reject!{|k,v| v.nil? or v.length == 0}
95
- put "/#{liff_id}", payload.to_json
101
+ put "/#{liff_id}", payload.to_json,credentials
96
102
  end
97
103
 
98
104
  def delete_liff liff_id
99
- delete "/#{liff_id}"
105
+ delete "/#{liff_id}",credentials
100
106
  end
101
107
  end
102
108
  end
data/line_liff.gemspec CHANGED
@@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "addressable", "~> 2.6"
29
29
  spec.add_development_dependency "webmock", "~> 3.5.1"
30
30
 
31
- spec.add_dependency "line-bot-api"
31
+ spec.add_dependency "line-bot-api","~>1.12"
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: line_liff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - mosle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-05 00:00:00.000000000 Z
11
+ date: 2019-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: line-bot-api
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '1.12'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '1.12'
97
97
  description: implementation line liff api for ruby using line-bot-sdk-ruby
98
98
  email:
99
99
  - yskysd@gmail.com