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.
- data/easy_basecamp.gemspec +1 -1
- data/lib/basecamp/message.rb +37 -25
- data/lib/basecamp.rb +1 -1
- metadata +4 -4
data/easy_basecamp.gemspec
CHANGED
data/lib/basecamp/message.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Basecamp
|
2
2
|
|
3
|
-
|
4
|
-
|
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
|
-
|
32
|
-
|
33
|
-
|
31
|
+
# </post>
|
32
|
+
class Message < Base
|
33
|
+
self.element_name = "post"
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
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:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
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-
|
18
|
+
date: 2011-07-19 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|