easy_basecamp 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -0,0 +1 @@
1
+ In development
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "easy_basecamp"
3
- s.version = "0.0.6"
3
+ s.version = "0.0.7"
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"
data/lib/basecamp.rb CHANGED
@@ -2,30 +2,23 @@ require "rubygems"
2
2
  require "active_resource"
3
3
 
4
4
  module Basecamp
5
+
5
6
  class Base < ActiveResource::Base
6
- def self.establish_connection!(ssl, subdomain, user, password = 'X')
7
- self.use_ssl = ssl
8
- self.site = [ssl ? "https://" : "http://", subdomain, ".basecamphq.com"].join
9
- self.user = user
7
+
8
+ def self.establish_connection!(ssl, subdomain, user, password = 'X')
9
+ site = ssl ? "https://" : "http://"
10
+ self.site = [site, subdomain, ".basecamphq.com/"].join
11
+ self.user = user
10
12
  self.password = password
11
- self
12
- end
13
-
14
- def self.use_ssl?
15
- @use_ssl
16
- end
17
-
18
- def self.use_ssl=(ssl)
19
- @use_ssl = ssl
13
+ self
20
14
  end
21
-
22
15
  end
16
+
23
17
  end
24
18
 
25
19
  require "basecamp/category.rb"
26
20
  require "basecamp/company.rb"
27
21
  require "basecamp/comment.rb"
28
- require "basecamp/connection"
29
22
  require "basecamp/file.rb"
30
23
  require "basecamp/message.rb"
31
24
  require "basecamp/milestone.rb"
@@ -34,6 +27,3 @@ require "basecamp/project.rb"
34
27
  require "basecamp/time_tracker.rb"
35
28
  require "basecamp/todo_list.rb"
36
29
  require "basecamp/todo_list_item.rb"
37
-
38
- Basecamp::Base.establish_connection!(true, "ciblonet", "gregorym", "gregochou")
39
- print Basecamp::Message.in_project(7119860)
@@ -19,5 +19,10 @@ module Basecamp
19
19
  # </attachments>
20
20
  # </comment>
21
21
  class Comment < Base
22
+
23
+ def self.recent(resource_name, resource_id)
24
+ find(:all, :from => "/#{resource_name}/#{resource_id}/comments.xml")
25
+ end
26
+
22
27
  end
23
28
  end
data/lib/basecamp/file.rb CHANGED
@@ -1,21 +1,5 @@
1
1
  module Basecamp
2
- class Attachment
3
- attr_accessor :id, :filename, :content, :content_type
4
-
5
- def initialize(filename, content, content_type = 'application/octet-stream')
6
- @filename, @content, @content_type = filename, content, content_type
7
- end
8
-
9
- def save
10
- response = Basecamp::Connection.new.post('upload', content, {'Content-Type' => content_type})
11
-
12
- if response.code == '200'
13
- self.id = Hash.from_xml(response.body)['upload']['id']
14
- true
15
- else
16
- raise "Could not save attachment: #{response.message} (#{response.code})"
17
- end
18
- end
19
-
2
+ class Attachment < Base
3
+
20
4
  end
21
- end
5
+ end
@@ -30,7 +30,7 @@ module Basecamp
30
30
  # <private type="boolean">#{private}</private>
31
31
  # </post>
32
32
  class Message < Base
33
- #self.element_name = "post"
33
+ self.element_name = "post"
34
34
 
35
35
  # Get all messages from a project
36
36
  def self.in_project(project_id)
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
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-25 00:00:00 +02:00
18
+ date: 2011-06-26 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements: []
88
88
 
89
89
  rubyforge_project:
90
- rubygems_version: 1.4.1
90
+ rubygems_version: 1.6.2
91
91
  signing_key:
92
92
  specification_version: 3
93
93
  summary: Ruby wrapper of the Basecamp API