kmayer-highrise 0.12.0 → 0.13.0
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/MIT-LICENSE +1 -1
- data/README.mkdn +3 -5
- data/VERSION.yml +1 -1
- data/highrise.gemspec +2 -2
- data/lib/highrise/tag.rb +11 -0
- data/spec/highrise/tag_spec.rb +7 -4
- metadata +2 -2
data/MIT-LICENSE
CHANGED
data/README.mkdn
CHANGED
@@ -2,13 +2,11 @@
|
|
2
2
|
|
3
3
|
## What is it?
|
4
4
|
|
5
|
-
This gem provides a set of classes to access information on [Highrise][h] via the published [API][api]
|
5
|
+
This gem provides a set of classes to access information on [Highrise][h] via the published [API][api]:
|
6
6
|
|
7
|
-
|
7
|
+
Comment, Company, Email, Group, Case, Membership, Note, Person, Subject, Tag, Task, User.
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
All these classes are inherited of ActiveResouce::Base. For more informations see the [ActiveResouce][ar] documentation.
|
9
|
+
All these classes are inherited from ActiveResouce::Base. Refer to the [ActiveResouce][ar] documentation for more information.
|
12
10
|
|
13
11
|
## Installing
|
14
12
|
|
data/VERSION.yml
CHANGED
data/highrise.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{highrise}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.13.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Marcos Tapaj\303\263s", "Ken Mayer"]
|
9
|
-
s.date = %q{2009-05-
|
9
|
+
s.date = %q{2009-05-29}
|
10
10
|
s.description = %q{
|
11
11
|
Based on the original API module from DHH, http://developer.37signals.com/highrise/, this
|
12
12
|
gem is a cleaned up, tested version of the same. Contributors have added support for tags
|
data/lib/highrise/tag.rb
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
module Highrise
|
2
2
|
class Tag < Base
|
3
|
+
@@tags = {}
|
3
4
|
def ==(object)
|
4
5
|
(object.instance_of?(self.class) && object.id == self.id && object.name == self.name)
|
5
6
|
end
|
7
|
+
|
8
|
+
def self.find_by_name(arg)
|
9
|
+
if @@tags == {}
|
10
|
+
self.find(:all).each do |tag|
|
11
|
+
@@tags[tag.id] = tag
|
12
|
+
@@tags[tag.name] = tag
|
13
|
+
end
|
14
|
+
end
|
15
|
+
@@tags[arg]
|
16
|
+
end
|
6
17
|
end
|
7
18
|
end
|
data/spec/highrise/tag_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe Highrise::Tag do
|
|
4
4
|
|
5
5
|
before(:each) do
|
6
6
|
Highrise::Base.site = 'http://example.com.i/'
|
7
|
-
@tag = Highrise::Tag.new
|
7
|
+
@tag = Highrise::Tag.new(:id => 1, :name => "Name")
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should be instance of Highrise::Base" do
|
@@ -12,10 +12,13 @@ describe Highrise::Tag do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should support equality" do
|
15
|
-
@tag.id = 1
|
16
|
-
@tag.name = "Name"
|
17
|
-
|
18
15
|
tag = Highrise::Tag.new(:id => 1, :name => "Name")
|
19
16
|
@tag.should == tag
|
20
17
|
end
|
18
|
+
|
19
|
+
it "it should find_by_name" do
|
20
|
+
tag = Highrise::Tag.new(:id => 2, :name => "Next")
|
21
|
+
Highrise::Tag.should_receive(:find).with(:all).and_return([tag, @tag])
|
22
|
+
Highrise::Tag.find_by_name("Name").should == @tag
|
23
|
+
end
|
21
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kmayer-highrise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Marcos Tapaj\xC3\xB3s"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-05-
|
13
|
+
date: 2009-05-29 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|