rogerio-augusto-highrise 2.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.
Files changed (54) hide show
  1. data/.gitignore +2 -0
  2. data/CHANGELOG +136 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.mkdn +84 -0
  5. data/Rakefile +40 -0
  6. data/VERSION.yml +5 -0
  7. data/autotest/discover.rb +3 -0
  8. data/examples/config_initializers_highrise.rb +12 -0
  9. data/examples/extending.rb +31 -0
  10. data/examples/sample.rb +10 -0
  11. data/highrise.gemspec +129 -0
  12. data/install.rb +1 -0
  13. data/lib/cachable.rb +83 -0
  14. data/lib/highrise/account.rb +8 -0
  15. data/lib/highrise/base.rb +7 -0
  16. data/lib/highrise/comment.rb +4 -0
  17. data/lib/highrise/company.rb +18 -0
  18. data/lib/highrise/deal.rb +5 -0
  19. data/lib/highrise/deal_category.rb +4 -0
  20. data/lib/highrise/email.rb +9 -0
  21. data/lib/highrise/group.rb +4 -0
  22. data/lib/highrise/kase.rb +8 -0
  23. data/lib/highrise/membership.rb +4 -0
  24. data/lib/highrise/note.rb +9 -0
  25. data/lib/highrise/pagination.rb +29 -0
  26. data/lib/highrise/person.rb +30 -0
  27. data/lib/highrise/subject.rb +25 -0
  28. data/lib/highrise/tag.rb +12 -0
  29. data/lib/highrise/taggable.rb +17 -0
  30. data/lib/highrise/task.rb +11 -0
  31. data/lib/highrise/user.rb +17 -0
  32. data/lib/highrise.rb +22 -0
  33. data/spec/cachable_spec.rb +84 -0
  34. data/spec/highrise/account_spec.rb +16 -0
  35. data/spec/highrise/base_spec.rb +13 -0
  36. data/spec/highrise/comment_spec.rb +14 -0
  37. data/spec/highrise/company_spec.rb +79 -0
  38. data/spec/highrise/deal_category_spec.rb +12 -0
  39. data/spec/highrise/deal_spec.rb +20 -0
  40. data/spec/highrise/email_spec.rb +25 -0
  41. data/spec/highrise/group_spec.rb +14 -0
  42. data/spec/highrise/kase_spec.rb +25 -0
  43. data/spec/highrise/membership_spec.rb +14 -0
  44. data/spec/highrise/note_spec.rb +23 -0
  45. data/spec/highrise/pagination_spec.rb +10 -0
  46. data/spec/highrise/person_spec.rb +96 -0
  47. data/spec/highrise/subject_spec.rb +49 -0
  48. data/spec/highrise/tag_spec.rb +23 -0
  49. data/spec/highrise/task_spec.rb +23 -0
  50. data/spec/highrise/user_spec.rb +35 -0
  51. data/spec/spec.opts +7 -0
  52. data/spec/spec_helper.rb +20 -0
  53. data/uninstall.rb +1 -0
  54. metadata +179 -0
