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 +1 -0
- data/easy_basecamp.gemspec +1 -1
- data/lib/basecamp.rb +8 -18
- data/lib/basecamp/comment.rb +5 -0
- data/lib/basecamp/file.rb +3 -19
- data/lib/basecamp/message.rb +1 -1
- metadata +5 -5
data/README.textile
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
In development
|
data/easy_basecamp.gemspec
CHANGED
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
self.
|
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
|
-
|
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)
|
data/lib/basecamp/comment.rb
CHANGED
data/lib/basecamp/file.rb
CHANGED
@@ -1,21 +1,5 @@
|
|
1
1
|
module Basecamp
|
2
|
-
class Attachment
|
3
|
-
|
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
|
data/lib/basecamp/message.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: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
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-
|
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.
|
90
|
+
rubygems_version: 1.6.2
|
91
91
|
signing_key:
|
92
92
|
specification_version: 3
|
93
93
|
summary: Ruby wrapper of the Basecamp API
|