mrkt 1.0.0 → 1.2.0
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 +5 -36
- data/Gemfile.lock +68 -48
- 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/params_encoder.rb +20 -0
- data/lib/mrkt/faraday.rb +4 -0
- data/lib/mrkt/faraday_middleware.rb +3 -7
- data/lib/mrkt/version.rb +1 -1
- data/mrkt.gemspec +6 -5
- data/spec/concerns/crud_leads_spec.rb +1 -1
- data/spec/faraday/params_encoder_spec.rb +24 -0
- metadata +32 -13
- data/.travis.yml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41d861185c2759674a5688a61bd06294e6ca18460bd1ff868df05bc3932018d5
|
4
|
+
data.tar.gz: e52dac6cb6ebbba08e079634c7ca72545c358e23305feffb254e243b3b741786
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5de0d92b43516840e7e71a83253414e157e5812ba00b6bb4bdada5b665c80a06cc24e6a89aec6e01b19515e72032cc6428075adf17acf56d12b48d7caee38545
|
7
|
+
data.tar.gz: 010fbf3fb5baa8f5a904c1858c938f6fd4d3f344c324b782aa1080a08343b6c7a8fd5f7f1a8c93a4c666cb361a7a2d2c9fd773a18f3bfe2ad6f39e7ce7f056c5
|
@@ -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,11 +1,12 @@
|
|
1
|
+
require: rubocop-rake
|
2
|
+
|
1
3
|
AllCops:
|
2
4
|
TargetRubyVersion: 2.5
|
3
5
|
Exclude:
|
4
6
|
- 'bin/**/*'
|
5
7
|
- 'vendor/**/*'
|
8
|
+
NewCops: enable
|
6
9
|
|
7
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
8
|
-
Enabled: true
|
9
10
|
Layout/EmptyLineAfterGuardClause:
|
10
11
|
Enabled: false
|
11
12
|
Layout/FirstHashElementIndentation:
|
@@ -16,20 +17,10 @@ Layout/LineLength:
|
|
16
17
|
Max: 128
|
17
18
|
Layout/MultilineMethodCallIndentation:
|
18
19
|
EnforcedStyle: indented
|
19
|
-
Layout/SpaceAroundMethodCallOperator:
|
20
|
-
Enabled: true
|
21
|
-
|
22
|
-
Lint/DeprecatedOpenSSLConstant:
|
23
|
-
Enabled: true
|
24
|
-
Lint/MixedRegexpCaptureTypes:
|
25
|
-
Enabled: true
|
26
|
-
Lint/RaiseException:
|
27
|
-
Enabled: true
|
28
|
-
Lint/StructNewOverride:
|
29
|
-
Enabled: true
|
30
20
|
|
31
21
|
Metrics/AbcSize:
|
32
|
-
|
22
|
+
Exclude:
|
23
|
+
- 'lib/mrkt/concerns/connection.rb'
|
33
24
|
Metrics/BlockLength:
|
34
25
|
Exclude:
|
35
26
|
- 'spec/**/*'
|
@@ -41,31 +32,9 @@ Metrics/ParameterLists:
|
|
41
32
|
Naming/AccessorMethodName:
|
42
33
|
Enabled: false
|
43
34
|
|
44
|
-
Style/AccessorGrouping:
|
45
|
-
Enabled: true
|
46
|
-
Style/BisectedAttrAccessor:
|
47
|
-
Enabled: true
|
48
35
|
Style/ClassAndModuleChildren:
|
49
36
|
Enabled: false
|
50
37
|
Style/Documentation:
|
51
38
|
Enabled: false
|
52
|
-
Style/ExponentialNotation:
|
53
|
-
Enabled: true
|
54
39
|
Style/FrozenStringLiteralComment:
|
55
40
|
Enabled: false
|
56
|
-
Style/HashEachMethods:
|
57
|
-
Enabled: true
|
58
|
-
Style/HashTransformKeys:
|
59
|
-
Enabled: true
|
60
|
-
Style/HashTransformValues:
|
61
|
-
Enabled: true
|
62
|
-
Style/RedundantAssignment:
|
63
|
-
Enabled: true
|
64
|
-
Style/RedundantFetchBlock:
|
65
|
-
Enabled: true
|
66
|
-
Style/RedundantRegexpCharacterClass:
|
67
|
-
Enabled: true
|
68
|
-
Style/RedundantRegexpEscape:
|
69
|
-
Enabled: true
|
70
|
-
Style/SlicingWithRange:
|
71
|
-
Enabled: true
|
data/Gemfile.lock
CHANGED
@@ -1,33 +1,49 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mrkt (1.
|
4
|
+
mrkt (1.2.0)
|
5
5
|
faraday (~> 1.0)
|
6
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.
|
13
|
+
ast (2.4.2)
|
14
14
|
byebug (11.1.3)
|
15
15
|
coderay (1.1.3)
|
16
|
-
crack (0.4.
|
17
|
-
|
16
|
+
crack (0.4.5)
|
17
|
+
rexml
|
18
18
|
diff-lcs (1.4.4)
|
19
|
-
docile (1.3.
|
20
|
-
faraday (1.
|
19
|
+
docile (1.3.5)
|
20
|
+
faraday (1.7.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)
|
28
|
+
faraday-rack (~> 1.0)
|
21
29
|
multipart-post (>= 1.2, < 3)
|
22
|
-
|
30
|
+
ruby2_keywords (>= 0.0.4)
|
31
|
+
faraday-em_http (1.0.0)
|
32
|
+
faraday-em_synchrony (1.0.0)
|
33
|
+
faraday-excon (1.1.0)
|
34
|
+
faraday-httpclient (1.0.1)
|
35
|
+
faraday-net_http (1.0.1)
|
36
|
+
faraday-net_http_persistent (1.2.0)
|
37
|
+
faraday-patron (1.0.0)
|
38
|
+
faraday-rack (1.0.0)
|
39
|
+
faraday_middleware (1.1.0)
|
23
40
|
faraday (~> 1.0)
|
24
|
-
gem-release (2.
|
41
|
+
gem-release (2.2.2)
|
25
42
|
hashdiff (1.0.1)
|
26
|
-
json (2.3.1)
|
27
43
|
method_source (1.0.0)
|
28
44
|
multipart-post (2.1.1)
|
29
|
-
parallel (1.
|
30
|
-
parser (
|
45
|
+
parallel (1.20.1)
|
46
|
+
parser (3.0.2.0)
|
31
47
|
ast (~> 2.4.1)
|
32
48
|
pry (0.13.1)
|
33
49
|
coderay (~> 1.1)
|
@@ -35,45 +51,48 @@ GEM
|
|
35
51
|
pry-byebug (3.9.0)
|
36
52
|
byebug (~> 11.0)
|
37
53
|
pry (~> 0.13.0)
|
38
|
-
public_suffix (4.0.
|
54
|
+
public_suffix (4.0.6)
|
39
55
|
rainbow (3.0.0)
|
40
|
-
rake (
|
41
|
-
regexp_parser (1.
|
42
|
-
rexml (3.2.
|
43
|
-
rspec (3.
|
44
|
-
rspec-core (~> 3.
|
45
|
-
rspec-expectations (~> 3.
|
46
|
-
rspec-mocks (~> 3.
|
47
|
-
rspec-core (3.
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-expectations (3.
|
56
|
+
rake (13.0.6)
|
57
|
+
regexp_parser (2.1.1)
|
58
|
+
rexml (3.2.5)
|
59
|
+
rspec (3.10.0)
|
60
|
+
rspec-core (~> 3.10.0)
|
61
|
+
rspec-expectations (~> 3.10.0)
|
62
|
+
rspec-mocks (~> 3.10.0)
|
63
|
+
rspec-core (3.10.1)
|
64
|
+
rspec-support (~> 3.10.0)
|
65
|
+
rspec-expectations (3.10.1)
|
50
66
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-mocks (3.
|
67
|
+
rspec-support (~> 3.10.0)
|
68
|
+
rspec-mocks (3.10.2)
|
53
69
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-support (3.
|
56
|
-
rubocop (
|
70
|
+
rspec-support (~> 3.10.0)
|
71
|
+
rspec-support (3.10.2)
|
72
|
+
rubocop (1.20.0)
|
57
73
|
parallel (~> 1.10)
|
58
|
-
parser (>=
|
74
|
+
parser (>= 3.0.0.0)
|
59
75
|
rainbow (>= 2.2.2, < 4.0)
|
60
|
-
regexp_parser (>= 1.
|
76
|
+
regexp_parser (>= 1.8, < 3.0)
|
61
77
|
rexml
|
62
|
-
rubocop-ast (>=
|
78
|
+
rubocop-ast (>= 1.9.1, < 2.0)
|
63
79
|
ruby-progressbar (~> 1.7)
|
64
|
-
unicode-display_width (>= 1.4.0, <
|
65
|
-
rubocop-ast (
|
66
|
-
parser (>=
|
67
|
-
|
68
|
-
|
69
|
-
|
80
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
81
|
+
rubocop-ast (1.11.0)
|
82
|
+
parser (>= 3.0.1.1)
|
83
|
+
rubocop-rake (0.6.0)
|
84
|
+
rubocop (~> 1.0)
|
85
|
+
ruby-progressbar (1.11.0)
|
86
|
+
ruby2_keywords (0.0.5)
|
87
|
+
simplecov (0.21.2)
|
70
88
|
docile (~> 1.1)
|
71
|
-
|
72
|
-
|
73
|
-
simplecov-html (0.
|
74
|
-
|
75
|
-
|
76
|
-
|
89
|
+
simplecov-html (~> 0.11)
|
90
|
+
simplecov_json_formatter (~> 0.1)
|
91
|
+
simplecov-html (0.12.3)
|
92
|
+
simplecov_json_formatter (0.1.3)
|
93
|
+
unicode-display_width (2.0.0)
|
94
|
+
webmock (3.14.0)
|
95
|
+
addressable (>= 2.8.0)
|
77
96
|
crack (>= 0.3.2)
|
78
97
|
hashdiff (>= 0.4.0, < 2.0.0)
|
79
98
|
|
@@ -81,15 +100,16 @@ PLATFORMS
|
|
81
100
|
ruby
|
82
101
|
|
83
102
|
DEPENDENCIES
|
84
|
-
bundler (~>
|
103
|
+
bundler (~> 2.0)
|
85
104
|
gem-release (~> 2.1)
|
86
105
|
mrkt!
|
87
106
|
pry-byebug (~> 3.7)
|
88
|
-
rake (~>
|
107
|
+
rake (~> 13.0)
|
89
108
|
rspec (~> 3.2)
|
90
|
-
rubocop (~>
|
91
|
-
|
109
|
+
rubocop (~> 1.20.0)
|
110
|
+
rubocop-rake (~> 0.6.0)
|
111
|
+
simplecov (~> 0.21.2)
|
92
112
|
webmock (~> 3.1)
|
93
113
|
|
94
114
|
BUNDLED WITH
|
95
|
-
1.
|
115
|
+
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|
|
@@ -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
|
data/lib/mrkt/faraday.rb
ADDED
@@ -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,17 +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
22
|
spec.add_dependency 'faraday', '~> 1.0'
|
23
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
26
|
spec.add_development_dependency 'gem-release', '~> 2.1'
|
27
27
|
spec.add_development_dependency 'pry-byebug', '~> 3.7'
|
28
|
-
spec.add_development_dependency 'rake', '~>
|
28
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
29
29
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
30
|
-
spec.add_development_dependency 'rubocop', '~>
|
31
|
-
spec.add_development_dependency '
|
30
|
+
spec.add_development_dependency 'rubocop', '~> 1.20.0'
|
31
|
+
spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
32
|
+
spec.add_development_dependency 'simplecov', '~> 0.21.2'
|
32
33
|
spec.add_development_dependency 'webmock', '~> 3.1'
|
33
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: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KARASZI István
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '2.0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '2.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: gem-release
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
90
|
+
version: '13.0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
97
|
+
version: '13.0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rspec
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,28 +115,42 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
118
|
+
version: 1.20.0
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
125
|
+
version: 1.20.0
|
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
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: simplecov
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
129
143
|
requirements:
|
130
144
|
- - "~>"
|
131
145
|
- !ruby/object:Gem::Version
|
132
|
-
version: 0.
|
146
|
+
version: 0.21.2
|
133
147
|
type: :development
|
134
148
|
prerelease: false
|
135
149
|
version_requirements: !ruby/object:Gem::Requirement
|
136
150
|
requirements:
|
137
151
|
- - "~>"
|
138
152
|
- !ruby/object:Gem::Version
|
139
|
-
version: 0.
|
153
|
+
version: 0.21.2
|
140
154
|
- !ruby/object:Gem::Dependency
|
141
155
|
name: webmock
|
142
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,10 +173,11 @@ executables: []
|
|
159
173
|
extensions: []
|
160
174
|
extra_rdoc_files: []
|
161
175
|
files:
|
176
|
+
- ".github/dependabot.yml"
|
177
|
+
- ".github/workflows/ruby.yml"
|
162
178
|
- ".gitignore"
|
163
179
|
- ".rspec"
|
164
180
|
- ".rubocop.yml"
|
165
|
-
- ".travis.yml"
|
166
181
|
- Gemfile
|
167
182
|
- Gemfile.lock
|
168
183
|
- LICENSE
|
@@ -185,6 +200,8 @@ files:
|
|
185
200
|
- lib/mrkt/concerns/import_custom_objects.rb
|
186
201
|
- lib/mrkt/concerns/import_leads.rb
|
187
202
|
- lib/mrkt/errors.rb
|
203
|
+
- lib/mrkt/faraday.rb
|
204
|
+
- lib/mrkt/faraday/params_encoder.rb
|
188
205
|
- lib/mrkt/faraday_middleware.rb
|
189
206
|
- lib/mrkt/faraday_middleware/response.rb
|
190
207
|
- lib/mrkt/version.rb
|
@@ -202,6 +219,7 @@ files:
|
|
202
219
|
- spec/concerns/import_custom_objects_spec.rb
|
203
220
|
- spec/concerns/import_leads_spec.rb
|
204
221
|
- spec/errors_spec.rb
|
222
|
+
- spec/faraday/params_encoder_spec.rb
|
205
223
|
- spec/mkto_rest_spec.rb
|
206
224
|
- spec/spec_helper.rb
|
207
225
|
- spec/support/initialized_client.rb
|
@@ -216,7 +234,7 @@ require_paths:
|
|
216
234
|
- lib
|
217
235
|
required_ruby_version: !ruby/object:Gem::Requirement
|
218
236
|
requirements:
|
219
|
-
- - "
|
237
|
+
- - ">="
|
220
238
|
- !ruby/object:Gem::Version
|
221
239
|
version: '2.5'
|
222
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -225,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
243
|
- !ruby/object:Gem::Version
|
226
244
|
version: '0'
|
227
245
|
requirements: []
|
228
|
-
rubygems_version: 3.
|
246
|
+
rubygems_version: 3.1.4
|
229
247
|
signing_key:
|
230
248
|
specification_version: 4
|
231
249
|
summary: Marketo REST API Facade
|
@@ -243,6 +261,7 @@ test_files:
|
|
243
261
|
- spec/concerns/import_custom_objects_spec.rb
|
244
262
|
- spec/concerns/import_leads_spec.rb
|
245
263
|
- spec/errors_spec.rb
|
264
|
+
- spec/faraday/params_encoder_spec.rb
|
246
265
|
- spec/mkto_rest_spec.rb
|
247
266
|
- spec/spec_helper.rb
|
248
267
|
- spec/support/initialized_client.rb
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
env:
|
2
|
-
global:
|
3
|
-
- CC_TEST_REPORTER_ID=45cd2174f49b570406e294ff393d456c4ae8532cf16dd6430abb06d8a0722a28
|
4
|
-
- COVERAGE=on
|
5
|
-
language: ruby
|
6
|
-
rvm:
|
7
|
-
- 2.5
|
8
|
-
- 2.6
|
9
|
-
- 2.7
|
10
|
-
before_install:
|
11
|
-
- gem update --system
|
12
|
-
- bundle update --bundler
|
13
|
-
before_script:
|
14
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
15
|
-
- chmod +x ./cc-test-reporter
|
16
|
-
- ./cc-test-reporter before-build
|
17
|
-
script:
|
18
|
-
- bundle exec rspec
|
19
|
-
- bundle exec rubocop
|
20
|
-
after_script:
|
21
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|