highrise 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +2 -2
- data/Gemfile +1 -1
- data/Gemfile.lock +23 -28
- data/README.md +4 -12
- data/highrise.gemspec +3 -3
- data/lib/highrise/base.rb +24 -1
- data/lib/highrise/version.rb +1 -1
- data/spec/highrise/base_spec.rb +7 -0
- data/spec/spec_helper.rb +3 -2
- metadata +61 -85
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 82f10bfe36636515c9644ad853a04dbd22a90f7f
|
4
|
+
data.tar.gz: 8c2335bbbf7080388045b484fd62f02cb1aba906
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 516dca70a252a45213124ba806e9b33cbf1dd324775ed802ce44ddfc401560d5bee43afcc45db22a8e56917d93e9bdf9141ee27c7316a88bdaecb53cb8f858f6
|
7
|
+
data.tar.gz: 41486bb26da7871ec8bb4a7bdc751ad2dbff92ee468fdeebc95df878d35f92973a5dd7952618f39a5041b1a5d0a58b0e985bdfd093f6a0abca8e9387b6abe5be
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,39 +1,34 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
highrise (3.0.
|
4
|
+
highrise (3.0.4)
|
5
5
|
activeresource (~> 3.0)
|
6
6
|
|
7
7
|
GEM
|
8
|
-
remote:
|
8
|
+
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (3.
|
11
|
-
activesupport (= 3.
|
12
|
-
bcrypt-ruby (~> 3.0.0)
|
10
|
+
activemodel (3.2.12)
|
11
|
+
activesupport (= 3.2.12)
|
13
12
|
builder (~> 3.0.0)
|
13
|
+
activeresource (3.2.12)
|
14
|
+
activemodel (= 3.2.12)
|
15
|
+
activesupport (= 3.2.12)
|
16
|
+
activesupport (3.2.12)
|
14
17
|
i18n (~> 0.6)
|
15
|
-
activeresource (3.1.0)
|
16
|
-
activemodel (= 3.1.0)
|
17
|
-
activesupport (= 3.1.0)
|
18
|
-
activesupport (3.1.0)
|
19
18
|
multi_json (~> 1.0)
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
rspec-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
rspec-
|
33
|
-
diff-lcs (>= 1.1.2)
|
34
|
-
rspec-mocks (2.0.1)
|
35
|
-
rspec-core (~> 2.0.1)
|
36
|
-
rspec-expectations (~> 2.0.1)
|
19
|
+
builder (3.0.4)
|
20
|
+
diff-lcs (1.2.1)
|
21
|
+
i18n (0.6.4)
|
22
|
+
multi_json (1.6.1)
|
23
|
+
rake (10.0.3)
|
24
|
+
rspec (2.13.0)
|
25
|
+
rspec-core (~> 2.13.0)
|
26
|
+
rspec-expectations (~> 2.13.0)
|
27
|
+
rspec-mocks (~> 2.13.0)
|
28
|
+
rspec-core (2.13.0)
|
29
|
+
rspec-expectations (2.13.0)
|
30
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
31
|
+
rspec-mocks (2.13.0)
|
37
32
|
|
38
33
|
PLATFORMS
|
39
34
|
java
|
@@ -41,5 +36,5 @@ PLATFORMS
|
|
41
36
|
|
42
37
|
DEPENDENCIES
|
43
38
|
highrise!
|
44
|
-
rake
|
45
|
-
rspec
|
39
|
+
rake
|
40
|
+
rspec
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Highrise (
|
1
|
+
# Highrise (master) [![Build Status](https://secure.travis-ci.org/tapajos/highrise.png)](http://travis-ci.org/tapajos/highrise)
|
2
2
|
|
3
3
|
## What is it?
|
4
4
|
|
@@ -24,6 +24,7 @@ All these classes are inherited from ActiveResouce::Base. Refer to the [ActiveRe
|
|
24
24
|
|
25
25
|
Highrise::Base.site = 'https://your_site.highrisehq.com'
|
26
26
|
Highrise::Base.user = 'api-auth-token'
|
27
|
+
Highrise::Base.format = :xml
|
27
28
|
|
28
29
|
If you are using this in a Rails application, putting this code in a config/initializers/highrise.rb
|
29
30
|
file is recommended. See config_initializers_highrise.rb in the examples/ directory.
|
@@ -52,13 +53,7 @@ version file.
|
|
52
53
|
* [Marcos Tapajós][tapajos]
|
53
54
|
* [Ken Mayer][kmayer]
|
54
55
|
|
55
|
-
## Contributors
|
56
|
-
|
57
|
-
* [Nicolas Bianco][slainer86]
|
58
|
-
* [Luis Gustavo][luisbebop]
|
59
|
-
* [Thiago Lelis][ThiagoLelis]
|
60
|
-
* [Denis Odorcic][odorcicd]
|
61
|
-
|
56
|
+
## [Contributors][list]
|
62
57
|
|
63
58
|
|
64
59
|
[api]: http://developer.37signals.com/highrise
|
@@ -67,10 +62,7 @@ version file.
|
|
67
62
|
[h]: http://www.highrisehq.com/
|
68
63
|
[i]: https://github.com/tapajos/highrise/issues
|
69
64
|
[kmayer]: https://github.com/kmayer
|
70
|
-
[luisbebop]: https://github.com/luisbebop
|
71
65
|
[mit]:http://www.opensource.org/licenses/mit-license.php
|
72
|
-
[slainer86]: https://github.com/slainer86
|
73
|
-
[odorcicd]: https://github.com/odorcicd
|
74
66
|
[rdoc]: http://rdoc.info/projects/tapajos/highrise
|
75
67
|
[tapajos]: http://www.improveit.com.br/en/company/tapajos
|
76
|
-
[
|
68
|
+
[list]: https://github.com/tapajos/highrise/graphs/contributors
|
data/highrise.gemspec
CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
|
10
10
|
s.required_rubygems_version = ">= 1.3.6"
|
11
|
-
s.add_dependency "activeresource", "~>3.0"
|
12
|
-
s.add_development_dependency "rspec"
|
13
|
-
s.add_development_dependency "rake"
|
11
|
+
s.add_dependency "activeresource", "~> 3.0"
|
12
|
+
s.add_development_dependency "rspec"
|
13
|
+
s.add_development_dependency "rake"
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features,examples}/*`.split("\n")
|
data/lib/highrise/base.rb
CHANGED
@@ -3,6 +3,29 @@ require 'active_resource'
|
|
3
3
|
module Highrise
|
4
4
|
class Base < ActiveResource::Base
|
5
5
|
protected
|
6
|
+
|
7
|
+
class << self
|
8
|
+
# If headers are not defined in a given subclass, then obtain
|
9
|
+
# headers from the superclass.
|
10
|
+
# http://opensoul.org/blog/archives/2010/02/16/active-resource-in-practice/
|
11
|
+
def headers
|
12
|
+
if defined?(@headers)
|
13
|
+
@headers
|
14
|
+
elsif superclass != Object && superclass.headers
|
15
|
+
superclass.headers
|
16
|
+
else
|
17
|
+
@headers ||= {}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def oauth_token=(token)
|
22
|
+
headers['Authorization'] = "Bearer #{token}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Fix for ActiveResource 3.1+ errors
|
27
|
+
self.format = :xml
|
28
|
+
|
6
29
|
# Dynamic finder for attributes
|
7
30
|
def self.method_missing(method, *args)
|
8
31
|
if method.to_s =~ /^find_(all_)?by_([_a-zA-Z]\w*)$/
|
@@ -16,4 +39,4 @@ module Highrise
|
|
16
39
|
end
|
17
40
|
|
18
41
|
end
|
19
|
-
end
|
42
|
+
end
|
data/lib/highrise/version.rb
CHANGED
data/spec/highrise/base_spec.rb
CHANGED
@@ -45,4 +45,11 @@ describe Highrise::Base do
|
|
45
45
|
expect { Highrise::Base.any_other_method }.to raise_error(NoMethodError)
|
46
46
|
end
|
47
47
|
end
|
48
|
+
|
49
|
+
describe "when using an oauth token" do
|
50
|
+
it ".oauth_token= writes a bearer authorization header" do
|
51
|
+
Highrise::Base.oauth_token = 'OAUTH_TOKEN'
|
52
|
+
Highrise::Base.headers['Authorization'].should == 'Bearer OAUTH_TOKEN'
|
53
|
+
end
|
54
|
+
end
|
48
55
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,8 +3,9 @@ Bundler.setup
|
|
3
3
|
|
4
4
|
require File.join(File.dirname(__FILE__), '/../lib/highrise')
|
5
5
|
|
6
|
-
Highrise::Base.user
|
7
|
-
Highrise::Base.
|
6
|
+
Highrise::Base.user = ENV['HIGHRISE_USER'] || 'x'
|
7
|
+
Highrise::Base.oauth_token = ENV['HIGHRISE_TOKEN'] || 'TOKEN'
|
8
|
+
Highrise::Base.site = ENV['HIGHRISE_SITE'] || 'https://www.example.com'
|
8
9
|
|
9
10
|
require 'highrise/pagination_behavior'
|
10
11
|
require 'highrise/searchable_behavior'
|
metadata
CHANGED
@@ -1,81 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: highrise
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 0
|
9
|
-
- 3
|
10
|
-
version: 3.0.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.4
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
13
|
-
-
|
6
|
+
authors:
|
7
|
+
- Marcos Tapajós
|
14
8
|
- Ken Mayer
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
12
|
+
date: 2013-03-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activeresource
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
25
18
|
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
segments:
|
29
|
-
- 3
|
30
|
-
- 0
|
31
|
-
version: "3.0"
|
32
|
-
requirement: *id001
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '3.0'
|
33
21
|
type: :runtime
|
34
22
|
prerelease: false
|
35
|
-
|
36
|
-
|
37
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
|
-
requirements:
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
40
25
|
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
|
44
|
-
- 2
|
45
|
-
- 0
|
46
|
-
- 1
|
47
|
-
version: 2.0.1
|
48
|
-
requirement: *id002
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '3.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
51
29
|
name: rspec
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
hash: 49
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
- 8
|
62
|
-
- 7
|
63
|
-
version: 0.8.7
|
64
|
-
requirement: *id003
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
65
35
|
type: :development
|
66
36
|
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
67
43
|
name: rake
|
68
|
-
|
69
|
-
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
description: " Based on the original API module from DHH, http://developer.37signals.com/highrise/,
|
57
|
+
this\n gem is a cleaned up, tested version of the same. \n\n Configure by
|
58
|
+
adding the following:\n\n require 'highrise'\n Highrise::Base.site = 'http://your_site.highrisehq.com/'\n
|
59
|
+
\ Highrise::Base.user = 'your_api_auth_token'\n"
|
60
|
+
email:
|
70
61
|
- marcos@tapajos.me
|
71
62
|
- kmayer@bitwrangler.com
|
72
63
|
executables: []
|
73
|
-
|
74
64
|
extensions: []
|
75
|
-
|
76
65
|
extra_rdoc_files: []
|
77
|
-
|
78
|
-
files:
|
66
|
+
files:
|
79
67
|
- .gitignore
|
80
68
|
- .travis.yml
|
81
69
|
- Gemfile
|
@@ -140,40 +128,28 @@ files:
|
|
140
128
|
- spec/spec_helper.rb
|
141
129
|
homepage: http://github.com/tapajos/highrise
|
142
130
|
licenses: []
|
143
|
-
|
131
|
+
metadata: {}
|
144
132
|
post_install_message:
|
145
133
|
rdoc_options: []
|
146
|
-
|
147
|
-
require_paths:
|
134
|
+
require_paths:
|
148
135
|
- lib
|
149
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
-
none: false
|
160
|
-
requirements:
|
161
|
-
- - ">="
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
hash: 23
|
164
|
-
segments:
|
165
|
-
- 1
|
166
|
-
- 3
|
167
|
-
- 6
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '>='
|
144
|
+
- !ruby/object:Gem::Version
|
168
145
|
version: 1.3.6
|
169
146
|
requirements: []
|
170
|
-
|
171
147
|
rubyforge_project:
|
172
|
-
rubygems_version:
|
148
|
+
rubygems_version: 2.0.0
|
173
149
|
signing_key:
|
174
|
-
specification_version:
|
150
|
+
specification_version: 4
|
175
151
|
summary: Ruby wrapper around Highrise API
|
176
|
-
test_files:
|
152
|
+
test_files:
|
177
153
|
- examples/config_initializers_highrise.rb
|
178
154
|
- examples/extending.rb
|
179
155
|
- examples/sample.rb
|