easy_basecamp 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "easy_basecamp"
3
- s.version = "0.0.7"
3
+ s.version = "0.0.8"
4
4
  s.email = "g.marcilhacy@gmail.com"
5
5
  s.homepage = "https://github.com/gregorym/easy-basecamp"
6
6
  s.summary = "Ruby wrapper of the Basecamp API"
@@ -1,7 +1,7 @@
1
1
  module Basecamp
2
2
 
3
- # Model format
4
- # <post>
3
+ # Model format
4
+ # <post>
5
5
  # <id type="integer">#{id}</id>
6
6
  # <title>#{title}</title>
7
7
  # <body>#{body}</body>
@@ -17,7 +17,7 @@ module Basecamp
17
17
  # <use-textile type="boolean">#{use_textile}</use-textile>
18
18
  # <extended-body deprecated="true">#{extended_body}</extended-body>
19
19
  # <display-extended-body deprecated="true">#{display_extended_body}</display-extended-body>
20
- #
20
+ #
21
21
  # <attachments-count type="integer">#{attachments_count}</attachments-count>
22
22
  # <attachments type="array">
23
23
  # <attachment>
@@ -25,32 +25,44 @@ module Basecamp
25
25
  # </attachment>
26
26
  # ...
27
27
  # </attachments>
28
- #
28
+ #
29
29
  # <!-- if user can see private posts -->
30
30
  # <private type="boolean">#{private}</private>
31
- # </post>
32
- class Message < Base
33
- self.element_name = "post"
31
+ # </post>
32
+ class Message < Base
33
+ self.element_name = "post"
34
34
 
35
- # Get all messages from a project
36
- def self.in_project(project_id)
37
- find(:all, :from => "/projects/#{project_id}/posts.xml")
38
- end
35
+ class << self
36
+ # Get all messages from a project
37
+ def in_project(project_id)
38
+ find(:all, :from => "/projects/#{project_id}/posts.xml")
39
+ end
39
40
 
40
- # Get all messages a project and a specific category
41
- def self.in_project_by_category(project_id, category_id)
42
- find(:all, :from => "/projects/#{project_id}/cat/#{category_id}/posts.xml")
43
- end
41
+ # Get all messages a project and a specific category
42
+ def in_project_by_category(project_id, category_id)
43
+ find(:all, :from => "/projects/#{project_id}/cat/#{category_id}/posts.xml")
44
+ end
44
45
 
45
- # Get archived messages from a project
46
- def self.archived(project_id)
47
- find(:all, :from => "/projects/#{project_id}/posts/archive.xml")
48
- end
46
+ # Get archived messages from a project
47
+ def archived(project_id)
48
+ find(:all, :from => "/projects/#{project_id}/posts/archive.xml")
49
+ end
49
50
 
50
- # Get archived messages a project and a specific category
51
- def self.in_project_by_category(project_id, category_id)
52
- find(:all, :from => "/projects/#{project_id}/cat/#{category_id}/posts/archived.xml")
53
- end
54
-
55
- end
51
+ # Get archived messages a project and a specific category
52
+ def in_project_by_category(project_id, category_id)
53
+ find(:all, :from => "/projects/#{project_id}/cat/#{category_id}/posts/archived.xml")
54
+ end
55
+ end
56
+
57
+ def encode(options={})
58
+ if known_attributes.include?('notify')
59
+ encoded = send("to_#{self.class.format.extension}", options)
60
+ notifies = notify.inject("") { |acc, n| acc += %(<notify type="integer">#{n}</notify>\n) }
61
+ "<request>" + encoded + notifies + "</request>"
62
+ else
63
+ super
64
+ end
65
+ end
66
+
67
+ end
56
68
  end
data/lib/basecamp.rb CHANGED
@@ -26,4 +26,4 @@ require "basecamp/person.rb"
26
26
  require "basecamp/project.rb"
27
27
  require "basecamp/time_tracker.rb"
28
28
  require "basecamp/todo_list.rb"
29
- require "basecamp/todo_list_item.rb"
29
+ require "basecamp/todo_list_item.rb"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_basecamp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Gr\xC3\xA9gory Marcilhacy"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-26 00:00:00 +02:00
18
+ date: 2011-07-19 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency