insightly2 0.1.7 → 0.1.8

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: 8f6cf26db5360cb3515dac2d20dbded4c0e0c974
4
- data.tar.gz: b35c0ccbfd8906b25b6b9b2c1b5678dcc6f1cc93
3
+ metadata.gz: abd52718bf938cd57f32cb1862ee078e64349204
4
+ data.tar.gz: c023b942fc8b9718936b750271f99d1e065aef22
5
5
  SHA512:
6
- metadata.gz: 6a517e7edb1a186ff77a67a933154cd49e4e358cd9b7c088698d395788bfbb34f9f136cbad394cc9d177426305558ef6b4f8e378112dfbd98c74c38988e0d472
7
- data.tar.gz: 1c9793abe1cdf6b0d62b2e6e1dd5e599712c5c8834373e005a9a22cf55e8c20d5f2fa54f44af81f53052dfa295cd0241cc0073f191ba5b2c9c7d6acd6754e7d6
6
+ metadata.gz: e74f7f5fb8e848bc03480ec05adf5b5dc93165f2cceb46b6a0a39ddf331064679a29468d5dfc4108917549b2aa2b78ce07e9615ca8f35fba51bbeac5cce72af8
7
+ data.tar.gz: 61e811465e6174c1bb648f7aafa23a634446f83373095b10ef93bad13f542b3ee6b0fccd323bcfbb2a09249718d9b802af44843e1d1c542d0e0f5d938408a93d
data/README.md CHANGED
@@ -46,7 +46,7 @@ contact_attributes = {
46
46
  "first_name"=>"Tyler",
47
47
  "last_name"=>"Durden",
48
48
  "image_url"=>"https://fakedomain.imgix.net/user_photos/man.jpg?crop=faces&fit=crop&h=96&w=96",
49
- "contactinfos"=>[{"contact_id"=>0, "type"=>"Email", "subtype"=>"", "label"=>"Work", "detail"=>"tylerdurden@ucsv.edu"}],
49
+ "contactinfos"=>[{"contact_info_id"=>0, "type"=>"Email", "subtype"=>"", "label"=>"Work", "detail"=>"tylerdurden@ucsv.edu"}],
50
50
  "links"=>[],
51
51
  "tags"=>[],
52
52
  "date_created_utc"=>"2014-10-11 23:20:04",
@@ -4,6 +4,7 @@ require 'openssl'
4
4
  require 'active_support/all'
5
5
  require 'insightly2/dsl'
6
6
  require 'insightly2/errors'
7
+ require 'logger'
7
8
 
8
9
  module Insightly2
9
10
  class Client
@@ -13,6 +14,7 @@ module Insightly2
13
14
  URL = 'https://api.insight.ly/v2.1/'
14
15
  REQUESTS = [:get, :post, :put, :delete]
15
16
  HEADERS = {'Accept' => 'application/json', 'Content-Type' => 'application/json'}
17
+ LOGGER = Logger.new(STDOUT)
16
18
 
17
19
  # @param [String] api_key
18
20
  def initialize(api_key = Insightly2.api_key)
@@ -38,6 +40,10 @@ module Insightly2
38
40
  def request(method, path, query = {}, headers = HEADERS)
39
41
  raise ArgumentError, "Unsupported method #{method.inspect}. Only :get, :post, :put, :delete are allowed" unless REQUESTS.include?(method)
40
42
 
43
+ payload_logger_message = query.empty? ? "with no payload" : "with payload: #{query.inspect}"
44
+ logger_info_message = "INSIGHTLY starting [#{method.to_s}] request to [#{path.to_s}] #{payload_logger_message}"
45
+ LOGGER.info(logger_info_message)
46
+
41
47
  payload = !query.empty? ? JSON.generate(query) : ''
42
48
  response = @connection.run_request(method, "#{URL}#{path}", payload, headers)
43
49
 
@@ -1,3 +1,3 @@
1
1
  module Insightly2
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
@@ -42,4 +42,4 @@ describe Insightly2::DSL::Comments do
42
42
  end
43
43
  end
44
44
  end
45
- end
45
+ end
@@ -17,11 +17,5 @@ describe Insightly2::Resources::Comment do
17
17
  expect(subject).to respond_to(method)
18
18
  end
19
19
  end
20
-
21
- %w(date_created_utc date_updated_utc).each do |method|
22
- it "deserialize attribute #{method} as time" do
23
- expect(subject.public_send(method)).to be_a(Time)
24
- end
25
- end
26
20
  end
27
- end
21
+ end
@@ -18,11 +18,5 @@ describe Insightly2::Resources::Contact do
18
18
  expect(subject).to respond_to(method)
19
19
  end
20
20
  end
21
-
22
- %w(date_created_utc date_updated_utc).each do |method|
23
- it "deserialize attribute #{method} as time" do
24
- expect(subject.public_send(method)).to be_a(Time)
25
- end
26
- end
27
21
  end
28
22
  end
@@ -19,11 +19,5 @@ describe Insightly2::Resources::Email do
19
19
  expect(subject).to respond_to(method)
20
20
  end
21
21
  end
22
-
23
- %w(date_created_utc).each do |method|
24
- it "deserialize attribute #{method} as time" do
25
- expect(subject.public_send(method)).to be_a(Time)
26
- end
27
- end
28
22
  end
29
- end
23
+ end
@@ -19,11 +19,5 @@ describe Insightly2::Resources::Event do
19
19
  expect(subject).to respond_to(method)
20
20
  end
21
21
  end
22
-
23
- %w(date_created_utc date_updated_utc).each do |method|
24
- it "deserialize attribute #{method} as time" do
25
- expect(subject.public_send(method)).to be_a(Time)
26
- end
27
- end
28
22
  end
29
- end
23
+ end
@@ -19,11 +19,5 @@ describe Insightly2::Resources::Note do
19
19
  expect(subject).to respond_to(method)
20
20
  end
21
21
  end
22
-
23
- %w(date_created_utc date_updated_utc).each do |method|
24
- it "deserialize attribute #{method} as time" do
25
- expect(subject.public_send(method)).to be_a(Time)
26
- end
27
- end
28
22
  end
29
- end
23
+ end
@@ -20,11 +20,5 @@ describe Insightly2::Resources::Opportunity do
20
20
  expect(subject).to respond_to(method)
21
21
  end
22
22
  end
23
-
24
- %w(date_created_utc date_updated_utc).each do |method|
25
- it "deserialize attribute #{method} as time" do
26
- expect(subject.public_send(method)).to be_a(Time)
27
- end
28
- end
29
23
  end
30
- end
24
+ end
@@ -19,11 +19,5 @@ describe Insightly2::Resources::Organisation do
19
19
  expect(subject).to respond_to(method)
20
20
  end
21
21
  end
22
-
23
- %w(date_created_utc date_updated_utc).each do |method|
24
- it "deserialize attribute #{method} as time" do
25
- expect(subject.public_send(method)).to be_a(Time)
26
- end
27
- end
28
22
  end
29
- end
23
+ end
@@ -20,11 +20,5 @@ describe Insightly2::Resources::Project do
20
20
  expect(subject).to respond_to(method)
21
21
  end
22
22
  end
23
-
24
- %w(date_created_utc date_updated_utc).each do |method|
25
- it "deserialize attribute #{method} as time" do
26
- expect(subject.public_send(method)).to be_a(Time)
27
- end
28
- end
29
23
  end
30
- end
24
+ end
@@ -22,11 +22,5 @@ describe Insightly2::Resources::Task do
22
22
  expect(subject).to respond_to(method)
23
23
  end
24
24
  end
25
-
26
- %w(date_created_utc date_updated_utc).each do |method|
27
- it "deserialize attribute #{method} as time" do
28
- expect(subject.public_send(method)).to be_a(Time)
29
- end
30
- end
31
25
  end
32
- end
26
+ end
@@ -17,11 +17,5 @@ describe Insightly2::Resources::Team do
17
17
  expect(subject).to respond_to(method)
18
18
  end
19
19
  end
20
-
21
- %w(date_created_utc date_updated_utc).each do |method|
22
- it "deserialize attribute #{method} as time" do
23
- expect(subject.public_send(method)).to be_a(Time)
24
- end
25
- end
26
20
  end
27
- end
21
+ end
@@ -19,11 +19,5 @@ describe Insightly2::Resources::User do
19
19
  expect(subject).to respond_to(method)
20
20
  end
21
21
  end
22
-
23
- %w(date_created_utc date_updated_utc).each do |method|
24
- it "deserialize attribute #{method} as time" do
25
- expect(subject.public_send(method)).to be_a(Time)
26
- end
27
- end
28
22
  end
29
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insightly2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Semyonov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-06 00:00:00.000000000 Z
13
+ date: 2015-05-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday