pipekit-webmock 0.4.2 → 0.4.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
  SHA1:
3
- metadata.gz: 525334171023cd7079e7b7cb7bcd94afb72a311d
4
- data.tar.gz: 44317da7ce1bb2ad8b3a73491883eccc6992661d
3
+ metadata.gz: 436a2d2adb18aa665e86012e1eead1fe117d4d22
4
+ data.tar.gz: db8d6889a64c89de7f8b1ab5b16cc141a4b4e99b
5
5
  SHA512:
6
- metadata.gz: 1b0d2248c5fb08776c358ed75236847e0266f2839d96770d53efb2130e63a1ca86a5065f2b400de424b9b766f2077753ef3d7646159a4963b8f1333682184d01
7
- data.tar.gz: '00208ce21bf956d6c9a29ca11a91e432f38290a1078f4b6ad36fde35e944160bd26ed947c98067961fddf120c6f23125a5522dc661e675b4a586ef456fb3d927'
6
+ metadata.gz: 033bfbff669fe3efb4f9791780cdc6518fa837590d3c2e56feabe58d24c095b7e8909f2da50b627d08ee6504ffa11c6dd07cb4ffe753720b88268f3379ff1d28
7
+ data.tar.gz: 37ae4929081f52e36e76a1f707492d04a6dedb2ae02603ca64c010c7aad3a7927e510d772e488a2335d165d4030cd3d429b9c25a824f48f7114e8eb459a465e2
@@ -17,6 +17,7 @@
17
17
  # end
18
18
  require "webmock"
19
19
  require "pipekit/webmock/errors"
20
+ require "pipekit/webmock/resource_name"
20
21
 
21
22
  module Pipekit
22
23
  module WebMock
@@ -38,7 +39,8 @@ module Pipekit
38
39
  include ::WebMock::API
39
40
 
40
41
  def initialize(resource)
41
- @request = Pipekit::Request.new(resource)
42
+ resource_name = ResourceName.new(resource)
43
+ @request = Pipekit::Request.new(resource_name)
42
44
  end
43
45
 
44
46
  def stub_request_and_response(action, params, response)
@@ -0,0 +1,18 @@
1
+ class ResourceName
2
+
3
+ RESOURCES = {
4
+ person: { singular: "person", pluralized: "persons" },
5
+ deal: { singular: "deal", pluralized: "deals" },
6
+ note: { singular: "note", pluralized: "notes" },
7
+ activity: { singular: "activity", pluralized: "activities" },
8
+ personField: { singular: "personField", pluralized: "personFields"}
9
+ }
10
+
11
+ attr_reader :singular, :pluralized
12
+
13
+ def initialize(resource)
14
+ resource = resource.to_sym
15
+ @singular = RESOURCES[resource][:singular]
16
+ @pluralized = RESOURCES[resource][:pluralized]
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module Pipekit
2
2
  module WebMock
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipekit-webmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jafrog
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-11-14 00:00:00.000000000 Z
12
+ date: 2017-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: webmock
@@ -131,6 +131,7 @@ files:
131
131
  - lib/pipekit/webmock/api.rb
132
132
  - lib/pipekit/webmock/errors.rb
133
133
  - lib/pipekit/webmock/request_signature_snippet.rb
134
+ - lib/pipekit/webmock/resource_name.rb
134
135
  - lib/pipekit/webmock/version.rb
135
136
  - pipekit-webmock.gemspec
136
137
  homepage: https://github.com/makersacademy/pipekit-webmock