leadcli 0.0.3 → 0.0.4

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: 44b485ed30fd5d722aadf779a7ddce956a7592ad
4
- data.tar.gz: 14fa115187f897aad9c3f7f3f45fc49b81df8558
3
+ metadata.gz: bf2ab2d5fdb3f54a619d1a4d9bd5879b4d239059
4
+ data.tar.gz: db9b27a4fbe3908e2b0aa1a39a1c3d7d90bfdc64
5
5
  SHA512:
6
- metadata.gz: 94c93ae8b73f6144858541d663f277984e70a88921f44b73eb4635d3b92d0aaeadb374aa7de78a3b0ec10e761b10284b3439db6edc27327959dce4d9ba26f187
7
- data.tar.gz: 8c0b866aa045f949105ac16a242f2d91b6c5215e49b4cc9cae2e47b3b1ea15c10e27da0705b4b932383021f3bea3b206a451dc2b090c273bfc3fb7d525465e7b
6
+ metadata.gz: 71f97680c76f397e0112aff0131d988f196f82f9947a6922934fe6c95c5d49b65c59c5b46c6d1025b475c2ec8d76fd14474feae1d287040ccea2d6270c5aefa0
7
+ data.tar.gz: e06f39a1833fe2435b918fc264c5fa9a8d8ed0bd6dab2d7c968d09ae70069f0712964d8191357f0fc4cf51d568e6214f2b38eb78f1663feb6ed213f4fef510e9
@@ -0,0 +1 @@
1
+ pkg
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- leadcli (0.0.2)
4
+ leadcli (0.0.4)
5
5
  rest-client
6
6
 
7
7
  GEM
@@ -13,7 +13,7 @@ GEM
13
13
  fakeweb (1.3.0)
14
14
  http-cookie (1.0.2)
15
15
  domain_name (~> 0.5)
16
- mime-types (2.6.1)
16
+ mime-types (2.6.2)
17
17
  netrc (0.10.3)
18
18
  rest-client (1.8.0)
19
19
  http-cookie (>= 1.0.2, < 2.0)
@@ -53,9 +53,9 @@ module Leadcli
53
53
  :accept => :json
54
54
  }
55
55
  parameters = {
56
- url: url,
57
- method: method,
58
- headers: headers
56
+ :url => url,
57
+ :method => method,
58
+ :headers => headers
59
59
  }
60
60
  parameters[:payload] = options[:payload] if method == :post or method == :put
61
61
  RestClient::Request.execute(parameters)
@@ -15,7 +15,7 @@ module Leadcli
15
15
 
16
16
  def defaults
17
17
  defaults = {
18
- host: 'new.eureo-tools.com'
18
+ :host => 'new.eureo-tools.com'
19
19
  }
20
20
  #defaults[:logger] = Logger.new(STDOUT)
21
21
  end
@@ -11,11 +11,11 @@ module Leadcli
11
11
  end
12
12
 
13
13
  def create(params)
14
- api_call :create, url_options: {}, payload: { lead: params }, failure: :handle_failure, success: :handle_success
14
+ api_call :create, :url_options => {}, :payload => { :lead => params }, :failure => :handle_failure, :success => :handle_success
15
15
  end
16
16
 
17
17
  def delete(lead_id)
18
- api_call :delete, url_options: { id: lead_id }, failure: :handle_failure, success: :handle_success
18
+ api_call :delete, :url_options => { :id => lead_id }, :failure => :handle_failure, :success => :handle_success
19
19
  end
20
20
 
21
21
  def handle_failure(response)
@@ -6,7 +6,7 @@ module Leadcli
6
6
  end
7
7
 
8
8
  def create_url(options={})
9
- url = http_scheme.build(base_options.merge(path: create_path))
9
+ url = http_scheme.build(base_options.merge(:path => create_path))
10
10
  url.query = options[:query].map { |k,v| "#{k}=#{v}" }.join('&') if options[:query]
11
11
  url.to_s
12
12
  end
@@ -16,7 +16,7 @@ module Leadcli
16
16
  end
17
17
 
18
18
  def delete_url(options)
19
- url = http_scheme.build(base_options.merge(path: delete_path(options[:id])))
19
+ url = http_scheme.build(base_options.merge(:path => delete_path(options[:id])))
20
20
  url.to_s
21
21
  end
22
22
 
@@ -1,4 +1,4 @@
1
1
  module Leadcli
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
4
4
 
@@ -10,8 +10,8 @@ describe Leadcli::ApiCall do
10
10
  api_call_test = ApiCallerTest.new
11
11
  api_call = double('api_call')
12
12
  expect(api_call).to receive(:call).with(api_call_test)
13
- expect(Leadcli::ApiCaller).to receive(:new).with(:endpoint, { foo: :bar }).and_return(api_call)
14
- api_call_test.api_call(:endpoint, { foo: :bar })
13
+ expect(Leadcli::ApiCaller).to receive(:new).with(:endpoint, { :foo => :bar }).and_return(api_call)
14
+ api_call_test.api_call(:endpoint, { :foo => :bar })
15
15
  end
16
16
 
17
17
  end
@@ -5,9 +5,9 @@ describe Leadcli::ApiCaller do
5
5
 
6
6
  describe "#new" do
7
7
  it "stores the endpoint and options" do
8
- api_caller = Leadcli::ApiCaller.new(:myendpoint, foo: :bar)
8
+ api_caller = Leadcli::ApiCaller.new(:myendpoint, :foo => :bar)
9
9
  expect(api_caller.endpoint).to eq(:myendpoint)
10
- expect(api_caller.options).to eq({ foo: :bar })
10
+ expect(api_caller.options).to eq({ :foo => :bar })
11
11
  end
12
12
  end
13
13
 
@@ -19,15 +19,15 @@ describe Leadcli::ApiCaller do
19
19
  api_caller.call(self)
20
20
  end
21
21
  it "passes through any url options" do
22
- expect(api_caller).to receive(:test_endpoint).with({ query: { updated_at: '2013-07-19', foo: :bar }}).and_return([:get, url])
23
- api_caller.options[:url_options] = { query: { updated_at: '2013-07-19', foo: :bar } }
22
+ expect(api_caller).to receive(:test_endpoint).with({ :query => { :updated_at => '2013-07-19', :foo => :bar }}).and_return([:get, url])
23
+ api_caller.options[:url_options] = { :query => { :updated_at => '2013-07-19', :foo => :bar } }
24
24
  expect(RestClient::Request).to receive(:execute).and_return(double('response', :code => 200))
25
25
  api_caller.call(self)
26
26
  end
27
27
  describe "a GET request" do
28
28
  it "make the call to the api" do
29
29
  expect(api_caller).to receive(:test_endpoint).and_return([:get, url])
30
- expect(RestClient::Request).to receive(:execute).with(hash_including(url: url, method: :get)).and_return(double('response', :code => 200))
30
+ expect(RestClient::Request).to receive(:execute).with(hash_including(url: url, :method => :get)).and_return(double('response', :code => 200))
31
31
  api_caller.call(self)
32
32
  end
33
33
  end
@@ -7,7 +7,7 @@ describe Leadcli::Lead do
7
7
 
8
8
  describe "#create" do
9
9
  it "creates it" do
10
- with_configuration(host: HOST, port: 3000, token: TOKEN) do
10
+ with_configuration(:host => HOST, :port => 3000, :token => TOKEN) do
11
11
  lead.create(params)
12
12
  expect(lead.last_response).to match(/Contact/)
13
13
  end
@@ -21,7 +21,7 @@ describe Leadcli::Lead do
21
21
  describe "#delete" do
22
22
  context "when remote lead exists" do
23
23
  it "delete it" do
24
- with_configuration(host: HOST, port: 3000, token: TOKEN) do
24
+ with_configuration(:host => HOST, :port => 3000, :token => TOKEN) do
25
25
  lead.create(params)
26
26
  created_lead_id = JSON.parse(lead.last_response)['id']
27
27
  lead.delete(created_lead_id)
@@ -6,11 +6,11 @@ end
6
6
 
7
7
  describe Leadcli::Routes do
8
8
  let!(:test_route) { TestRoute.new }
9
- let(:config) { { host: 'test.host', port: 1234 } }
9
+ let(:config) { { :host => 'test.host', :port => 1234 } }
10
10
 
11
11
  describe "create_endpoint" do
12
12
  it "returns :post and the create url" do
13
- options = { foo: :bar }
13
+ options = { :foo => :bar }
14
14
  expect(test_route).to receive(:create_url).with(options).and_return('my_create_url')
15
15
  expect(test_route.create_endpoint(options)).to eq([:post, 'my_create_url'])
16
16
  end
@@ -24,7 +24,7 @@ describe Leadcli::Routes do
24
24
  end
25
25
  it "adds query parameters on to the url" do
26
26
  with_configuration(config) do
27
- url = test_route.create_url(query: { updated_at: '2013-07-19', foo: :bar })
27
+ url = test_route.create_url(:query => { :updated_at => '2013-07-19', :foo => :bar })
28
28
  expect(url).to match(/\?.*updated_at=2013-07-19/)
29
29
  expect(url).to match(/\?.*foo=bar/)
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leadcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franck D'agostini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-29 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".gitignore"
62
63
  - Gemfile
63
64
  - Gemfile.lock
64
65
  - LICENSE.txt