gauges 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +9 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +7 -0
- data/examples/clients.rb +9 -0
- data/examples/content.rb +19 -0
- data/examples/gauges.rb +38 -0
- data/gauges.gemspec +21 -0
- data/lib/gauges.rb +133 -0
- data/lib/gauges/version.rb +3 -0
- data/spec/fixtures/client_create +5 -0
- data/spec/fixtures/client_delete +5 -0
- data/spec/fixtures/clients +5 -0
- data/spec/fixtures/clients_http_auth_failure +5 -0
- data/spec/fixtures/content +5 -0
- data/spec/fixtures/engines +5 -0
- data/spec/fixtures/gauge +5 -0
- data/spec/fixtures/gauge_create_invalid +5 -0
- data/spec/fixtures/gauge_create_valid +7 -0
- data/spec/fixtures/gauge_delete +5 -0
- data/spec/fixtures/gauge_not_found +5 -0
- data/spec/fixtures/gauge_update +5 -0
- data/spec/fixtures/gauges +5 -0
- data/spec/fixtures/locations +5 -0
- data/spec/fixtures/me +5 -0
- data/spec/fixtures/me_update +5 -0
- data/spec/fixtures/referrers +5 -0
- data/spec/fixtures/resolutions +5 -0
- data/spec/fixtures/share_add_invalid +5 -0
- data/spec/fixtures/share_add_valid +5 -0
- data/spec/fixtures/share_remove +5 -0
- data/spec/fixtures/shares +5 -0
- data/spec/fixtures/technology +5 -0
- data/spec/fixtures/terms +5 -0
- data/spec/fixtures/traffic +5 -0
- data/spec/gauges_spec.rb +796 -0
- data/spec/helper.rb +54 -0
- metadata +144 -0
data/spec/helper.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
$:.unshift(File.expand_path('../../lib', __FILE__))
|
2
|
+
|
3
|
+
require 'gauges'
|
4
|
+
|
5
|
+
require 'pathname'
|
6
|
+
require 'logger'
|
7
|
+
|
8
|
+
ProjectRootPath = Pathname(__FILE__).dirname.join('..').expand_path
|
9
|
+
log_path = ProjectRootPath.join('log')
|
10
|
+
log_path.mkpath
|
11
|
+
|
12
|
+
require 'rubygems'
|
13
|
+
require 'bundler'
|
14
|
+
|
15
|
+
Bundler.require(:test)
|
16
|
+
|
17
|
+
Logger.new(log_path.join('test.log')).tap do |log|
|
18
|
+
LogBuddy.init(:logger => log)
|
19
|
+
end
|
20
|
+
|
21
|
+
module FakeRequestHelpers
|
22
|
+
def fixture(name)
|
23
|
+
ProjectRootPath.join('spec', 'fixtures', name.to_s).read
|
24
|
+
end
|
25
|
+
|
26
|
+
def stub_get(url, name)
|
27
|
+
FakeWeb.register_uri(:get, url, :response => fixture(name))
|
28
|
+
end
|
29
|
+
|
30
|
+
def stub_post(url, name)
|
31
|
+
FakeWeb.register_uri(:post, url, :response => fixture(name))
|
32
|
+
end
|
33
|
+
|
34
|
+
def stub_put(url, name)
|
35
|
+
FakeWeb.register_uri(:put, url, :response => fixture(name))
|
36
|
+
end
|
37
|
+
|
38
|
+
def stub_delete(url, name)
|
39
|
+
FakeWeb.register_uri(:delete, url, :response => fixture(name))
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
RSpec.configure do |c|
|
44
|
+
c.include(FakeRequestHelpers)
|
45
|
+
|
46
|
+
c.before(:each) do
|
47
|
+
FakeWeb.clean_registry
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
FakeWeb.allow_net_connect = false
|
52
|
+
|
53
|
+
# Creating fixtures:
|
54
|
+
# curl -is -H "X-Gauges-Token: <token here>" https://secure.gaug.es/gauges/1234 > spec/fixtures/gauge_not_found
|
metadata
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gauges
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- John Nunemaker
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-11-03 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: httparty
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 19
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 7
|
32
|
+
- 8
|
33
|
+
version: 0.7.8
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
description: Simple access to Gaug.es API
|
37
|
+
email:
|
38
|
+
- nunemaker@gmail.com
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files: []
|
44
|
+
|
45
|
+
files:
|
46
|
+
- .gitignore
|
47
|
+
- Gemfile
|
48
|
+
- LICENSE
|
49
|
+
- README.rdoc
|
50
|
+
- Rakefile
|
51
|
+
- examples/clients.rb
|
52
|
+
- examples/content.rb
|
53
|
+
- examples/gauges.rb
|
54
|
+
- gauges.gemspec
|
55
|
+
- lib/gauges.rb
|
56
|
+
- lib/gauges/version.rb
|
57
|
+
- spec/fixtures/client_create
|
58
|
+
- spec/fixtures/client_delete
|
59
|
+
- spec/fixtures/clients
|
60
|
+
- spec/fixtures/clients_http_auth_failure
|
61
|
+
- spec/fixtures/content
|
62
|
+
- spec/fixtures/engines
|
63
|
+
- spec/fixtures/gauge
|
64
|
+
- spec/fixtures/gauge_create_invalid
|
65
|
+
- spec/fixtures/gauge_create_valid
|
66
|
+
- spec/fixtures/gauge_delete
|
67
|
+
- spec/fixtures/gauge_not_found
|
68
|
+
- spec/fixtures/gauge_update
|
69
|
+
- spec/fixtures/gauges
|
70
|
+
- spec/fixtures/locations
|
71
|
+
- spec/fixtures/me
|
72
|
+
- spec/fixtures/me_update
|
73
|
+
- spec/fixtures/referrers
|
74
|
+
- spec/fixtures/resolutions
|
75
|
+
- spec/fixtures/share_add_invalid
|
76
|
+
- spec/fixtures/share_add_valid
|
77
|
+
- spec/fixtures/share_remove
|
78
|
+
- spec/fixtures/shares
|
79
|
+
- spec/fixtures/technology
|
80
|
+
- spec/fixtures/terms
|
81
|
+
- spec/fixtures/traffic
|
82
|
+
- spec/gauges_spec.rb
|
83
|
+
- spec/helper.rb
|
84
|
+
homepage: ""
|
85
|
+
licenses: []
|
86
|
+
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
|
90
|
+
require_paths:
|
91
|
+
- lib
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
hash: 3
|
98
|
+
segments:
|
99
|
+
- 0
|
100
|
+
version: "0"
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 3
|
107
|
+
segments:
|
108
|
+
- 0
|
109
|
+
version: "0"
|
110
|
+
requirements: []
|
111
|
+
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 1.8.9
|
114
|
+
signing_key:
|
115
|
+
specification_version: 3
|
116
|
+
summary: Simple access to Gaug.es API
|
117
|
+
test_files:
|
118
|
+
- spec/fixtures/client_create
|
119
|
+
- spec/fixtures/client_delete
|
120
|
+
- spec/fixtures/clients
|
121
|
+
- spec/fixtures/clients_http_auth_failure
|
122
|
+
- spec/fixtures/content
|
123
|
+
- spec/fixtures/engines
|
124
|
+
- spec/fixtures/gauge
|
125
|
+
- spec/fixtures/gauge_create_invalid
|
126
|
+
- spec/fixtures/gauge_create_valid
|
127
|
+
- spec/fixtures/gauge_delete
|
128
|
+
- spec/fixtures/gauge_not_found
|
129
|
+
- spec/fixtures/gauge_update
|
130
|
+
- spec/fixtures/gauges
|
131
|
+
- spec/fixtures/locations
|
132
|
+
- spec/fixtures/me
|
133
|
+
- spec/fixtures/me_update
|
134
|
+
- spec/fixtures/referrers
|
135
|
+
- spec/fixtures/resolutions
|
136
|
+
- spec/fixtures/share_add_invalid
|
137
|
+
- spec/fixtures/share_add_valid
|
138
|
+
- spec/fixtures/share_remove
|
139
|
+
- spec/fixtures/shares
|
140
|
+
- spec/fixtures/technology
|
141
|
+
- spec/fixtures/terms
|
142
|
+
- spec/fixtures/traffic
|
143
|
+
- spec/gauges_spec.rb
|
144
|
+
- spec/helper.rb
|