highrise 2.0.1 → 3.0.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.
Files changed (63) hide show
  1. data/Gemfile +3 -0
  2. data/Gemfile.lock +38 -0
  3. data/MIT-LICENSE +1 -1
  4. data/README.mkdn +21 -29
  5. data/Rakefile +6 -31
  6. data/autotest/discover.rb +1 -3
  7. data/examples/config_initializers_highrise.rb +1 -9
  8. data/examples/sample.rb +0 -1
  9. data/highrise.gemspec +24 -117
  10. data/lib/highrise.rb +6 -5
  11. data/lib/highrise/account.rb +0 -1
  12. data/lib/highrise/base.rb +15 -3
  13. data/lib/highrise/comment.rb +1 -2
  14. data/lib/highrise/company.rb +3 -2
  15. data/lib/highrise/deal.rb +4 -1
  16. data/lib/highrise/deal_category.rb +3 -0
  17. data/lib/highrise/group.rb +1 -2
  18. data/lib/highrise/kase.rb +13 -2
  19. data/lib/highrise/membership.rb +1 -2
  20. data/lib/highrise/pagination.rb +8 -1
  21. data/lib/highrise/party.rb +11 -0
  22. data/lib/highrise/person.rb +1 -4
  23. data/lib/highrise/recording.rb +5 -0
  24. data/lib/highrise/searchable.rb +22 -0
  25. data/lib/highrise/subject.rb +6 -0
  26. data/lib/highrise/tag.rb +0 -5
  27. data/lib/highrise/taggable.rb +4 -1
  28. data/lib/highrise/task_category.rb +3 -0
  29. data/lib/highrise/version.rb +3 -0
  30. data/spec/highrise/account_spec.rb +5 -11
  31. data/spec/highrise/base_spec.rb +45 -10
  32. data/spec/highrise/comment_spec.rb +2 -11
  33. data/spec/highrise/company_spec.rb +10 -72
  34. data/spec/highrise/deal_category_spec.rb +13 -0
  35. data/spec/highrise/deal_spec.rb +16 -13
  36. data/spec/highrise/email_spec.rb +7 -19
  37. data/spec/highrise/group_spec.rb +2 -11
  38. data/spec/highrise/kase_spec.rb +10 -18
  39. data/spec/highrise/membership_spec.rb +2 -11
  40. data/spec/highrise/note_spec.rb +8 -17
  41. data/spec/highrise/pagination_behavior.rb +20 -0
  42. data/spec/highrise/pagination_spec.rb +4 -6
  43. data/spec/highrise/party_spec.rb +16 -0
  44. data/spec/highrise/person_spec.rb +23 -80
  45. data/spec/highrise/recording_spec.rb +13 -0
  46. data/spec/highrise/searchable_behavior.rb +13 -0
  47. data/spec/highrise/searchable_spec.rb +8 -0
  48. data/spec/highrise/subject_spec.rb +20 -35
  49. data/spec/highrise/tag_spec.rb +8 -13
  50. data/spec/highrise/taggable_behavior.rb +27 -0
  51. data/spec/highrise/taggable_spec.rb +9 -0
  52. data/spec/highrise/task_category_spec.rb +13 -0
  53. data/spec/highrise/task_spec.rb +6 -18
  54. data/spec/highrise/user_spec.rb +11 -28
  55. data/spec/spec_helper.rb +9 -18
  56. metadata +55 -42
  57. data/CHANGELOG +0 -131
  58. data/VERSION.yml +0 -5
  59. data/install.rb +0 -1
  60. data/lib/cachable.rb +0 -83
  61. data/spec/cachable_spec.rb +0 -84
  62. data/spec/spec.opts +0 -7
  63. data/uninstall.rb +0 -1
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe Highrise::Taggable do
4
+ class TestClass < Highrise::Base; include Highrise::Taggable; end
5
+
6
+ subject { TestClass.new }
7
+
8
+ it_should_behave_like "a taggable class"
9
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe Highrise::TaskCategory do
4
+ subject { Highrise::TaskCategory.new(:id => 1, :name => "Task Category") }
5
+
6
+ it { should be_a_kind_of Highrise::Base }
7
+
8
+ it ".find_by_name" do
9
+ task_category = Highrise::TaskCategory.new(:id => 2, :name => "Another Task Category")
10
+ Highrise::TaskCategory.should_receive(:find).with(:all).and_return([task_category, subject])
11
+ Highrise::TaskCategory.find_by_name("Task Category").should == subject
12
+ end
13
+ end
@@ -1,23 +1,11 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
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
4
+ it { should be_a_kind_of Highrise::Base }
12
5
 
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
-
6
+ it "#complete!" do
7
+ subject.should_receive(:load_attributes_from_response).with("post")
8
+ subject.should_receive(:post).with(:complete).and_return("post")
9
+ subject.complete!
21
10
  end
