line-social 0.1.1 → 0.1.2

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: 3eaba402a6d0d78f613732d830365688b85c4fc797356dd5e4593800c60b01e8
4
- data.tar.gz: cc59e86f156510264ec6e8ac474b25b08440472f4b97d5faf24ccb89c54c9ef4
3
+ metadata.gz: ad1f3541e668c583eb447ab3fdf3987f86bf224cbcd5cc4d1164eb505cbf86eb
4
+ data.tar.gz: 36dcc8cb36d86f41afd09e223546e7ba5e60500013d1b7be68466b77abbec33d
5
5
  SHA512:
6
- metadata.gz: 5df52de38e01b72bafbb15b04772dd5e5bdf0f59cb266fa4f55eaf595ab847b63abaf6dc3162d666e510ee820dfc6dd1ddc5b56ee4b7c374ecc335a578ea2eb8
7
- data.tar.gz: 027e28e2e1f78a19a35467230787c385e7f0e16239ab993c1433611d4e420526deeb1af85e6c5aecff1ca11aacdc53048afaa7eff72cbcd0fc4829ee2eeff4a1
6
+ metadata.gz: 27179ef7fa87232c710388e71db66006b3fb72f4fb9c5179a419bb186a8cb1c44838301d6afb19886d5519ad415238af66f14ba683fa6ab5bdd7ea1d35697549
7
+ data.tar.gz: 0c66c13dbd87da9348f9f90e4cf04f20c61e6dd071783a26286f2c07159ef8554950a7121ae6a2fb5078fb25ebdb9672d2276ff5390820e1dd46b2cc32687a8f
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ gem "webmock", git: "https://github.com/camelmasa/webmock.git", branch: "allow-hash"
4
+
3
5
  # Specify your gem's dependencies in line-social.gemspec
4
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,17 @@
1
+ GIT
2
+ remote: https://github.com/camelmasa/webmock.git
3
+ revision: 2596cb49c95ed84de6bd55d4f20eb8036ff4b325
4
+ branch: allow-hash
5
+ specs:
6
+ webmock (3.5.1)
7
+ addressable (>= 2.3.6)
8
+ crack (>= 0.3.2)
9
+ hashdiff
10
+
1
11
  PATH
2
12
  remote: .
3
13
  specs:
4
- line-social (0.1.0)
14
+ line-social (0.1.1)
5
15
  faraday (~> 0.15)
6
16
  faraday_middleware (~> 0.13)
7
17
  virtus (~> 1.0)
@@ -9,12 +19,16 @@ PATH
9
19
  GEM
10
20
  remote: https://rubygems.org/
11
21
  specs:
22
+ addressable (2.6.0)
23
+ public_suffix (>= 2.0.2, < 4.0)
12
24
  axiom-types (0.1.1)
13
25
  descendants_tracker (~> 0.0.4)
14
26
  ice_nine (~> 0.11.0)
15
27
  thread_safe (~> 0.3, >= 0.3.1)
16
28
  coercible (1.0.0)
17
29
  descendants_tracker (~> 0.0.1)
30
+ crack (0.4.3)
31
+ safe_yaml (~> 1.0.0)
18
32
  descendants_tracker (0.0.4)
19
33
  thread_safe (~> 0.3, >= 0.3.1)
20
34
  diff-lcs (1.3)
@@ -23,8 +37,10 @@ GEM
23
37
  multipart-post (>= 1.2, < 3)
24
38
  faraday_middleware (0.13.1)
25
39
  faraday (>= 0.7.4, < 1.0)
40
+ hashdiff (0.3.8)
26
41
  ice_nine (0.11.2)
27
42
  multipart-post (2.0.0)
43
+ public_suffix (3.0.3)
28
44
  rake (10.5.0)
29
45
  rspec (3.8.0)
30
46
  rspec-core (~> 3.8.0)
@@ -39,6 +55,7 @@ GEM
39
55
  diff-lcs (>= 1.2.0, < 2.0)
40
56
  rspec-support (~> 3.8.0)
41
57
  rspec-support (3.8.0)
58
+ safe_yaml (1.0.5)
42
59
  thread_safe (0.3.6)
43
60
  virtus (1.0.5)
44
61
  axiom-types (~> 0.1)
@@ -54,6 +71,7 @@ DEPENDENCIES
54
71
  line-social!
55
72
  rake (~> 10.0)
56
73
  rspec (~> 3.0)
74
+ webmock!
57
75
 
58
76
  BUNDLED WITH
59
77
  2.0.1
@@ -1,14 +1,14 @@
1
1
  module Line
2
2
  module Social
3
3
  class Client
4
- API_URI = URI.parse("https://api.line.me/oauth2/v2.1")
5
-
6
- attr_reader :access_token
7
-
8
4
  def initialize(access_token)
9
5
  @access_token = access_token
10
6
  end
11
7
 
8
+ def friendship
9
+ Request::Friendship.new(@access_token)
10
+ end
11
+
12
12
  def oauth
13
13
  Request::Oauth.new(@access_token)
14
14
  end
@@ -3,7 +3,7 @@ module Line
3
3
  module Request
4
4
  class Base
5
5
  def request
6
- Faraday.new(url: url) do |connection|
6
+ Faraday.new do |connection|
7
7
  connection.response :json, content_type: /\bjson$/
8
8
  connection.adapter Faraday.default_adapter
9
9
  end
@@ -9,12 +9,6 @@ module Line
9
9
  def get
10
10
  raise Line::Social::NotImplementedError
11
11
  end
12
-
13
- private
14
-
15
- def url
16
- "#{API_URI.scheme}://#{API_URI.host}"
17
- end
18
12
  end
19
13
  end
20
14
  end
@@ -13,7 +13,7 @@ module Line
13
13
  end
14
14
 
15
15
  def verify
16
- response = request.get("#{API_URI.path}/verify", access_token: @access_token)
16
+ response = request.get("#{API_URI}/verify", access_token: @access_token)
17
17
 
18
18
  if response.body["error"]
19
19
  raise Line::Social::Error.new(response.body["error_description"])
@@ -29,12 +29,6 @@ module Line
29
29
  def revoke
30
30
  raise Line::Social::NotImplementedError
31
31
  end
32
-
33
- private
34
-
35
- def url
36
- "#{API_URI.scheme}://#{API_URI.host}"
37
- end
38
32
  end
39
33
  end
40
34
  end
@@ -10,7 +10,7 @@ module Line
10
10
 
11
11
  def get
12
12
  response = request.get do |request|
13
- request.url "#{API_URI.path}/profile"
13
+ request.url "#{API_URI}/profile"
14
14
  request.headers["Authorization"] = "Bearer #{@access_token}"
15
15
  end
16
16
 
@@ -20,12 +20,6 @@ module Line
20
20
  Line::Social::Profile.new(response.body)
21
21
  end
22
22
  end
23
-
24
- private
25
-
26
- def url
27
- "#{API_URI.scheme}://#{API_URI.host}"
28
- end
29
23
  end
30
24
  end
31
25
  end
@@ -1,5 +1,5 @@
1
1
  module Line
2
2
  module Social
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: line-social
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - camelmasa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-08 00:00:00.000000000 Z
11
+ date: 2019-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday