ketchup 1.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.
- data/LICENCE +20 -0
- data/README.textile +123 -0
- data/lib/ketchup.rb +36 -0
- data/lib/ketchup/api.rb +80 -0
- data/lib/ketchup/item.rb +75 -0
- data/lib/ketchup/item_array.rb +85 -0
- data/lib/ketchup/meeting.rb +96 -0
- data/lib/ketchup/meeting_array.rb +92 -0
- data/lib/ketchup/note.rb +73 -0
- data/lib/ketchup/note_array.rb +85 -0
- data/lib/ketchup/profile.rb +125 -0
- data/lib/ketchup/project.rb +51 -0
- data/spec/ketchup/api_spec.rb +120 -0
- data/spec/ketchup/item_array_spec.rb +125 -0
- data/spec/ketchup/item_spec.rb +127 -0
- data/spec/ketchup/meeting_array_spec.rb +141 -0
- data/spec/ketchup/meeting_spec.rb +142 -0
- data/spec/ketchup/note_array_spec.rb +125 -0
- data/spec/ketchup/note_spec.rb +126 -0
- data/spec/ketchup/profile_spec.rb +148 -0
- data/spec/ketchup/project_spec.rb +75 -0
- data/spec/ketchup_spec.rb +20 -0
- data/spec/spec_helper.rb +30 -0
- metadata +116 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'spec/spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Ketchup do
|
|
4
|
+
describe '.authenticate' do
|
|
5
|
+
it "should return a new Profile object on success" do
|
|
6
|
+
Ketchup::API.stub!(:new => stub('api', :get => {}))
|
|
7
|
+
|
|
8
|
+
Ketchup.authenticate('user@domain.com', 'secret').
|
|
9
|
+
should be_a(Ketchup::Profile)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "should raise an exception on failure" do
|
|
13
|
+
Ketchup::API.stub!(:new).and_raise(Ketchup::AccessDenied)
|
|
14
|
+
|
|
15
|
+
lambda {
|
|
16
|
+
Ketchup.authenticate('user@domain.com', 'secret')
|
|
17
|
+
}.should raise_error(Ketchup::AccessDenied)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
3
|
+
|
|
4
|
+
require 'ketchup'
|
|
5
|
+
require 'fakeweb'
|
|
6
|
+
require 'spec'
|
|
7
|
+
require 'spec/autorun'
|
|
8
|
+
|
|
9
|
+
FakeWeb.allow_net_connect = false
|
|
10
|
+
KetchupAPI = 'useketchup.com/api/v1'
|
|
11
|
+
|
|
12
|
+
Spec::Runner.configure do |config|
|
|
13
|
+
#
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def stub_initial_api_request
|
|
17
|
+
FakeWeb.register_uri :get, /#{KetchupAPI}\/profile.json$/,
|
|
18
|
+
:response => %Q{HTTP/1.1 200 OK
|
|
19
|
+
Content-Type: application/json; charset=utf-8
|
|
20
|
+
Connection: keep-alive
|
|
21
|
+
Status: 200
|
|
22
|
+
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.5
|
|
23
|
+
X-Runtime: 106
|
|
24
|
+
ETag: "8d17ca017c14f427baabbd7881b7d82d"
|
|
25
|
+
Cache-Control: private, max-age=0, must-revalidate
|
|
26
|
+
Content-Length: 122
|
|
27
|
+
Server: nginx/0.6.35 + Phusion Passenger 2.2.5 (mod_rails/mod_rack)
|
|
28
|
+
|
|
29
|
+
{"name":"Ruby","timezone":"Melbourne","single_access_token":"y3chHxh9Qk1Drkg1j0Bw","email":"ketchup@freelancing-gods.com"}}
|
|
30
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ketchup
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Pat Allan
|
|
8
|
+
- Paul Campbell
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
|
|
13
|
+
date: 2010-02-15 00:00:00 +00:00
|
|
14
|
+
default_executable:
|
|
15
|
+
dependencies:
|
|
16
|
+
- !ruby/object:Gem::Dependency
|
|
17
|
+
name: httparty
|
|
18
|
+
type: :runtime
|
|
19
|
+
version_requirement:
|
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
21
|
+
requirements:
|
|
22
|
+
- - "="
|
|
23
|
+
- !ruby/object:Gem::Version
|
|
24
|
+
version: 0.5.2
|
|
25
|
+
version:
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rspec
|
|
28
|
+
type: :development
|
|
29
|
+
version_requirement:
|
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
31
|
+
requirements:
|
|
32
|
+
- - ">="
|
|
33
|
+
- !ruby/object:Gem::Version
|
|
34
|
+
version: 1.2.9
|
|
35
|
+
version:
|
|
36
|
+
- !ruby/object:Gem::Dependency
|
|
37
|
+
name: yard
|
|
38
|
+
type: :development
|
|
39
|
+
version_requirement:
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
requirements:
|
|
42
|
+
- - ">="
|
|
43
|
+
- !ruby/object:Gem::Version
|
|
44
|
+
version: 0.5.3
|
|
45
|
+
version:
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: fakeweb
|
|
48
|
+
type: :development
|
|
49
|
+
version_requirement:
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 1.2.8
|
|
55
|
+
version:
|
|
56
|
+
description: A Ruby interface to the API for Ketchup
|
|
57
|
+
email: paul@rushedsunlight.com
|
|
58
|
+
executables: []
|
|
59
|
+
|
|
60
|
+
extensions: []
|
|
61
|
+
|
|
62
|
+
extra_rdoc_files:
|
|
63
|
+
- README.textile
|
|
64
|
+
files:
|
|
65
|
+
- LICENCE
|
|
66
|
+
- README.textile
|
|
67
|
+
- lib/ketchup.rb
|
|
68
|
+
- lib/ketchup/api.rb
|
|
69
|
+
- lib/ketchup/item.rb
|
|
70
|
+
- lib/ketchup/item_array.rb
|
|
71
|
+
- lib/ketchup/meeting.rb
|
|
72
|
+
- lib/ketchup/meeting_array.rb
|
|
73
|
+
- lib/ketchup/note.rb
|
|
74
|
+
- lib/ketchup/note_array.rb
|
|
75
|
+
- lib/ketchup/profile.rb
|
|
76
|
+
- lib/ketchup/project.rb
|
|
77
|
+
has_rdoc: true
|
|
78
|
+
homepage: http://github.com/hypertiny/ketchup
|
|
79
|
+
licenses: []
|
|
80
|
+
|
|
81
|
+
post_install_message:
|
|
82
|
+
rdoc_options:
|
|
83
|
+
- --charset=UTF-8
|
|
84
|
+
require_paths:
|
|
85
|
+
- lib
|
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
- - ">="
|
|
89
|
+
- !ruby/object:Gem::Version
|
|
90
|
+
version: "0"
|
|
91
|
+
version:
|
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: "0"
|
|
97
|
+
version:
|
|
98
|
+
requirements: []
|
|
99
|
+
|
|
100
|
+
rubyforge_project:
|
|
101
|
+
rubygems_version: 1.3.5
|
|
102
|
+
signing_key:
|
|
103
|
+
specification_version: 3
|
|
104
|
+
summary: A place for all your meeting notes
|
|
105
|
+
test_files:
|
|
106
|
+
- spec/ketchup/api_spec.rb
|
|
107
|
+
- spec/ketchup/item_array_spec.rb
|
|
108
|
+
- spec/ketchup/item_spec.rb
|
|
109
|
+
- spec/ketchup/meeting_array_spec.rb
|
|
110
|
+
- spec/ketchup/meeting_spec.rb
|
|
111
|
+
- spec/ketchup/note_array_spec.rb
|
|
112
|
+
- spec/ketchup/note_spec.rb
|
|
113
|
+
- spec/ketchup/profile_spec.rb
|
|
114
|
+
- spec/ketchup/project_spec.rb
|
|
115
|
+
- spec/ketchup_spec.rb
|
|
116
|
+
- spec/spec_helper.rb
|