@@ -0,0 +1,23 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Highrise::Tag do
4
+ before(:each) do
5
+ Highrise::Base.site = 'http://example.com.i/'
6
+ @tag = Highrise::Tag.new(:id => 1, :name => "Name")
7
+ end
8
+
9
+ it "should be instance of Highrise::Base" do
10
+ @tag.kind_of?(Highrise::Base).should be_true
11
+ end
12
+
13
+ it "should support equality" do
14
+ tag = Highrise::Tag.new(:id => 1, :name => "Name")
15
+ @tag.should == tag
16
+ end
17
+
18
+ it "it should find_by_name" do
19
+ tag = Highrise::Tag.new(:id => 2, :name => "Next")
20
+ Highrise::Tag.should_receive(:find).with(:all).and_return([tag, @tag])
21
+ Highrise::Tag.find_by_name("Name").should == @tag
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Highrise::Task do
4
+
5
+ before(:each) do
6
+ @task = Highrise::Task.new
7
+ end
8
+
9
+ it "should be instance of Highrise::Base" do
10
+ @task.kind_of?(Highrise::Base).should be_true
11
+ end
12
+
13
+ describe ".complete!" do
14
+
15
+ it "should delegate to load_attributes_from_response" do
16
+ @task.should_receive(:load_attributes_from_response).with("post")
17
+ @task.should_receive(:post).with(:complete).and_return("post")
18
+ @task.complete!
19
+ end
20
+
21
+ end
22
+
23
+ end
@@ -0,0 +1,35 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Highrise::User do
4
+
5
+ before(:each) do
6
+ @user = Highrise::User.new
7
+ end
8
+
9
+ it "should be instance of Highrise::Base" do
10
+ @user.kind_of?(Highrise::Base).should be_true
11
+ end
12
+
13
+ it "should delegate to find(:one, :from => '/me.xml') when me is called" do
14
+ Highrise::User.should_receive(:find).with(:one, {:from => "/me.xml"}).and_return(@user)
15
+ Highrise::User.me.should == @user
16
+ end
17
+
18
+ def join(group)
19
+ Membership.create(:user_id => id, :group_id => group.id)
20
+ end
21
+
22
+ describe ".join" do
23
+
24
+ it "should delegate to Highrise::Membership.create" do
25
+ group_mock = mock("group")
26
+ group_mock.should_receive(:id).and_return(2)
27
+ @user.should_receive(:id).and_return(1)
28
+ Highrise::Membership.should_receive(:create).with({:user_id=>1, :group_id=>2})
29
+ @user.join(group_mock)
30
+ end
31
+
32
+ end
33
+
34
+
35
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1,7 @@
1
+ --colour
2
+ --format
3
+ progress
4
+ --loadby
5
+ mtime
6
+ --reverse
7
+ -rubygems
@@ -0,0 +1,20 @@
1
+ require File.dirname(__FILE__) + '/../lib/highrise'
2
+
3
+ def turn_methods_public(klass, method_name = nil)
4
+ if method_name
5
+ klass.class_eval do
6
+ public method_name
7
+ end
8
+ else
9
+ turn_all_methods_public klass
10
+ end
11
+ end
12
+
13
+ def turn_all_methods_public(klass)
14
+ klass.class_eval do
15
+ private_instance_methods.each { |instance_method| public instance_method }
16
+ private_methods.each { |method| public_class_method method }
17
+ protected_instance_methods.each { |instance_method| public instance_method }
18
+ protected_methods.each { |method| public_class_method method }
19
+ end
20
+ end
data/uninstall.rb ADDED
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
metadata ADDED
@@ -0,0 +1,179 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rogerio-augusto-highrise
3
+ version: !ruby/object:Gem::Version
4
+ hash: 11
5
+ prerelease: false
6
+ segments:
7
+ - 2
8
+ - 0
9
+ - 2
10
+ version: 2.0.2
11
+ platform: ruby
12
+ authors:
13
+ - "Marcos Tapaj\xC3\xB3s"
14
+ - Ken Mayer
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2010-08-25 00:00:00 -03:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: activeresource
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 1
31
+ segments:
32
+ - 2
33
+ - 1
34
+ version: "2.1"
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: activesupport
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 1
46
+ segments:
47
+ - 2
48
+ - 1
49
+ version: "2.1"
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ description: "\n\
53
+ Based on the original API module from DHH, http://developer.37signals.com/highrise/, this\n\
54
+ gem is a cleaned up, tested version of the same. Contributors have added support for tags \n\
55
+ which are not supported by the API directly\n\n\
56
+ Configure by adding the following:\n\n\
57
+ require 'highrise'\n\
58
+ Highrise::Base.site = 'http://your_site.highrisehq.com/'\n\
59
+ Highrise::Base.user = 'your_api_auth_token'\n "
60
+ email:
61
+ - marcos@tapajos.me
62
+ - kmayer@bitwrangler.com
63
+ executables: []
64
+
65
+ extensions: []
66
+
67
+ extra_rdoc_files:
68
+ - README.mkdn
69
+ files:
70
+ - .gitignore
71
+ - CHANGELOG
72
+ - MIT-LICENSE
73
+ - README.mkdn
74
+ - Rakefile
75
+ - VERSION.yml
76
+ - autotest/discover.rb
77
+ - examples/config_initializers_highrise.rb
78
+ - examples/extending.rb
79
+ - examples/sample.rb
80
+ - highrise.gemspec
81
+ - install.rb
82
+ - lib/cachable.rb
83
+ - lib/highrise.rb
84
+ - lib/highrise/account.rb
85
+ - lib/highrise/base.rb
86
+ - lib/highrise/comment.rb
87
+ - lib/highrise/company.rb
88
+ - lib/highrise/deal.rb
89
+ - lib/highrise/deal_category.rb
90
+ - lib/highrise/email.rb
91
+ - lib/highrise/group.rb
92
+ - lib/highrise/kase.rb
93
+ - lib/highrise/membership.rb
94
+ - lib/highrise/note.rb
95
+ - lib/highrise/pagination.rb
96
+ - lib/highrise/person.rb
97
+ - lib/highrise/subject.rb
98
+ - lib/highrise/tag.rb
99
+ - lib/highrise/taggable.rb
100
+ - lib/highrise/task.rb
101
+ - lib/highrise/user.rb
102
+ - spec/cachable_spec.rb
103
+ - spec/highrise/account_spec.rb
104
+ - spec/highrise/base_spec.rb
105
+ - spec/highrise/comment_spec.rb
106
+ - spec/highrise/company_spec.rb
107
+ - spec/highrise/deal_spec.rb
108
+ - spec/highrise/deal_category_spec.rb
109
+ - spec/highrise/email_spec.rb
110
+ - spec/highrise/group_spec.rb
111
+ - spec/highrise/kase_spec.rb
112
+ - spec/highrise/membership_spec.rb
113
+ - spec/highrise/note_spec.rb
114
+ - spec/highrise/pagination_spec.rb
115
+ - spec/highrise/person_spec.rb
116
+ - spec/highrise/subject_spec.rb
117
+ - spec/highrise/tag_spec.rb
118
+ - spec/highrise/task_spec.rb
119
+ - spec/highrise/user_spec.rb
120
+ - spec/spec.opts
121
+ - spec/spec_helper.rb
122
+ - uninstall.rb
123
+ has_rdoc: true
124
+ homepage: http://github.com/tapajos/highrise
125
+ licenses: []
126
+
127
+ post_install_message:
128
+ rdoc_options:
129
+ - --charset=UTF-8
130
+ require_paths:
131
+ - lib
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ none: false
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ hash: 3
138
+ segments:
139
+ - 0
140
+ version: "0"
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
+ none: false
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ hash: 3
147
+ segments:
148
+ - 0
149
+ version: "0"
150
+ requirements: []
151
+
152
+ rubyforge_project:
153
+ rubygems_version: 1.3.7
154
+ signing_key:
155
+ specification_version: 3
156
+ summary: Ruby wrapper around Highrise API
157
+ test_files:
158
+ - spec/cachable_spec.rb
159
+ - spec/highrise/account_spec.rb
160
+ - spec/highrise/base_spec.rb
161
+ - spec/highrise/comment_spec.rb
162
+ - spec/highrise/company_spec.rb
163
+ - spec/highrise/deal_spec.rb
164
+ - spec/highrise/deal_category_spec.rb
165
+ - spec/highrise/email_spec.rb
166
+ - spec/highrise/group_spec.rb
167
+ - spec/highrise/kase_spec.rb
168
+ - spec/highrise/membership_spec.rb
169
+ - spec/highrise/note_spec.rb
170
+ - spec/highrise/pagination_spec.rb
171
+ - spec/highrise/person_spec.rb
172
+ - spec/highrise/subject_spec.rb
173
+ - spec/highrise/tag_spec.rb
174
+ - spec/highrise/task_spec.rb
175
+ - spec/highrise/user_spec.rb
176
+ - spec/spec_helper.rb
177
+ - examples/config_initializers_highrise.rb
178
+ - examples/extending.rb
179
+ - examples/sample.rb