22
-
23
11
  end
@@ -1,35 +1,18 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
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
4
+ it { should be_a_kind_of Highrise::Base }
17
5
 
18
- def join(group)
19
- Membership.create(:user_id => id, :group_id => group.id)
6
+ it ".me" do
7
+ Highrise::User.should_receive(:find).with(:one, {:from => "/me.xml"}).and_return(subject)
8
+ Highrise::User.me.should == subject
20
9
  end
21
10
 
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
-
11
+ it "#join" do
12
+ group_mock = mock("group")
13
+ group_mock.should_receive(:id).and_return(2)
14
+ subject.should_receive(:id).and_return(1)
15
+ Highrise::Membership.should_receive(:create).with({:user_id=>1, :group_id=>2})
16
+ subject.join(group_mock)
32
17
  end
33
-
34
-
35
18
  end
data/spec/spec_helper.rb CHANGED
@@ -1,20 +1,11 @@
1
- require File.dirname(__FILE__) + '/../lib/highrise'
1
+ require 'bundler'
2
+ Bundler.setup
2
3
 
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
4
+ require File.join(File.dirname(__FILE__), '/../lib/highrise')
12
5
 
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
6
+ Highrise::Base.user = ENV['HIGHRISE_USER'] || 'x'
7
+ Highrise::Base.site = ENV['HIGHRISE_SITE'] || 'http://www.example.com'
8
+
9
+ require 'highrise/pagination_behavior'
10
+ require 'highrise/searchable_behavior'
11
+ require 'highrise/taggable_behavior'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highrise
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
- - 2
7
+ - 3
8
8
  - 0
9
- - 1
10
- version: 2.0.1
9
+ - 0
10
+ version: 3.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Marcos Tapaj\xC3\xB3s"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-08-25 00:00:00 -03:00
19
+ date: 2010-11-06 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -25,38 +25,31 @@ dependencies:
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ">="
28
+ - - ~>
29
29
  - !ruby/object:Gem::Version
30
- hash: 1
30
+ hash: 7
31
31
  segments:
32
- - 2
33
- - 1
34
- version: "2.1"
32
+ - 3
33
+ - 0
34
+ - 0
35
+ version: 3.0.0
35
36
  type: :runtime
36
37
  version_requirements: *id001
37
38
  - !ruby/object:Gem::Dependency
38
- name: activesupport
39
+ name: rspec
39
40
  prerelease: false
40
41
  requirement: &id002 !ruby/object:Gem::Requirement
41
42
  none: false
42
43
  requirements:
43
44
  - - ">="
44
45
  - !ruby/object:Gem::Version
45
- hash: 1
46
+ hash: 3
46
47
  segments:
47
- - 2
48
- - 1
49
- version: "2.1"
50
- type: :runtime
48
+ - 0
49
+ version: "0"
50
+ type: :development
51
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 "
52
+ description: " Based on the original API module from DHH, http://developer.37signals.com/highrise/, this\n gem is a cleaned up, tested version of the same. \n\n Configure by adding the following:\n\n require 'highrise'\n Highrise::Base.site = 'http://your_site.highrisehq.com/'\n Highrise::Base.user = 'your_api_auth_token'\n"
60
53
  email:
61
54
  - marcos@tapajos.me
62
55
  - kmayer@bitwrangler.com
@@ -64,67 +57,77 @@ executables: []
64
57
 
65
58
  extensions: []
66
59
 
67
- extra_rdoc_files:
68
- - README.mkdn
60
+ extra_rdoc_files: []
61
+
69
62
  files:
70
63
  - .gitignore
71
- - CHANGELOG
64
+ - Gemfile
65
+ - Gemfile.lock
72
66
  - MIT-LICENSE
73
67
  - README.mkdn
74
68
  - Rakefile
75
- - VERSION.yml
76
69
  - autotest/discover.rb
77
70
  - examples/config_initializers_highrise.rb
78
71
  - examples/extending.rb
79
72
  - examples/sample.rb
80
73
  - highrise.gemspec
81
- - install.rb
82
- - lib/cachable.rb
83
74
  - lib/highrise.rb
84
75
  - lib/highrise/account.rb
85
76
  - lib/highrise/base.rb
86
77
  - lib/highrise/comment.rb
87
78
  - lib/highrise/company.rb
88
79
  - lib/highrise/deal.rb
80
+ - lib/highrise/deal_category.rb
89
81
  - lib/highrise/email.rb
90
82
  - lib/highrise/group.rb
91
83
  - lib/highrise/kase.rb
92
84
  - lib/highrise/membership.rb
93
85
  - lib/highrise/note.rb
94
86
  - lib/highrise/pagination.rb
