basecamp 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/basecamp/base.rb +3 -1
- data/lib/basecamp/connection.rb +0 -2
- data/lib/basecamp/resources/todo_list.rb +8 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07a54eaf4546d6363daad9e7e112de7612e4467f
|
4
|
+
data.tar.gz: f00238d6557cdff8b93f83522cc8d638979cd571
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5b6cd00dc0934b88240bddd9a74bef8e7b135cafbb50a699f41c2f63a2103682d88715e9fe8133045b1439b233cc72648954a6dc990cd7f6455d70817065741
|
7
|
+
data.tar.gz: db95a9ff350475ab79b74cc62aa04be2171c5e472fc7fc34a4734c153e897c6a19207f3f0c520c1f5d8cee5e09498bf94ad6fafa58efa8961758c5150114a0b5
|
data/lib/basecamp/base.rb
CHANGED
@@ -42,6 +42,8 @@ module Basecamp
|
|
42
42
|
def request(path, parameters = {})
|
43
43
|
headers = { "Content-Type" => content_type }
|
44
44
|
headers.merge!('Authorization' => "Bearer #{@access_token}") if @use_oauth
|
45
|
+
headers.merge!(Resource.headers) if Resource.headers.present?
|
46
|
+
|
45
47
|
if parameters.empty?
|
46
48
|
response = Basecamp.connection.get(path, headers)
|
47
49
|
else
|
@@ -137,4 +139,4 @@ module Basecamp
|
|
137
139
|
gsub(/&/, "&")
|
138
140
|
end
|
139
141
|
end
|
140
|
-
end
|
142
|
+
end
|
data/lib/basecamp/connection.rb
CHANGED
@@ -9,7 +9,6 @@ module Basecamp; class Connection
|
|
9
9
|
def post(path, iostream, headers = {})
|
10
10
|
request = Net::HTTP::Post.new(path, headers.merge('Accept' => 'application/xml'))
|
11
11
|
request.basic_auth(@master.user, @master.password) unless @master.use_oauth
|
12
|
-
request.initialize_http_header(@master.class.headers)
|
13
12
|
request.body_stream = iostream
|
14
13
|
request.content_length = iostream.size
|
15
14
|
@connection.request(request)
|
@@ -17,7 +16,6 @@ module Basecamp; class Connection
|
|
17
16
|
|
18
17
|
def get(path, headers = {})
|
19
18
|
request = Net::HTTP::Get.new(path, headers.merge('Accept' => 'application/xml'))
|
20
|
-
request.initialize_http_header(@master.class.headers)
|
21
19
|
request.basic_auth(@master.user, @master.password) unless @master.use_oauth
|
22
20
|
@connection.request(request)
|
23
21
|
end
|
@@ -1,6 +1,4 @@
|
|
1
1
|
module Basecamp; class TodoList < Basecamp::Resource
|
2
|
-
parent_resources :project
|
3
|
-
|
4
2
|
# Returns all lists for a project. If complete is true, only completed lists
|
5
3
|
# are returned. If complete is false, only uncompleted lists are returned.
|
6
4
|
def self.all(project_id, complete = nil)
|
@@ -14,7 +12,15 @@ module Basecamp; class TodoList < Basecamp::Resource
|
|
14
12
|
find(:all, :params => { :project_id => project_id, :filter => filter })
|
15
13
|
end
|
16
14
|
|
15
|
+
def project
|
16
|
+
@project ||= Project.find(project_id)
|
17
|
+
end
|
18
|
+
|
17
19
|
def todo_items(options = {})
|
18
20
|
@todo_items ||= TodoItem.find(:all, :params => options.merge(:todo_list_id => id))
|
19
21
|
end
|
22
|
+
|
23
|
+
def prefix_options
|
24
|
+
{ :project_id => project_id }
|
25
|
+
end
|
20
26
|
end; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: basecamp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anibal Cucco
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.2.2
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: Basecamp API wrapper.
|