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 +4 -4
- data/README.md +1 -1
- data/lib/insightly2/client.rb +6 -0
- data/lib/insightly2/version.rb +1 -1
- data/spec/insightly2/dsl/comments_spec.rb +1 -1
- data/spec/insightly2/resources/comment_spec.rb +1 -7
- data/spec/insightly2/resources/contact_spec.rb +0 -6
- data/spec/insightly2/resources/email_spec.rb +1 -7
- data/spec/insightly2/resources/event_spec.rb +1 -7
- data/spec/insightly2/resources/note_spec.rb +1 -7
- data/spec/insightly2/resources/opportunity_spec.rb +1 -7
- data/spec/insightly2/resources/organisation_spec.rb +1 -7
- data/spec/insightly2/resources/project_spec.rb +1 -7
- data/spec/insightly2/resources/task_spec.rb +1 -7
- data/spec/insightly2/resources/team_spec.rb +1 -7
- data/spec/insightly2/resources/user_spec.rb +0 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abd52718bf938cd57f32cb1862ee078e64349204
|
4
|
+
data.tar.gz: c023b942fc8b9718936b750271f99d1e065aef22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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"=>[{"
|
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",
|
data/lib/insightly2/client.rb
CHANGED
@@ -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
|
|
data/lib/insightly2/version.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2015-05-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|