87
+ - lib/highrise/party.rb
95
88
  - lib/highrise/person.rb
89
+ - lib/highrise/recording.rb
90
+ - lib/highrise/searchable.rb
96
91
  - lib/highrise/subject.rb
97
92
  - lib/highrise/tag.rb
98
93
  - lib/highrise/taggable.rb
99
94
  - lib/highrise/task.rb
95
+ - lib/highrise/task_category.rb
100
96
  - lib/highrise/user.rb
101
- - spec/cachable_spec.rb
97
+ - lib/highrise/version.rb
102
98
  - spec/highrise/account_spec.rb
103
99
  - spec/highrise/base_spec.rb
104
100
  - spec/highrise/comment_spec.rb
105
101
  - spec/highrise/company_spec.rb
102
+ - spec/highrise/deal_category_spec.rb
106
103
  - spec/highrise/deal_spec.rb
107
104
  - spec/highrise/email_spec.rb
108
105
  - spec/highrise/group_spec.rb
109
106
  - spec/highrise/kase_spec.rb
110
107
  - spec/highrise/membership_spec.rb
111
108
  - spec/highrise/note_spec.rb
109
+ - spec/highrise/pagination_behavior.rb
112
110
  - spec/highrise/pagination_spec.rb
111
+ - spec/highrise/party_spec.rb
113
112
  - spec/highrise/person_spec.rb
113
+ - spec/highrise/recording_spec.rb
114
+ - spec/highrise/searchable_behavior.rb
115
+ - spec/highrise/searchable_spec.rb
114
116
  - spec/highrise/subject_spec.rb
115
117
  - spec/highrise/tag_spec.rb
118
+ - spec/highrise/taggable_behavior.rb
119
+ - spec/highrise/taggable_spec.rb
120
+ - spec/highrise/task_category_spec.rb
116
121
  - spec/highrise/task_spec.rb
117
122
  - spec/highrise/user_spec.rb
118
- - spec/spec.opts
119
123
  - spec/spec_helper.rb
120
- - uninstall.rb
121
124
  has_rdoc: true
122
125
  homepage: http://github.com/tapajos/highrise
123
126
  licenses: []
124
127
 
125
128
  post_install_message:
126
- rdoc_options:
127
- - --charset=UTF-8
129
+ rdoc_options: []
130
+
128
131
  require_paths:
129
132
  - lib
130
133
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -141,10 +144,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
144
  requirements:
142
145
  - - ">="
143
146
  - !ruby/object:Gem::Version
144
- hash: 3
147
+ hash: 23
145
148
  segments:
146
- - 0
147
- version: "0"
149
+ - 1
150
+ - 3
151
+ - 6
152
+ version: 1.3.6
148
153
  requirements: []
149
154
 
150
155
  rubyforge_project:
@@ -153,24 +158,32 @@ signing_key:
153
158
  specification_version: 3
154
159
  summary: Ruby wrapper around Highrise API
155
160
  test_files:
156
- - spec/cachable_spec.rb
161
+ - examples/config_initializers_highrise.rb
162
+ - examples/extending.rb
163
+ - examples/sample.rb
157
164
  - spec/highrise/account_spec.rb
158
165
  - spec/highrise/base_spec.rb
159
166
  - spec/highrise/comment_spec.rb
160
167
  - spec/highrise/company_spec.rb
168
+ - spec/highrise/deal_category_spec.rb
161
169
  - spec/highrise/deal_spec.rb
162
170
  - spec/highrise/email_spec.rb
163
171
  - spec/highrise/group_spec.rb
164
172
  - spec/highrise/kase_spec.rb
165
173
  - spec/highrise/membership_spec.rb
166
174
  - spec/highrise/note_spec.rb
175
+ - spec/highrise/pagination_behavior.rb
167
176
  - spec/highrise/pagination_spec.rb
177
+ - spec/highrise/party_spec.rb
168
178
  - spec/highrise/person_spec.rb
179
+ - spec/highrise/recording_spec.rb
180
+ - spec/highrise/searchable_behavior.rb
181
+ - spec/highrise/searchable_spec.rb
169
182
  - spec/highrise/subject_spec.rb
170
183
  - spec/highrise/tag_spec.rb
184
+ - spec/highrise/taggable_behavior.rb
185
+ - spec/highrise/taggable_spec.rb
186
+ - spec/highrise/task_category_spec.rb
171
187
  - spec/highrise/task_spec.rb
172
188
  - spec/highrise/user_spec.rb
173
189
  - spec/spec_helper.rb
