naver-searchad-api 1.1.1 → 1.1.3

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: dbbdb4eb119c7be44c31a6f42660d10e7918bdbf3eaec33c383c8e510aeeb971
4
- data.tar.gz: be943907d5d92d569d639ada5b725573159aff42c1620a659a5f5e1b804dd12a
3
+ metadata.gz: 3fc2f78e1704d93ad2ccf1313b1f2112c81b711544173e49142d4430bd342c8a
4
+ data.tar.gz: 5b782b28493af0c429f64de50b769dfdc83df32f4ae56e5f1483314e465b97b9
5
5
  SHA512:
6
- metadata.gz: 72624784a5d9a4e14af4430171687c2a7b8db6ce77edc4881ab07cb09c36d3ba402828e05bb133cba597815fb79bb4760986c026171d1ccdcb9e5993b13b94bc
7
- data.tar.gz: 0620d07f41497fc6744e7fa5e458b55792692801b32f4b26abeaa56f4ac4b9493dd7d8a51ea9485aa910acf2d55543f177bb06e2a2a8d17985d7b45136152d98
6
+ metadata.gz: ba8b6a3cdad1747bafa1eb0ac894f2c67418a81c2cdb77eb665e349af7509620e80202207d69222ea7e78087a0ce51994f5a2f0bccda15e9f7f54f607ac30c42
7
+ data.tar.gz: 6530ed56a86278e63e0476f8bf780b219145537f15720a7bd1dcfce21468bd60fa7f1b00b89c36fee148fce0784619d57f55d2ac802e8d8e97a857327c9c2415
@@ -7,12 +7,14 @@ require_relative '../version'
7
7
  require_relative 'api_command'
8
8
  require_relative 'download_command'
9
9
  require_relative 'logging'
10
+ require_relative 'helpers'
10
11
 
11
12
  module Naver
12
13
  module Searchad
13
14
  module Api
14
15
  module Core
15
16
  class BaseService
17
+ include Helpers
16
18
  include Logging
17
19
 
18
20
  attr_accessor :request_options
@@ -42,7 +44,7 @@ module Naver
42
44
  protected
43
45
 
44
46
  def make_command(method, path, options = {})
45
- template = Addressable::Template.new(url + base_path + path)
47
+ template = new_template(url + base_path + path)
46
48
  command = ApiCommand.new(method, template)
47
49
  command.decode_snake_case = options.fetch(:decode_snake_case, true) if options
48
50
  command.options = request_options.merge(options)
@@ -51,7 +53,7 @@ module Naver
51
53
  end
52
54
 
53
55
  def make_download_command(method, path, options = {})
54
- template = Addressable::Template.new(url + base_path + path)
56
+ template = new_template(url + base_path + path)
55
57
  command = DownloadCommand.new(method, template)
56
58
  command.options = request_options.merge(options)
57
59
  apply_command_defaults(command)
@@ -0,0 +1,23 @@
1
+ require 'naver/searchad/api'
2
+
3
+ module Naver
4
+ module Searchad
5
+ module Api
6
+ module Core
7
+ module Helpers
8
+ private
9
+
10
+ def new_template(url)
11
+ Addressable::Template.new(remove_excessive_fslashes_from_url(url))
12
+ end
13
+
14
+ def remove_excessive_fslashes_from_url(url)
15
+ tmp = Addressable::URI.parse(url)
16
+ tmp.path = tmp.path.squeeze('/')
17
+ tmp.to_s
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -4,12 +4,14 @@ require 'json'
4
4
  require_relative '../errors'
5
5
  require_relative '../options'
6
6
  require_relative 'logging'
7
+ require_relative 'helpers'
7
8
 
8
9
  module Naver
9
10
  module Searchad
10
11
  module Api
11
12
  module Core
12
13
  class HttpCommand
14
+ include Helpers
13
15
  include Logging
14
16
 
15
17
  attr_reader :url
@@ -22,7 +24,7 @@ module Naver
22
24
 
23
25
  def initialize(method, url, body: nil)
24
26
  @options = RequestOptions.default.dup
25
- @url = url.is_a?(String) ? Addressable::Template.new(url) : url
27
+ @url = url.is_a?(String) ? new_template(url) : url
26
28
  @method = method
27
29
  @header = {}
28
30
  @body = body
@@ -16,6 +16,7 @@ module Naver
16
16
 
17
17
  command = make_download_command(:get, uri.path, options)
18
18
  command.query['authtoken'] = uri.query_values['authtoken']
19
+ command.query['fileVersion'] = uri.query_values['fileVersion'] || 'v2'
19
20
  command.download_dest = file_path
20
21
  execute_command(command, &block)
21
22
  end
@@ -1,7 +1,7 @@
1
1
  module Naver
2
2
  module Searchad
3
3
  module Api
4
- VERSION = '1.1.1'
4
+ VERSION = '1.1.3'
5
5
 
6
6
  OS_VERSION = begin
7
7
  if RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naver-searchad-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Min Kim
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-01-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: httpclient
@@ -129,6 +128,7 @@ files:
129
128
  - lib/naver/searchad/api/core/api_command.rb
130
129
  - lib/naver/searchad/api/core/base_service.rb
131
130
  - lib/naver/searchad/api/core/download_command.rb
131
+ - lib/naver/searchad/api/core/helpers.rb
132
132
  - lib/naver/searchad/api/core/http_command.rb
133
133
  - lib/naver/searchad/api/core/logging.rb
134
134
  - lib/naver/searchad/api/errors.rb
@@ -143,7 +143,6 @@ homepage: https://github.com/forward3d/naver-searchad-api
143
143
  licenses:
144
144
  - MIT
145
145
  metadata: {}
146
- post_install_message:
147
146
  rdoc_options: []
148
147
  require_paths:
149
148
  - lib
@@ -158,8 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
157
  - !ruby/object:Gem::Version
159
158
  version: '0'
160
159
  requirements: []
161
- rubygems_version: 3.3.7
162
- signing_key:
160
+ rubygems_version: 3.6.7
163
161
  specification_version: 4
164
162
  summary: Naver Searchad API ruby client
165
163
  test_files: []