naver-sdk 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d16fe3d0b77daf05e8f77f8e5caa2d42aac547e5
4
- data.tar.gz: ccb0b9772ebf335765d967f0f5caf81e0dd52a4d
3
+ metadata.gz: 5e0243cfe19078ff67d9712ea9e7cb391565a736
4
+ data.tar.gz: 919a6fb9458ecc66e3b442e45205f4dd617a2c79
5
5
  SHA512:
6
- metadata.gz: 3380b8d54040b9838c56551fe04a1fc38237a1e6d16903fecec117ba3264c03a98d44b930c89401a2d9b2dfd4dcb28456ac32ecb324e9951e61259eaa7620ea4
7
- data.tar.gz: 398dfd1d1342c8072fc2d39d223095cb5cd6d3496fbc0ce37e38549ddd17010660d44d1db0c1e65445d7580b2455ba0ecd5ef6ff16461d03fe94b58f158e2251
6
+ metadata.gz: ad842ba0141739859b1f00cc6931b54c4ff2e4b9e31871025c80f7a5394ccfa14f7459a891c9481fc8fd18dc3118027cdc3a929246f26e7738a6aa8027a96df3
7
+ data.tar.gz: 453d890ba05bf8b98bb72335b7b54abb2a0acdb5c6d155325caa51320d2406bee87974b42e709053f996cfc64f260520fdc1046f99beae7f1476b25ef60fd168
@@ -3,8 +3,12 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  ## [unreleased]
5
5
 
6
+ ## [0.6.0] - 2017-07-09
7
+ - rename Configration -> Configuration, configration -> configuration
8
+ - fix typo
9
+
6
10
  ## [0.5.0] - 2017-07-09
7
- - improve configration
11
+ - improve configuration
8
12
  - core_ext/hash/keys
9
13
 
10
14
  ## [0.4.0] - 2017-06-26
@@ -32,4 +36,5 @@ All notable changes to this project will be documented in this file.
32
36
  [0.3.0]: https://github.com/kimsuelim/naver-sdk-ruby/compare/v0.2.0...v0.3.0
33
37
  [0.4.0]: https://github.com/kimsuelim/naver-sdk-ruby/compare/v0.3.0...v0.4.0
34
38
  [0.5.0]: https://github.com/kimsuelim/naver-sdk-ruby/compare/v0.4.0...v0.5.0
35
- [unreleased]: https://github.com/kimsuelim/naver-sdk-ruby/compare/v0.5.0...HEAD
39
+ [0.6.0]: https://github.com/kimsuelim/naver-sdk-ruby/compare/v0.5.0...v0.6.0
40
+ [unreleased]: https://github.com/kimsuelim/naver-sdk-ruby/compare/v0.6.0...HEAD
@@ -1,6 +1,6 @@
1
1
  module Naver
2
2
  # Defines constants and methods related to configuration.
3
- module Configration
3
+ module Configuration
4
4
  # An array of valid keys in the options hash when configuring a Naver::Client.
5
5
  OPTION_KEYS = [:client_id, :client_secret, :redirect_uri, :timeout, :debug].freeze
6
6
 
@@ -0,0 +1,30 @@
1
+ module Naver
2
+ # Defines constants and methods related to configuration.
3
+ module Configuration
4
+ # An array of valid keys in the options hash when configuring a Naver::Client.
5
+ OPTION_KEYS = [:client_id, :client_secret, :redirect_uri, :timeout, :debug].freeze
6
+
7
+ # The user agent that will be sent to the API endpoint if none is set.
8
+ DEFAULT_USER_AGENT = "NAVER Ruby SDK Gem #{Naver::Sdk::VERSION}".freeze
9
+
10
+ # Base URI for the NAVER API.
11
+ DEFAULT_API_BASE_URI = "https://openapi.naver.com".freeze
12
+
13
+ # Base URI for NAVER OAuth.
14
+ DEFAULT_OAUTH_BASE_URI = "https://nid.naver.com".freeze
15
+
16
+ attr_accessor *OPTION_KEYS
17
+
18
+ # Convenience method to allow configuration options to be set in a block.
19
+ def configure
20
+ yield(self)
21
+ end
22
+
23
+ # Creates a hash of options and their values.
24
+ def options
25
+ options = {}
26
+ OPTION_KEYS.each { |key| options[key] = send(key) }
27
+ options
28
+ end
29
+ end
30
+ end
@@ -4,8 +4,8 @@ module Naver
4
4
  def initialize
5
5
  @client_id = Naver.client_id
6
6
  @client_secret = Naver.client_secret
7
- @api_base_uri = Configration::DEFAULT_API_BASE_URI
8
- @headers = { user_agent: Configration::DEFAULT_USER_AGENT }
7
+ @api_base_uri = Configuration::DEFAULT_API_BASE_URI
8
+ @headers = { user_agent: Configuration::DEFAULT_USER_AGENT }
9
9
  @connection = Faraday.new(url: @api_base_uri, headers: @headers) do |faraday|
10
10
  faraday.request :multipart
11
11
  faraday.request :url_encoded
@@ -5,10 +5,10 @@ module Naver
5
5
  def initialize(redirect_uri: Naver.redirect_uri)
6
6
  @client_id = Naver.client_id
7
7
  @client_secret = Naver.client_secret
8
- @oauth_base_uri = Configration::DEFAULT_OAUTH_BASE_URI
8
+ @oauth_base_uri = Configuration::DEFAULT_OAUTH_BASE_URI
9
9
  @redirect_uri = redirect_uri
10
10
 
11
- headers = { user_agent: Configration::DEFAULT_USER_AGENT }
11
+ headers = { user_agent: Configuration::DEFAULT_USER_AGENT }
12
12
  @oauth = OAuth2::Client.new(@client_id, @client_secret, site: @oauth_base_uri, authorize_url: "/oauth2.0/authorize", token_url: "/oauth2.0/token", headers: headers) do |http|
13
13
  http.request :multipart
14
14
  http.request :url_encoded
@@ -3,7 +3,7 @@ require "faraday"
3
3
 
4
4
  require "naver/sdk/version"
5
5
  require "naver/core_ext/hash/keys"
6
- require "naver/configration"
6
+ require "naver/configuration"
7
7
  require "naver/connection"
8
8
  require "naver/client"
9
9
  require "naver/error"
@@ -20,5 +20,5 @@ require "naver/vision"
20
20
  require "naver/voice"
21
21
 
22
22
  module Naver
23
- extend Configration
23
+ extend Configuration
24
24
  end
@@ -1,5 +1,5 @@
1
1
  module Naver
2
2
  module Sdk
3
- VERSION = "0.5.0".freeze
3
+ VERSION = "0.6.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naver-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Surim Kim
@@ -134,6 +134,7 @@ files:
134
134
  - bin/setup
135
135
  - lib/naver/client.rb
136
136
  - lib/naver/configration.rb
137
+ - lib/naver/configuration.rb
137
138
  - lib/naver/connection.rb
138
139
  - lib/naver/core_ext/hash/keys.rb
139
140
  - lib/naver/error.rb