mrkt 0.11.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/ruby.yml +41 -0
- data/.rubocop.yml +6 -2
- data/Gemfile.lock +81 -56
- data/README.md +1 -0
- data/lib/mrkt/concerns/connection.rb +12 -3
- data/lib/mrkt/concerns/crud_activities.rb +2 -2
- data/lib/mrkt/concerns/crud_custom_objects.rb +1 -1
- data/lib/mrkt/concerns/crud_leads.rb +10 -8
- data/lib/mrkt/concerns/import_custom_objects.rb +1 -1
- data/lib/mrkt/concerns/import_leads.rb +1 -1
- data/lib/mrkt/errors.rb +20 -1
- data/lib/mrkt/faraday.rb +4 -0
- data/lib/mrkt/faraday/params_encoder.rb +20 -0
- data/lib/mrkt/faraday_middleware.rb +3 -7
- data/lib/mrkt/version.rb +1 -1
- data/mrkt.gemspec +9 -7
- data/spec/concerns/crud_leads_spec.rb +1 -1
- data/spec/faraday/params_encoder_spec.rb +24 -0
- metadata +55 -34
- data/.travis.yml +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c1d806a3e503d57671f87fb4d26d1f8117a3b980854b1bad72653de9c3fb1af
|
4
|
+
data.tar.gz: 56d140143afe8bba8541f03598a7ad479e4a35e9c35a933c15ed624a917e6329
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07411edcb6e9afeea40c73846fdc16774c22e869bfe9af05b052df0be8f30fd7075c656c325e1b097d9267119ae5215216beb7cb3a143485214e88f6015a6bbf
|
7
|
+
data.tar.gz: 94cb30607349f9f0e2b077278376b090a61d1c5417a920b4b6642de4862bff336cb789c1babf6f5e346b04727ab5885959ee31521241335de08a251f208d02a4
|
@@ -0,0 +1,41 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [master]
|
6
|
+
pull_request:
|
7
|
+
branches: [master]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby: [2.5, 2.6, 2.7, 3.0]
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2.3.4
|
19
|
+
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
bundler-cache: true
|
25
|
+
|
26
|
+
- name: Update the RubyGems system software
|
27
|
+
run: gem update --system
|
28
|
+
|
29
|
+
- name: Update Bundler
|
30
|
+
run: bundle update --bundler
|
31
|
+
|
32
|
+
- name: Install dependencies
|
33
|
+
run: bundle install
|
34
|
+
|
35
|
+
- name: Run tests and publish coverage
|
36
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
37
|
+
env:
|
38
|
+
COVERAGE: on
|
39
|
+
CC_TEST_REPORTER_ID: 45cd2174f49b570406e294ff393d456c4ae8532cf16dd6430abb06d8a0722a28
|
40
|
+
with:
|
41
|
+
coverageCommand: bundle exec rspec
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
require: rubocop-rake
|
2
|
+
|
1
3
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
4
|
+
TargetRubyVersion: 2.5
|
3
5
|
Exclude:
|
4
6
|
- 'bin/**/*'
|
5
7
|
- 'vendor/**/*'
|
8
|
+
NewCops: enable
|
6
9
|
|
7
10
|
Layout/EmptyLineAfterGuardClause:
|
8
11
|
Enabled: false
|
@@ -16,7 +19,8 @@ Layout/MultilineMethodCallIndentation:
|
|
16
19
|
EnforcedStyle: indented
|
17
20
|
|
18
21
|
Metrics/AbcSize:
|
19
|
-
|
22
|
+
Exclude:
|
23
|
+
- 'lib/mrkt/concerns/connection.rb'
|
20
24
|
Metrics/BlockLength:
|
21
25
|
Exclude:
|
22
26
|
- 'spec/**/*'
|
data/Gemfile.lock
CHANGED
@@ -1,72 +1,95 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mrkt (
|
5
|
-
faraday (
|
6
|
-
faraday_middleware (
|
4
|
+
mrkt (1.1.1)
|
5
|
+
faraday (~> 1.0)
|
6
|
+
faraday_middleware (~> 1.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
addressable (2.
|
11
|
+
addressable (2.8.0)
|
12
12
|
public_suffix (>= 2.0.2, < 5.0)
|
13
|
-
ast (2.4.
|
14
|
-
byebug (11.
|
15
|
-
coderay (1.1.
|
16
|
-
crack (0.4.
|
17
|
-
|
18
|
-
diff-lcs (1.
|
19
|
-
docile (1.3.
|
20
|
-
faraday (
|
13
|
+
ast (2.4.2)
|
14
|
+
byebug (11.1.3)
|
15
|
+
coderay (1.1.3)
|
16
|
+
crack (0.4.5)
|
17
|
+
rexml
|
18
|
+
diff-lcs (1.4.4)
|
19
|
+
docile (1.3.5)
|
20
|
+
faraday (1.5.1)
|
21
|
+
faraday-em_http (~> 1.0)
|
22
|
+
faraday-em_synchrony (~> 1.0)
|
23
|
+
faraday-excon (~> 1.1)
|
24
|
+
faraday-httpclient (~> 1.0.1)
|
25
|
+
faraday-net_http (~> 1.0)
|
26
|
+
faraday-net_http_persistent (~> 1.1)
|
27
|
+
faraday-patron (~> 1.0)
|
21
28
|
multipart-post (>= 1.2, < 3)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
29
|
+
ruby2_keywords (>= 0.0.4)
|
30
|
+
faraday-em_http (1.0.0)
|
31
|
+
faraday-em_synchrony (1.0.0)
|
32
|
+
faraday-excon (1.1.0)
|
33
|
+
faraday-httpclient (1.0.1)
|
34
|
+
faraday-net_http (1.0.1)
|
35
|
+
faraday-net_http_persistent (1.2.0)
|
36
|
+
faraday-patron (1.0.0)
|
37
|
+
faraday_middleware (1.0.0)
|
38
|
+
faraday (~> 1.0)
|
39
|
+
gem-release (2.2.2)
|
40
|
+
hashdiff (1.0.1)
|
41
|
+
method_source (1.0.0)
|
28
42
|
multipart-post (2.1.1)
|
29
|
-
parallel (1.
|
30
|
-
parser (
|
31
|
-
ast (~> 2.4.
|
32
|
-
pry (0.
|
33
|
-
coderay (~> 1.1
|
34
|
-
method_source (~>
|
35
|
-
pry-byebug (3.
|
43
|
+
parallel (1.20.1)
|
44
|
+
parser (3.0.2.0)
|
45
|
+
ast (~> 2.4.1)
|
46
|
+
pry (0.13.1)
|
47
|
+
coderay (~> 1.1)
|
48
|
+
method_source (~> 1.0)
|
49
|
+
pry-byebug (3.9.0)
|
36
50
|
byebug (~> 11.0)
|
37
|
-
pry (~> 0.
|
38
|
-
public_suffix (4.0.
|
51
|
+
pry (~> 0.13.0)
|
52
|
+
public_suffix (4.0.6)
|
39
53
|
rainbow (3.0.0)
|
40
|
-
rake (
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
rspec-
|
45
|
-
|
46
|
-
rspec-
|
47
|
-
rspec-
|
54
|
+
rake (13.0.6)
|
55
|
+
regexp_parser (2.1.1)
|
56
|
+
rexml (3.2.5)
|
57
|
+
rspec (3.10.0)
|
58
|
+
rspec-core (~> 3.10.0)
|
59
|
+
rspec-expectations (~> 3.10.0)
|
60
|
+
rspec-mocks (~> 3.10.0)
|
61
|
+
rspec-core (3.10.1)
|
62
|
+
rspec-support (~> 3.10.0)
|
63
|
+
rspec-expectations (3.10.1)
|
48
64
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
-
rspec-support (~> 3.
|
50
|
-
rspec-mocks (3.
|
65
|
+
rspec-support (~> 3.10.0)
|
66
|
+
rspec-mocks (3.10.2)
|
51
67
|
diff-lcs (>= 1.2.0, < 2.0)
|
52
|
-
rspec-support (~> 3.
|
53
|
-
rspec-support (3.
|
54
|
-
rubocop (
|
55
|
-
jaro_winkler (~> 1.5.1)
|
68
|
+
rspec-support (~> 3.10.0)
|
69
|
+
rspec-support (3.10.2)
|
70
|
+
rubocop (1.18.4)
|
56
71
|
parallel (~> 1.10)
|
57
|
-
parser (>=
|
72
|
+
parser (>= 3.0.0.0)
|
58
73
|
rainbow (>= 2.2.2, < 4.0)
|
74
|
+
regexp_parser (>= 1.8, < 3.0)
|
75
|
+
rexml
|
76
|
+
rubocop-ast (>= 1.8.0, < 2.0)
|
59
77
|
ruby-progressbar (~> 1.7)
|
60
|
-
unicode-display_width (>= 1.4.0, <
|
61
|
-
|
62
|
-
|
63
|
-
|
78
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
79
|
+
rubocop-ast (1.8.0)
|
80
|
+
parser (>= 3.0.1.1)
|
81
|
+
rubocop-rake (0.6.0)
|
82
|
+
rubocop (~> 1.0)
|
83
|
+
ruby-progressbar (1.11.0)
|
84
|
+
ruby2_keywords (0.0.5)
|
85
|
+
simplecov (0.21.2)
|
64
86
|
docile (~> 1.1)
|
65
|
-
|
66
|
-
|
67
|
-
simplecov-html (0.
|
68
|
-
|
69
|
-
|
87
|
+
simplecov-html (~> 0.11)
|
88
|
+
simplecov_json_formatter (~> 0.1)
|
89
|
+
simplecov-html (0.12.3)
|
90
|
+
simplecov_json_formatter (0.1.3)
|
91
|
+
unicode-display_width (2.0.0)
|
92
|
+
webmock (3.13.0)
|
70
93
|
addressable (>= 2.3.6)
|
71
94
|
crack (>= 0.3.2)
|
72
95
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -75,14 +98,16 @@ PLATFORMS
|
|
75
98
|
ruby
|
76
99
|
|
77
100
|
DEPENDENCIES
|
78
|
-
bundler (~>
|
101
|
+
bundler (~> 2.0)
|
102
|
+
gem-release (~> 2.1)
|
79
103
|
mrkt!
|
80
104
|
pry-byebug (~> 3.7)
|
81
|
-
rake (~>
|
105
|
+
rake (~> 13.0)
|
82
106
|
rspec (~> 3.2)
|
83
|
-
rubocop (~>
|
84
|
-
|
107
|
+
rubocop (~> 1.18.4)
|
108
|
+
rubocop-rake (~> 0.6.0)
|
109
|
+
simplecov (~> 0.21.2)
|
85
110
|
webmock (~> 3.1)
|
86
111
|
|
87
112
|
BUNDLED WITH
|
88
|
-
1.
|
113
|
+
2.1.4
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
[![Code Climate](https://codeclimate.com/github/raszi/mrkt/badges/gpa.svg)](https://codeclimate.com/github/raszi/mrkt)
|
5
5
|
[![Test Coverage](https://codeclimate.com/github/raszi/mrkt/badges/coverage.svg)](https://codeclimate.com/github/raszi/mrkt)
|
6
6
|
[![Gem Version](https://badge.fury.io/rb/mrkt.svg)](https://badge.fury.io/rb/mrkt)
|
7
|
+
[![Total Downloads](https://badgen.net/rubygems/dt/mrkt)](https://rubygems.org/gems/mrkt)
|
7
8
|
|
8
9
|
This gem provides some level of abstraction to Marketo REST APIs. Please note that this gem is alpha quality.
|
9
10
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'mrkt/
|
1
|
+
require 'mrkt/faraday'
|
2
2
|
|
3
3
|
module Mrkt
|
4
4
|
module Connection
|
@@ -7,7 +7,7 @@ module Mrkt
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def init_connection
|
10
|
-
Faraday.new(
|
10
|
+
::Faraday.new(options) do |conn|
|
11
11
|
conn.request :multipart
|
12
12
|
conn.request :url_encoded
|
13
13
|
|
@@ -17,8 +17,17 @@ module Mrkt
|
|
17
17
|
conn.options.timeout = @options[:read_timeout] if @options.key?(:read_timeout)
|
18
18
|
conn.options.open_timeout = @options[:open_timeout] if @options.key?(:open_timeout)
|
19
19
|
|
20
|
-
conn.adapter @options.fetch(:adapter, Faraday.default_adapter)
|
20
|
+
conn.adapter @options.fetch(:adapter, ::Faraday.default_adapter)
|
21
21
|
end
|
22
22
|
end
|
23
|
+
|
24
|
+
def options
|
25
|
+
{
|
26
|
+
url: "https://#{@host}",
|
27
|
+
request: {
|
28
|
+
params_encoder: Mrkt::Faraday::ParamsEncoder
|
29
|
+
}
|
30
|
+
}
|
31
|
+
end
|
23
32
|
end
|
24
33
|
end
|
@@ -13,8 +13,8 @@ module Mrkt
|
|
13
13
|
nextPageToken: next_page_token
|
14
14
|
}
|
15
15
|
|
16
|
-
params[:activityTypeIds] = activity_type_ids
|
17
|
-
params[:leadIds] = lead_ids
|
16
|
+
params[:activityTypeIds] = activity_type_ids unless blank?(activity_type_ids)
|
17
|
+
params[:leadIds] = lead_ids unless blank?(lead_ids)
|
18
18
|
|
19
19
|
get('/rest/v1/activities.json', params)
|
20
20
|
end
|
@@ -2,7 +2,7 @@ module Mrkt
|
|
2
2
|
module CrudLeads
|
3
3
|
def get_lead_by_id(id, fields: nil)
|
4
4
|
optional = {
|
5
|
-
fields: fields
|
5
|
+
fields: fields
|
6
6
|
}
|
7
7
|
|
8
8
|
get("/rest/v1/lead/#{id}.json", {}, optional)
|
@@ -11,7 +11,7 @@ module Mrkt
|
|
11
11
|
def get_leads(filter_type, filter_values, fields: nil, batch_size: nil, next_page_token: nil)
|
12
12
|
params = {
|
13
13
|
filterType: filter_type,
|
14
|
-
filterValues: filter_values
|
14
|
+
filterValues: filter_values
|
15
15
|
}
|
16
16
|
|
17
17
|
optional = {
|
@@ -47,18 +47,20 @@ module Mrkt
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def associate_lead(id, cookie)
|
50
|
-
params = Faraday::
|
51
|
-
params[:cookie] = cookie
|
50
|
+
params = Mrkt::Faraday::ParamsEncoder.encode(cookie: cookie)
|
52
51
|
|
53
|
-
post_json("/rest/v1/leads/#{id}/associate.json?#{params
|
52
|
+
post_json("/rest/v1/leads/#{id}/associate.json?#{params}")
|
54
53
|
end
|
55
54
|
|
56
55
|
def merge_leads(winning_lead_id, losing_lead_ids, merge_in_crm: false)
|
57
|
-
params =
|
56
|
+
params = {}
|
57
|
+
|
58
58
|
params[:mergeInCRM] = merge_in_crm
|
59
|
-
params[:leadIds] = losing_lead_ids
|
59
|
+
params[:leadIds] = losing_lead_ids if losing_lead_ids
|
60
|
+
|
61
|
+
query_params = Mrkt::Faraday::ParamsEncoder.encode(params)
|
60
62
|
|
61
|
-
post_json("/rest/v1/leads/#{winning_lead_id}/merge.json?#{
|
63
|
+
post_json("/rest/v1/leads/#{winning_lead_id}/merge.json?#{query_params}")
|
62
64
|
end
|
63
65
|
|
64
66
|
def describe_lead
|
@@ -3,7 +3,7 @@ module Mrkt
|
|
3
3
|
def import_custom_object(file, custom_object, format = 'csv')
|
4
4
|
params = {
|
5
5
|
format: format,
|
6
|
-
file: Faraday::UploadIO.new(file, 'text/csv')
|
6
|
+
file: ::Faraday::UploadIO.new(file, 'text/csv')
|
7
7
|
}
|
8
8
|
|
9
9
|
post("/bulk/v1/customobjects/#{custom_object}/import.json", params)
|
data/lib/mrkt/errors.rb
CHANGED
@@ -40,7 +40,26 @@ class Mrkt::Errors
|
|
40
40
|
1011 => 'FieldNotSupported',
|
41
41
|
1012 => 'InvalidCookieValue',
|
42
42
|
1013 => 'ObjectNotFound',
|
43
|
-
1014 => 'FailedToCreateObject'
|
43
|
+
1014 => 'FailedToCreateObject',
|
44
|
+
1015 => 'LeadNotInList',
|
45
|
+
1016 => 'TooManyImports',
|
46
|
+
1017 => 'ObjectAlreadyExists',
|
47
|
+
1018 => 'CRMEnabled',
|
48
|
+
1019 => 'ImportInProgress',
|
49
|
+
1020 => 'TooManyCloneToProgram',
|
50
|
+
1021 => 'CompanyUpdateNotAllowed',
|
51
|
+
1022 => 'ObjectInUse',
|
52
|
+
1025 => 'ProgramStatusNotFound',
|
53
|
+
1026 => 'CustomObjectNotEnabled',
|
54
|
+
1027 => 'MaxActivityTypeLimitReached',
|
55
|
+
1028 => 'MaxFieldLimitReached',
|
56
|
+
1029 => 'BulkExportQuotaExceeded',
|
57
|
+
1035 => 'UnsupportedFilterType',
|
58
|
+
1036 => 'DuplicateObjectFoundInInput',
|
59
|
+
1042 => 'InvalidRunAtDate',
|
60
|
+
1048 => 'CustomObjectDiscardDraftFailed',
|
61
|
+
1049 => 'FailedToCreateActivity',
|
62
|
+
1077 => 'MergeLeadsCallFailedDueToFieldLength'
|
44
63
|
}.freeze
|
45
64
|
|
46
65
|
RESPONSE_CODE_TO_ERROR.each_value do |class_name|
|
data/lib/mrkt/faraday.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module Mrkt
|
2
|
+
module Faraday
|
3
|
+
class ParamsEncoder
|
4
|
+
class << self
|
5
|
+
def encode(hash)
|
6
|
+
new_hash = hash.transform_values { |v| encode_value(v) }
|
7
|
+
::Faraday::NestedParamsEncoder.encode(new_hash)
|
8
|
+
end
|
9
|
+
|
10
|
+
def decode(string)
|
11
|
+
::Faraday::NestedParamsEncoder.decode(string)
|
12
|
+
end
|
13
|
+
|
14
|
+
def encode_value(value)
|
15
|
+
value.respond_to?(:join) ? value.join(',') : value
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,11 +1,7 @@
|
|
1
|
-
require '
|
1
|
+
require 'mrkt/faraday_middleware/response'
|
2
2
|
|
3
3
|
module Mrkt
|
4
|
-
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
if Faraday::Middleware.respond_to? :register_middleware
|
9
|
-
Faraday::Response.register_middleware mkto: -> { Mrkt::FaradayMiddleware::Response }
|
4
|
+
if ::Faraday::Middleware.respond_to?(:register_middleware)
|
5
|
+
::Faraday::Response.register_middleware(mkto: Mrkt::FaradayMiddleware::Response)
|
10
6
|
end
|
11
7
|
end
|
data/lib/mrkt/version.rb
CHANGED
data/mrkt.gemspec
CHANGED
@@ -17,16 +17,18 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = %w[lib]
|
19
19
|
|
20
|
-
spec.required_ruby_version = '
|
20
|
+
spec.required_ruby_version = '>= 2.5'
|
21
21
|
|
22
|
-
spec.add_dependency 'faraday', '
|
23
|
-
spec.add_dependency 'faraday_middleware', '
|
22
|
+
spec.add_dependency 'faraday', '~> 1.0'
|
23
|
+
spec.add_dependency 'faraday_middleware', '~> 1.0'
|
24
24
|
|
25
|
-
spec.add_development_dependency 'bundler', '~>
|
25
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
26
|
+
spec.add_development_dependency 'gem-release', '~> 2.1'
|
26
27
|
spec.add_development_dependency 'pry-byebug', '~> 3.7'
|
27
|
-
spec.add_development_dependency 'rake', '~>
|
28
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
28
29
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
29
|
-
spec.add_development_dependency 'rubocop', '~>
|
30
|
-
spec.add_development_dependency '
|
30
|
+
spec.add_development_dependency 'rubocop', '~> 1.18.4'
|
31
|
+
spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
32
|
+
spec.add_development_dependency 'simplecov', '~> 0.21.2'
|
31
33
|
spec.add_development_dependency 'webmock', '~> 3.1'
|
32
34
|
end
|
@@ -211,7 +211,7 @@ describe Mrkt::CrudLeads do
|
|
211
211
|
subject { client.merge_leads(id, losing_lead_ids) }
|
212
212
|
|
213
213
|
before do
|
214
|
-
params = Faraday::Utils::ParamsHash.new
|
214
|
+
params = ::Faraday::Utils::ParamsHash.new
|
215
215
|
params[:mergeInCRM] = false
|
216
216
|
params[:leadIds] = losing_lead_ids.join(',') if losing_lead_ids
|
217
217
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
describe Mrkt::Faraday::ParamsEncoder do
|
2
|
+
describe '.encode' do
|
3
|
+
let(:params) do
|
4
|
+
{
|
5
|
+
string: 'foobar',
|
6
|
+
number: 1,
|
7
|
+
boolean: true,
|
8
|
+
array: [1, 2, 3]
|
9
|
+
}
|
10
|
+
end
|
11
|
+
|
12
|
+
subject { described_class.encode(params) }
|
13
|
+
|
14
|
+
it { is_expected.to eq(Faraday::Utils::ParamsHash.new.merge(params.merge(array: '1,2,3')).to_query) }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '.decode' do
|
18
|
+
let(:value) { 'foo=foo&bar=bar' }
|
19
|
+
|
20
|
+
subject { described_class.decode(value) }
|
21
|
+
|
22
|
+
it { is_expected.to eq('foo' => 'foo', 'bar' => 'bar') }
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mrkt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KARASZI István
|
@@ -9,62 +9,64 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: 0.9.0
|
21
|
-
- - "<="
|
18
|
+
- - "~>"
|
22
19
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0
|
20
|
+
version: '1.0'
|
24
21
|
type: :runtime
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
|
-
- - "
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: 0.9.0
|
31
|
-
- - "<="
|
25
|
+
- - "~>"
|
32
26
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0
|
27
|
+
version: '1.0'
|
34
28
|
- !ruby/object:Gem::Dependency
|
35
29
|
name: faraday_middleware
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
37
31
|
requirements:
|
38
|
-
- - "
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.9.0
|
41
|
-
- - "<="
|
32
|
+
- - "~>"
|
42
33
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0
|
34
|
+
version: '1.0'
|
44
35
|
type: :runtime
|
45
36
|
prerelease: false
|
46
37
|
version_requirements: !ruby/object:Gem::Requirement
|
47
38
|
requirements:
|
48
|
-
- - "
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 0.9.0
|
51
|
-
- - "<="
|
39
|
+
- - "~>"
|
52
40
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0
|
41
|
+
version: '1.0'
|
54
42
|
- !ruby/object:Gem::Dependency
|
55
43
|
name: bundler
|
56
44
|
requirement: !ruby/object:Gem::Requirement
|
57
45
|
requirements:
|
58
46
|
- - "~>"
|
59
47
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
48
|
+
version: '2.0'
|
61
49
|
type: :development
|
62
50
|
prerelease: false
|
63
51
|
version_requirements: !ruby/object:Gem::Requirement
|
64
52
|
requirements:
|
65
53
|
- - "~>"
|
66
54
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
55
|
+
version: '2.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: gem-release
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '2.1'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.1'
|
68
70
|
- !ruby/object:Gem::Dependency
|
69
71
|
name: pry-byebug
|
70
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -85,14 +87,14 @@ dependencies:
|
|
85
87
|
requirements:
|
86
88
|
- - "~>"
|
87
89
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
90
|
+
version: '13.0'
|
89
91
|
type: :development
|
90
92
|
prerelease: false
|
91
93
|
version_requirements: !ruby/object:Gem::Requirement
|
92
94
|
requirements:
|
93
95
|
- - "~>"
|
94
96
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
97
|
+
version: '13.0'
|
96
98
|
- !ruby/object:Gem::Dependency
|
97
99
|
name: rspec
|
98
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,28 +115,42 @@ dependencies:
|
|
113
115
|
requirements:
|
114
116
|
- - "~>"
|
115
117
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
118
|
+
version: 1.18.4
|
117
119
|
type: :development
|
118
120
|
prerelease: false
|
119
121
|
version_requirements: !ruby/object:Gem::Requirement
|
120
122
|
requirements:
|
121
123
|
- - "~>"
|
122
124
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
125
|
+
version: 1.18.4
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rubocop-rake
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 0.6.0
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 0.6.0
|
124
140
|
- !ruby/object:Gem::Dependency
|
125
141
|
name: simplecov
|
126
142
|
requirement: !ruby/object:Gem::Requirement
|
127
143
|
requirements:
|
128
144
|
- - "~>"
|
129
145
|
- !ruby/object:Gem::Version
|
130
|
-
version: 0.
|
146
|
+
version: 0.21.2
|
131
147
|
type: :development
|
132
148
|
prerelease: false
|
133
149
|
version_requirements: !ruby/object:Gem::Requirement
|
134
150
|
requirements:
|
135
151
|
- - "~>"
|
136
152
|
- !ruby/object:Gem::Version
|
137
|
-
version: 0.
|
153
|
+
version: 0.21.2
|
138
154
|
- !ruby/object:Gem::Dependency
|
139
155
|
name: webmock
|
140
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,10 +173,11 @@ executables: []
|
|
157
173
|
extensions: []
|
158
174
|
extra_rdoc_files: []
|
159
175
|
files:
|
176
|
+
- ".github/dependabot.yml"
|
177
|
+
- ".github/workflows/ruby.yml"
|
160
178
|
- ".gitignore"
|
161
179
|
- ".rspec"
|
162
180
|
- ".rubocop.yml"
|
163
|
-
- ".travis.yml"
|
164
181
|
- Gemfile
|
165
182
|
- Gemfile.lock
|
166
183
|
- LICENSE
|
@@ -183,6 +200,8 @@ files:
|
|
183
200
|
- lib/mrkt/concerns/import_custom_objects.rb
|
184
201
|
- lib/mrkt/concerns/import_leads.rb
|
185
202
|
- lib/mrkt/errors.rb
|
203
|
+
- lib/mrkt/faraday.rb
|
204
|
+
- lib/mrkt/faraday/params_encoder.rb
|
186
205
|
- lib/mrkt/faraday_middleware.rb
|
187
206
|
- lib/mrkt/faraday_middleware/response.rb
|
188
207
|
- lib/mrkt/version.rb
|
@@ -200,6 +219,7 @@ files:
|
|
200
219
|
- spec/concerns/import_custom_objects_spec.rb
|
201
220
|
- spec/concerns/import_leads_spec.rb
|
202
221
|
- spec/errors_spec.rb
|
222
|
+
- spec/faraday/params_encoder_spec.rb
|
203
223
|
- spec/mkto_rest_spec.rb
|
204
224
|
- spec/spec_helper.rb
|
205
225
|
- spec/support/initialized_client.rb
|
@@ -214,16 +234,16 @@ require_paths:
|
|
214
234
|
- lib
|
215
235
|
required_ruby_version: !ruby/object:Gem::Requirement
|
216
236
|
requirements:
|
217
|
-
- - "
|
237
|
+
- - ">="
|
218
238
|
- !ruby/object:Gem::Version
|
219
|
-
version: '2.
|
239
|
+
version: '2.5'
|
220
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
241
|
requirements:
|
222
242
|
- - ">="
|
223
243
|
- !ruby/object:Gem::Version
|
224
244
|
version: '0'
|
225
245
|
requirements: []
|
226
|
-
rubygems_version: 3.
|
246
|
+
rubygems_version: 3.1.4
|
227
247
|
signing_key:
|
228
248
|
specification_version: 4
|
229
249
|
summary: Marketo REST API Facade
|
@@ -241,6 +261,7 @@ test_files:
|
|
241
261
|
- spec/concerns/import_custom_objects_spec.rb
|
242
262
|
- spec/concerns/import_leads_spec.rb
|
243
263
|
- spec/errors_spec.rb
|
264
|
+
- spec/faraday/params_encoder_spec.rb
|
244
265
|
- spec/mkto_rest_spec.rb
|
245
266
|
- spec/spec_helper.rb
|
246
267
|
- spec/support/initialized_client.rb
|
data/.travis.yml
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
env:
|
2
|
-
global:
|
3
|
-
- CC_TEST_REPORTER_ID=45cd2174f49b570406e294ff393d456c4ae8532cf16dd6430abb06d8a0722a28
|
4
|
-
- COVERAGE=on
|
5
|
-
language: ruby
|
6
|
-
rvm:
|
7
|
-
- 2.3.6
|
8
|
-
- 2.4.3
|
9
|
-
- 2.5.0
|
10
|
-
- 2.6.0
|
11
|
-
before_install:
|
12
|
-
- gem update --system
|
13
|
-
- bundle update --bundler
|
14
|
-
before_script:
|
15
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
16
|
-
- chmod +x ./cc-test-reporter
|
17
|
-
- ./cc-test-reporter before-build
|
18
|
-
script:
|
19
|
-
- bundle exec rspec
|
20
|
-
- bundle exec rubocop
|
21
|
-
after_script:
|
22
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|