logan 0.0.7 → 0.0.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/lib/logan/client.rb +5 -0
- data/lib/logan/person.rb +7 -0
- data/lib/logan/project.rb +23 -0
- data/lib/logan/todo.rb +3 -3
- 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: 8d7566cba52bb22782e58139cdb6dcf035506595
|
4
|
+
data.tar.gz: 86f12d31c018f429624e1e8b0eb727f4f01d6e13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7ecb738f11387f06a88f57f6726a4100f4977db0042604f52b5e843f558e394eb6eecd1d2979f1dbbd1f34a5229f99ae4c75b5b64d99f0557ee3b4111f0de09
|
7
|
+
data.tar.gz: f479f22b6c9d9b0ef6870a4d0c1ea796230315c5588f289b0825fef45690a223753fe6faa8f4bd4641cd5ffdb2cbb51b7345a98fd9e8d8babdf15a0b3a6901ac
|
data/lib/logan/client.rb
CHANGED
@@ -72,5 +72,10 @@ module Logan
|
|
72
72
|
response = self.class.get "/events.json?since=#{since_time.to_s}&page=#{page}"
|
73
73
|
response.map { |h| e = Logan::Event.new(h) }
|
74
74
|
end
|
75
|
+
|
76
|
+
def people
|
77
|
+
response = self.class.get "/people.json"
|
78
|
+
response.parsed_response.map { |h| p = Logan::Person.new(h)}
|
79
|
+
end
|
75
80
|
end
|
76
81
|
end
|
data/lib/logan/person.rb
CHANGED
@@ -5,7 +5,14 @@ module Logan
|
|
5
5
|
include HashConstructed
|
6
6
|
|
7
7
|
attr_accessor :id
|
8
|
+
attr_accessor :identity_id
|
8
9
|
attr_accessor :name
|
10
|
+
attr_accessor :email_address
|
11
|
+
attr_accessor :admin
|
12
|
+
attr_accessor :avatar_url
|
13
|
+
attr_accessor :created_at
|
14
|
+
attr_accessor :updated_at
|
15
|
+
attr_accessor :url
|
9
16
|
|
10
17
|
def to_hash
|
11
18
|
{ :id => @id, :type => "Person" }
|
data/lib/logan/project.rb
CHANGED
@@ -57,5 +57,28 @@ module Logan
|
|
57
57
|
response = Logan::Client.post "/projects/#{@id}/todolists.json", post_params
|
58
58
|
Logan::TodoList.new response.merge({ :project_id => @id })
|
59
59
|
end
|
60
|
+
|
61
|
+
def accesses
|
62
|
+
response = Logan::Client.get "/projects/#{@id}/accesses.json"
|
63
|
+
response.parsed_response.map { |h| p = Logan::Person.new(h) }
|
64
|
+
end
|
65
|
+
|
66
|
+
def add_user_by_id(id)
|
67
|
+
post_params = {
|
68
|
+
:body => { ids: [id] }.to_json,
|
69
|
+
:headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})
|
70
|
+
}
|
71
|
+
|
72
|
+
response = Logan::Client.post "/projects/#{@id}/accesses.json", post_params
|
73
|
+
end
|
74
|
+
|
75
|
+
def add_user_by_email(email)
|
76
|
+
post_params = {
|
77
|
+
:body => { email_addresses: [email] }.to_json,
|
78
|
+
:headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})
|
79
|
+
}
|
80
|
+
|
81
|
+
response = Logan::Client.post "/projects/#{@id}/accesses.json", post_params
|
82
|
+
end
|
60
83
|
end
|
61
84
|
end
|
data/lib/logan/todo.rb
CHANGED
@@ -18,7 +18,7 @@ module Logan
|
|
18
18
|
{
|
19
19
|
:content => @content,
|
20
20
|
:due_at => @due_at,
|
21
|
-
:assignee => @assignee.to_hash
|
21
|
+
:assignee => @assignee.blank? ? nil : @assignee.to_hash
|
22
22
|
}.to_json
|
23
23
|
end
|
24
24
|
|
@@ -26,7 +26,7 @@ module Logan
|
|
26
26
|
{
|
27
27
|
:content => @content,
|
28
28
|
:due_at => @due_at,
|
29
|
-
:assignee => @assignee.to_hash,
|
29
|
+
:assignee => @assignee.blank? ? nil : @assignee.to_hash,
|
30
30
|
:completed => @completed
|
31
31
|
}.to_json
|
32
32
|
end
|
@@ -61,4 +61,4 @@ module Logan
|
|
61
61
|
@assignee = assignee.is_a?(Hash) ? Logan::Person.new(assignee) : assignee
|
62
62
|
end
|
63
63
|
end
|
64
|
-
end
|
64
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Birarda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|