blimp 0.0.1 → 0.0.2
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.
- data/blimp.gemspec +1 -1
- data/lib/blimp/comment.rb +1 -1
- data/lib/blimp/company.rb +1 -1
- data/lib/blimp/file.rb +1 -1
- data/lib/blimp/goal.rb +1 -1
- data/lib/blimp/project.rb +1 -1
- data/lib/blimp/resource.rb +5 -3
- data/lib/blimp/task.rb +1 -2
- data/lib/blimp/version.rb +1 -1
- metadata +2 -1
data/blimp.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'blimp/version'
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "blimp"
|
8
8
|
gem.version = Blimp::VERSION
|
9
|
-
gem.authors = ["Blake Williams"]
|
9
|
+
gem.authors = ["Blake Williams", "Sixteen Eighty"]
|
10
10
|
gem.email = ["blake@blakewilliams.me"]
|
11
11
|
gem.description = %q{Ruby gem that implements the Blimp Public API http://dev.getblimp.com/}
|
12
12
|
gem.summary = %q{Ruby bindings to the Blimp API}
|
data/lib/blimp/comment.rb
CHANGED
data/lib/blimp/company.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Blimp
|
2
2
|
class Company < Resource
|
3
3
|
ATTRIBUTES = %w[name used_projects company_users image_url used_storage]
|
4
|
-
READ_ONLY = %w[id slug
|
4
|
+
READ_ONLY = %w[id slug date_due]
|
5
5
|
|
6
6
|
define_attribute_methods ATTRIBUTES, READ_ONLY
|
7
7
|
end
|
data/lib/blimp/file.rb
CHANGED
data/lib/blimp/goal.rb
CHANGED
@@ -2,7 +2,7 @@ module Blimp
|
|
2
2
|
class Goal < Resource
|
3
3
|
ATTRIBUTES = %w[position date_rejected date_done user_rejected
|
4
4
|
title project state assigned_to]
|
5
|
-
READ_ONLY = %w[id
|
5
|
+
READ_ONLY = %w[id created_by]
|
6
6
|
|
7
7
|
define_attribute_methods ATTRIBUTES, READ_ONLY
|
8
8
|
end
|
data/lib/blimp/project.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Blimp
|
2
2
|
class Project < Resource
|
3
3
|
ATTRIBUTES = %w[name state team date_due company]
|
4
|
-
READ_ONLY = %w[
|
4
|
+
READ_ONLY = %w[slug date_finished date_due stats]
|
5
5
|
|
6
6
|
define_attribute_methods ATTRIBUTES, READ_ONLY
|
7
7
|
end
|
data/lib/blimp/resource.rb
CHANGED
@@ -48,6 +48,8 @@ module Blimp
|
|
48
48
|
|
49
49
|
|
50
50
|
def define_attribute_methods(attributes, read_only_attributes)
|
51
|
+
common_attributes = %w[id date_created date_modified resource_uri]
|
52
|
+
read_only_attributes = read_only_attributes | common_attributes
|
51
53
|
@attributes = attributes | read_only_attributes
|
52
54
|
|
53
55
|
@attributes.each do |name|
|
@@ -59,7 +61,6 @@ module Blimp
|
|
59
61
|
|
60
62
|
def define_readonly_attributes(attributes)
|
61
63
|
attributes.each do |name|
|
62
|
-
@attributes.push name
|
63
64
|
define_method(name) { self[name] }
|
64
65
|
define_method("#{name}?") {!self[name]}
|
65
66
|
end
|
@@ -84,7 +85,7 @@ module Blimp
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def []=(key,value)
|
87
|
-
@attributes[key] = value
|
88
|
+
@attributes[key] = value if self.respond_to?(key)
|
88
89
|
end
|
89
90
|
|
90
91
|
def [](key)
|
@@ -111,7 +112,8 @@ module Blimp
|
|
111
112
|
attributes[key] = val
|
112
113
|
end
|
113
114
|
method = self.new? ? 'post' : 'put'
|
114
|
-
Blimp::API.send
|
115
|
+
self.attributes = Blimp::API.send(method, uri, body: attributes.to_json).parsed_response
|
116
|
+
return self
|
115
117
|
end
|
116
118
|
|
117
119
|
end
|
data/lib/blimp/task.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
module Blimp
|
2
2
|
class Task < Resource
|
3
3
|
ATTRIBUTES = %w[position goal user_rejected title project state assigned_to]
|
4
|
-
READ_ONLY = %w[
|
5
|
-
date_set_doing date_checked]
|
4
|
+
READ_ONLY = %w[date_done created_by date_set_doing date_checked]
|
6
5
|
|
7
6
|
define_attribute_methods ATTRIBUTES, READ_ONLY
|
8
7
|
end
|
data/lib/blimp/version.rb
CHANGED
metadata
CHANGED