tapajos-highrise 0.6 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.mkdn +28 -13
- data/VERSION.yml +4 -0
- data/lib/highrise.rb +12 -0
- data/lib/highrise/company.rb +2 -1
- data/lib/highrise/curlhelper.rb +27 -0
- data/lib/highrise/curly.rb +96 -0
- data/lib/highrise/person.rb +7 -4
- data/lib/highrise/tag.rb +7 -0
- data/lib/highrise/taggable.rb +29 -0
- data/lib/highrise/version.rb +10 -0
- data/spec/highrise/companies/16883216.html +1723 -0
- data/spec/highrise/company_spec.rb +37 -1
- data/spec/highrise/curlhelper_spec.rb +35 -0
- data/spec/highrise/curly_spec.rb +36 -0
- data/spec/highrise/people/16887003.html +1733 -0
- data/spec/highrise/person_spec.rb +36 -1
- data/spec/highrise/tag_spec.rb +21 -0
- data/spec/highrise/version_spec.rb +19 -0
- metadata +38 -14
- data/Rakefile +0 -56
@@ -3,7 +3,12 @@ require File.dirname(__FILE__) + '/../../spec_helper'
|
|
3
3
|
describe Highrise::Person do
|
4
4
|
|
5
5
|
before(:each) do
|
6
|
+
Highrise::Base.site = 'http://example.com.i:3000'
|
6
7
|
@person = Highrise::Person.new
|
8
|
+
returning @tags = [] do
|
9
|
+
@tags << Highrise::Tag.new(:id => "414578", :name => "cliente")
|
10
|
+
@tags << Highrise::Tag.new(:id => "414587", :name => "walk")
|
11
|
+
end
|
7
12
|
end
|
8
13
|
|
9
14
|
it "should be instance of Highrise::Subject" do
|
@@ -14,7 +19,7 @@ describe Highrise::Person do
|
|
14
19
|
|
15
20
|
it "should delegate to find_all_across_pages with correct params" do
|
16
21
|
time = Time.parse("Wed Jan 14 15:43:11 -0200 2009")
|
17
|
-
Highrise::Person.should_receive(:find_all_across_pages).with({:params=>{:since=>"
|
22
|
+
Highrise::Person.should_receive(:find_all_across_pages).with({:params=>{:since=>"20090114174311"}}).and_return("result")
|
18
23
|
Highrise::Person.find_all_across_pages_since(time).should == "result"
|
19
24
|
end
|
20
25
|
|
@@ -45,4 +50,34 @@ describe Highrise::Person do
|
|
45
50
|
|
46
51
|
end
|
47
52
|
|
53
|
+
describe ".tags" do
|
54
|
+
|
55
|
+
it "should return an array of all tags for that user." do
|
56
|
+
file_path = File.dirname(__FILE__) + "/people/16887003.html"
|
57
|
+
@person.stub!(:get_document).and_return(Hpricot(File.open(file_path,"r"){|f| f.read}))
|
58
|
+
@person.tags.should == @tags
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "tag!(tag_name)" do
|
64
|
+
|
65
|
+
it "should create a tag for this user." do
|
66
|
+
@person.should_receive(:post).with(:tags, :name => "Forum_User" ).at_least(1).times.and_return(true)
|
67
|
+
@person.tag!("Forum_User").should be_true
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "untag!(tag_name)" do
|
73
|
+
|
74
|
+
it "should delete a tag for this user." do
|
75
|
+
file_path = File.dirname(__FILE__) + "/people/16887003.html"
|
76
|
+
@person.stub!(:get_document).and_return(Hpricot(File.open(file_path,"r"){|f| f.read}))
|
77
|
+
@person.should_receive(:delete).with("tags/414578").at_least(1).times.and_return(true)
|
78
|
+
@person.untag!("cliente").should be_true
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
48
83
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe Highrise::Tag do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
Highrise::Base.site = 'http://example.com.i/'
|
7
|
+
@tag = Highrise::Tag.new
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should be instance of Highrise::Base" do
|
11
|
+
@tag.kind_of?(Highrise::Base).should be_true
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should support equality" do
|
15
|
+
@tag.id = 1
|
16
|
+
@tag.name = "Name"
|
17
|
+
|
18
|
+
tag = Highrise::Tag.new(:id => 1, :name => "Name")
|
19
|
+
@tag.should == tag
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe Highrise::VERSION do
|
4
|
+
it "should return a version string" do
|
5
|
+
Highrise::VERSION::STRING.should =~ /\d+\.\d+\.\d+/
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should return a MAJOR version" do
|
9
|
+
Highrise::VERSION::MAJOR.class.should be(0.class)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should return a MINOR version" do
|
13
|
+
Highrise::VERSION::MINOR.class.should be(0.class)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should return a TINY version" do
|
17
|
+
Highrise::VERSION::TINY.class.should be(0.class)
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,33 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapajos-highrise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Marcos Tapaj\xC3\xB3s"
|
8
|
-
|
8
|
+
- Ken Mayer
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
12
|
|
12
|
-
date: 2009-01
|
13
|
+
date: 2009-05-01 00:00:00 -07:00
|
13
14
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: activeresource
|
18
|
+
type: :runtime
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "2.2"
|
25
|
+
version:
|
26
|
+
description: "Based on the original API module from DHH, http://developer.37signals.com/highrise/, this gem is a cleaned up, tested version of the same. Contributors have added support for tags which are not supported by the API directly Configure by adding the following: require 'highrise' Highrise::Base.site = 'http://your_site.highrisehq.com/' Highrise::Base.user = 'your_api_auth_token'q"
|
27
|
+
email: kmayer@bitwrangler.com
|
18
28
|
executables: []
|
19
29
|
|
20
30
|
extensions: []
|
21
31
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
32
|
+
extra_rdoc_files: []
|
33
|
+
|
24
34
|
files:
|
25
35
|
- README.mkdn
|
26
|
-
-
|
36
|
+
- VERSION.yml
|
27
37
|
- lib/highrise
|
28
38
|
- lib/highrise/base.rb
|
29
39
|
- lib/highrise/comment.rb
|
30
40
|
- lib/highrise/company.rb
|
41
|
+
- lib/highrise/curlhelper.rb
|
42
|
+
- lib/highrise/curly.rb
|
31
43
|
- lib/highrise/email.rb
|
32
44
|
- lib/highrise/group.rb
|
33
45
|
- lib/highrise/kase.rb
|
@@ -36,28 +48,40 @@ files:
|
|
36
48
|
- lib/highrise/pagination.rb
|
37
49
|
- lib/highrise/person.rb
|
38
50
|
- lib/highrise/subject.rb
|
51
|
+
- lib/highrise/tag.rb
|
52
|
+
- lib/highrise/taggable.rb
|
39
53
|
- lib/highrise/task.rb
|
40
54
|
- lib/highrise/user.rb
|
55
|
+
- lib/highrise/version.rb
|
41
56
|
- lib/highrise.rb
|
42
57
|
- spec/highrise
|
43
58
|
- spec/highrise/base_spec.rb
|
44
59
|
- spec/highrise/comment_spec.rb
|
60
|
+
- spec/highrise/companies
|
61
|
+
- spec/highrise/companies/16883216.html
|
45
62
|
- spec/highrise/company_spec.rb
|
63
|
+
- spec/highrise/curlhelper_spec.rb
|
64
|
+
- spec/highrise/curly_spec.rb
|
46
65
|
- spec/highrise/email_spec.rb
|
47
66
|
- spec/highrise/group_spec.rb
|
48
67
|
- spec/highrise/kase_spec.rb
|
49
68
|
- spec/highrise/membership_spec.rb
|
50
69
|
- spec/highrise/note_spec.rb
|
51
70
|
- spec/highrise/pagination_spec.rb
|
71
|
+
- spec/highrise/people
|
72
|
+
- spec/highrise/people/16887003.html
|
52
73
|
- spec/highrise/person_spec.rb
|
53
74
|
- spec/highrise/subject_spec.rb
|
75
|
+
- spec/highrise/tag_spec.rb
|
54
76
|
- spec/highrise/task_spec.rb
|
55
77
|
- spec/highrise/user_spec.rb
|
78
|
+
- spec/highrise/version_spec.rb
|
56
79
|
has_rdoc: true
|
57
|
-
homepage: http://
|
80
|
+
homepage: http://github.com/kmayer/highrise
|
58
81
|
post_install_message:
|
59
|
-
rdoc_options:
|
60
|
-
|
82
|
+
rdoc_options:
|
83
|
+
- --inline-source
|
84
|
+
- --charset=UTF-8
|
61
85
|
require_paths:
|
62
86
|
- lib
|
63
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -78,6 +102,6 @@ rubyforge_project:
|
|
78
102
|
rubygems_version: 1.2.0
|
79
103
|
signing_key:
|
80
104
|
specification_version: 2
|
81
|
-
summary:
|
105
|
+
summary: Ruby wrapper around Highrise API
|
82
106
|
test_files: []
|
83
107
|
|
data/Rakefile
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rubygems'
|
3
|
-
require 'rake/rdoctask'
|
4
|
-
require 'rake/testtask'
|
5
|
-
require 'spec/rake/spectask'
|
6
|
-
require "date"
|
7
|
-
require "fileutils"
|
8
|
-
require "rubygems"
|
9
|
-
require "rake/gempackagetask"
|
10
|
-
|
11
|
-
VERSION = "0.6"
|
12
|
-
|
13
|
-
highrise_gemspec = Gem::Specification.new do |s|
|
14
|
-
s.name = "highrise"
|
15
|
-
s.version = VERSION
|
16
|
-
s.platform = Gem::Platform::RUBY
|
17
|
-
s.has_rdoc = true
|
18
|
-
s.extra_rdoc_files = ["README.mkdn"]
|
19
|
-
s.summary = "Find awesome stuff"
|
20
|
-
s.description = s.summary
|
21
|
-
s.authors = ["Marcos Tapajós"]
|
22
|
-
s.email = "tapajos@improveit.com.br"
|
23
|
-
s.homepage = "http://www.improveit.com.br/en/company/tapajos"
|
24
|
-
s.require_path = "lib"
|
25
|
-
s.autorequire = "highrise"
|
26
|
-
s.files = %w(README.mkdn Rakefile) + Dir.glob("{bin,lib,spec}/**/*")
|
27
|
-
end
|
28
|
-
|
29
|
-
Rake::GemPackageTask.new(highrise_gemspec) do |pkg|
|
30
|
-
pkg.gem_spec = highrise_gemspec
|
31
|
-
end
|
32
|
-
|
33
|
-
namespace :gem do
|
34
|
-
namespace :spec do
|
35
|
-
desc "Update highrise.gemspec"
|
36
|
-
task :generate do
|
37
|
-
File.open("highrise.gemspec", "w") do |f|
|
38
|
-
f.puts(highrise_gemspec.to_ruby)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
desc "Instal gem"
|
45
|
-
task :install => :package do
|
46
|
-
sh %{sudo gem install --local pkg/highrise-#{VERSION}}
|
47
|
-
end
|
48
|
-
|
49
|
-
desc 'Default: run unit tests.'
|
50
|
-
task :default => :spec
|
51
|
-
|
52
|
-
desc "Run all specs"
|
53
|
-
Spec::Rake::SpecTask.new do |t|
|
54
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
55
|
-
t.spec_opts = ['--options', 'spec.opts']
|
56
|
-
end
|