174
- - examples/config_initializers_highrise.rb
175
- - examples/extending.rb
176
- - examples/sample.rb
data/CHANGELOG DELETED
@@ -1,131 +0,0 @@
1
- Author: Kenneth Mayer <kmayer@bitwrangler.com>
2
- Date: Wed Feb 17 09:42:25 2010 -1000
3
-
4
- Version bump to 2.0.0 -- Complete rewrite of Cachable. Interface has changed, see docs and examples.
5
-
6
- Author: Kenneth Mayer <kmayer@bitwrangler.com>
7
- Date: Mon Feb 15 13:41:28 2010 -1000
8
-
9
- Version bump to 1.2.0
10
-
11
- Added Account class to handle the /account.xml end point.
12
-
13
- Author: Marcos Tapajós <tapajos@gmail.com>
14
- Date: Wed Feb 10 22:57:34 2010 -0200
15
-
16
- Version bump to 1.1.0 -- Added Deal class, .add_note helper, /me.xml endpoint
17
-
18
- Author: Kenneth Mayer <kmayer@bitwrangler.com>
19
- Date: Wed Sep 2 08:56:42 2009 -1000
20
-
21
- Version bump to 1.0.1
22
-
23
- Added a couple of convenience methods.
24
-
25
- Author: Kenneth Mayer <kmayer@bitwrangler.com>
26
- Date: Tue Sep 1 21:32:19 2009 -1000
27
-
28
- Version bump to 1.0.0
29
-
30
- Revised Taggable interface to support new tag API from 37Sigs and (removed curl dependencies)
31
-
32
- Refactored Cachable
33
-
34
- Author: Kenneth Mayer <kmayer@bitwrangler.com>
35
- Date: Fri May 29 22:34:03 2009 -1000
36
-
37
- Version bump to 0.13.0
38
-
39
- Added Tag.find_by_name
40
-
41
- 2009-05-27 Ken Mayer <kmayer@bitwrangler.com>
42
-
43
- * Version 0.12.0
44
-
45
- * Added store_options attribute, so fetches will work work with
46
- :mem_cache_store and :expires_in
47
-
48
- 2009-05-20 Ken Mayer <kmayer@bitwrangler.com>
49
-
50
- * Version 0.11.0
51
-
52
- * Added untag_id! to Taggable, in case you already know the id and don't
53
- need to search for it again.
54
-
55
- 2009-05-16 Ken Mayer <kmayer@bitwrangler.com>
56
-
57
- * Version 0.10.0
58
-
59
- * Simplified caching store interface, left configuration up to end-user with
60
- less magic
61
-
62
- * Removed version.rb module & tests. No one will ever use it, why clutter up
63
- the code.
64
-
65
- 2009-05-05 Ken Mayer <kmayer@bitwrangler.com>
66
-
67
- * Version 0.9.2
68
-
69
- * Refactored cachable to be more idiomatic ruby
70
-
71
- * Dropped the SHA1 hashing from cache_key
72
-
73
- 2009-05-04 Ken Mayer <kmayer@bitwrangler.com>
74
-
75
- * Version 0.9.0
76
-
77
- * Changed cache_store= interface to accept :none (to disable caching),
78
- :rails (to use the default Rails cache, whatever that happens to be), and,
79
- consequently, restores the lookup_store default behavior (given nil or
80
- empty options returns a new, default cache_store).
81
-
82
- * Documentation update. Created and back-filled CHANGELOG
83
-
84
- 2009-05-01 Ken Mayer <kmayer@bitwrangler.com>
85
-
86
- * Version 0.8.0
87
-
88
- * Added caching feature
89
-
90
- * Added example code
91
-
92
- * Documentation update
93
-
94
- * Updated gemspec
95
-
96
- 2009-04-26 Ken Mayer <kmayer@bitwrangler.com>
97
-
98
- * Version 0.7.0
99
-
100
- * Refactored Tag & Taggable so ::Tag is a subclass of Base. This adds
101
- ::Tag.find(:all) to your quiver of tools. All existing functionality
102
- passes tests, but the interface to ::Tag.new has changed. You have to
103
- treat it like all of other ARes, that is, use a Hash (instead of
104
- positional parameters) to initialize the model.
105
-
106
- 2009-04-22 Luis Bepop
107
-
108
- * Version 0.6.3
109
-
110
- * Support to tags refactored. Include curl helper to improve support for
111
- objects without ActiveResource base like 'tag' which needs a parse in a
112
- html document from a httprequest.
113
-
114
- 2009-04-06 slainer68
115
-
116
- * Version 0.6.2
117
-
118
- * Modularize Taggable
119
-
120
- 2009-03-31 ThiagoLelis
121
-
122
- * Version 0.6.1
123
-
124
- * Add Person.tag that show a array of tags, and Perton.tag(name), add a new
125
- tag to a person.
126
-
127
- 2009-01-14 Marcos Tapajós
128
-
129
- * Version 0.5.0
130
-
131
- * Initial import