logan 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94f20bf4fd6774f8a25c97f764bce6bf3c425bfd
4
- data.tar.gz: 46453bab5d5c1bd64b5e70e64e1d2af8fe99899f
3
+ metadata.gz: 8d7566cba52bb22782e58139cdb6dcf035506595
4
+ data.tar.gz: 86f12d31c018f429624e1e8b0eb727f4f01d6e13
5
5
  SHA512:
6
- metadata.gz: bd10e85b24b6579c95d1167fb2cd4ca7035b276c22a3760fa076f4a00c9024d2dc978f15ab9a84827a512582c5f9c1847e8c63d14ec93b10792d89635952dfa9
7
- data.tar.gz: 8f454928f0da9eb75915878b12e4c9f70ea95fc5df9fe3bacaa92ad8a6ed978082ded59c788e48b7896cae67964cbef15a7a27ba6741e4a55aa26441861e65d7
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.7
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-02-12 00:00:00.000000000 Z
11
+ date: 2014-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty