fluidinfo 0.4.1 → 0.5.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/.rspec +1 -0
- data/Gemfile +8 -11
- data/Gemfile.lock +22 -13
- data/Rakefile +7 -22
- data/VERSION +1 -1
- data/fluidinfo.gemspec +33 -32
- data/lib/fluidinfo/client.rb +182 -0
- data/lib/fluidinfo/response.rb +24 -0
- data/lib/fluidinfo.rb +2 -189
- data/{test/test_fluidinfo.rb → spec/fluidinfo_spec.rb} +101 -80
- metadata +48 -39
- data/test/helper.rb +0 -18
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
|
-
gem "rest-client", ">= 1.6.1"
|
6
|
-
gem "yajl-ruby", ">= 0.8.2"
|
7
2
|
|
8
|
-
|
9
|
-
|
3
|
+
gem "rest-client", "~> 1.6.7"
|
4
|
+
gem "yajl-ruby", "~> 1.0.0"
|
5
|
+
|
10
6
|
group :development do
|
11
|
-
gem "
|
7
|
+
gem "rake", "~> 0.9.2"
|
8
|
+
gem "rspec", "~> 2.6.0"
|
12
9
|
gem "bundler", "~> 1.0.0"
|
13
|
-
gem "jeweler", "~> 1.
|
14
|
-
gem "
|
15
|
-
gem "
|
10
|
+
gem "jeweler", "~> 1.6.4"
|
11
|
+
gem "uuidtools", "~> 2.1.2"
|
12
|
+
gem "yard", "~> 0.7.2"
|
16
13
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,28 +1,37 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
diff-lcs (1.1.3)
|
4
5
|
git (1.2.5)
|
5
|
-
jeweler (1.
|
6
|
-
bundler (~> 1.0
|
6
|
+
jeweler (1.6.4)
|
7
|
+
bundler (~> 1.0)
|
7
8
|
git (>= 1.2.5)
|
8
9
|
rake
|
9
10
|
mime-types (1.16)
|
10
|
-
rake (0.
|
11
|
-
|
12
|
-
rest-client (1.6.1)
|
11
|
+
rake (0.9.2)
|
12
|
+
rest-client (1.6.7)
|
13
13
|
mime-types (>= 1.16)
|
14
|
-
|
14
|
+
rspec (2.6.0)
|
15
|
+
rspec-core (~> 2.6.0)
|
16
|
+
rspec-expectations (~> 2.6.0)
|
17
|
+
rspec-mocks (~> 2.6.0)
|
18
|
+
rspec-core (2.6.4)
|
19
|
+
rspec-expectations (2.6.0)
|
20
|
+
diff-lcs (~> 1.1.2)
|
21
|
+
rspec-mocks (2.6.0)
|
15
22
|
uuidtools (2.1.2)
|
16
|
-
yajl-ruby (0.
|
23
|
+
yajl-ruby (1.0.0)
|
24
|
+
yard (0.7.2)
|
17
25
|
|
18
26
|
PLATFORMS
|
19
27
|
ruby
|
20
28
|
|
21
29
|
DEPENDENCIES
|
22
30
|
bundler (~> 1.0.0)
|
23
|
-
jeweler (~> 1.
|
24
|
-
|
25
|
-
rest-client (
|
26
|
-
|
27
|
-
uuidtools (
|
28
|
-
yajl-ruby (
|
31
|
+
jeweler (~> 1.6.4)
|
32
|
+
rake (~> 0.9.2)
|
33
|
+
rest-client (~> 1.6.7)
|
34
|
+
rspec (~> 2.6.0)
|
35
|
+
uuidtools (~> 2.1.2)
|
36
|
+
yajl-ruby (~> 1.0.0)
|
37
|
+
yard (~> 0.7.2)
|
data/Rakefile
CHANGED
@@ -26,28 +26,13 @@ Jeweler::Tasks.new do |gem|
|
|
26
26
|
end
|
27
27
|
Jeweler::RubygemsDotOrgTasks.new
|
28
28
|
|
29
|
-
require '
|
30
|
-
|
31
|
-
test.libs << 'lib' << 'test'
|
32
|
-
test.pattern = 'test/**/test_*.rb'
|
33
|
-
test.verbose = true
|
34
|
-
end
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec)
|
35
31
|
|
36
|
-
require '
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
test.verbose = true
|
32
|
+
require 'yard/rake/yardoc_task'
|
33
|
+
YARD::Rake::YardocTask.new do |t|
|
34
|
+
t.files = ['lib/**/*.rb']
|
35
|
+
t.options = ['--any', '--extra', '--opts']
|
41
36
|
end
|
42
37
|
|
43
|
-
task :default => :
|
44
|
-
|
45
|
-
require 'rake/rdoctask'
|
46
|
-
Rake::RDocTask.new do |rdoc|
|
47
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
-
|
49
|
-
rdoc.rdoc_dir = 'rdoc'
|
50
|
-
rdoc.title = "fluidinfo #{version}"
|
51
|
-
rdoc.rdoc_files.include('README*')
|
52
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
-
end
|
38
|
+
task :default => :spec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/fluidinfo.gemspec
CHANGED
@@ -4,20 +4,21 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.
|
7
|
+
s.name = "fluidinfo"
|
8
|
+
s.version = "0.5.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Eric Seidel"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2011-09-17"
|
13
|
+
s.description = "This gem provides a simple interface to fluidinfo, built on top of the rest-client gem."
|
14
|
+
s.email = "gridaphobe@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
17
|
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
|
+
".rspec",
|
21
22
|
".rvmrc",
|
22
23
|
"Gemfile",
|
23
24
|
"Gemfile.lock",
|
@@ -27,47 +28,47 @@ Gem::Specification.new do |s|
|
|
27
28
|
"VERSION",
|
28
29
|
"fluidinfo.gemspec",
|
29
30
|
"lib/fluidinfo.rb",
|
30
|
-
"
|
31
|
-
"
|
31
|
+
"lib/fluidinfo/client.rb",
|
32
|
+
"lib/fluidinfo/response.rb",
|
33
|
+
"spec/fluidinfo_spec.rb"
|
32
34
|
]
|
33
|
-
s.homepage =
|
35
|
+
s.homepage = "http://github.com/gridaphobe/fluidinfo.rb"
|
34
36
|
s.licenses = ["MIT"]
|
35
37
|
s.require_paths = ["lib"]
|
36
|
-
s.rubygems_version =
|
37
|
-
s.summary =
|
38
|
-
s.test_files = [
|
39
|
-
"test/helper.rb",
|
40
|
-
"test/test_fluidinfo.rb"
|
41
|
-
]
|
38
|
+
s.rubygems_version = "1.8.10"
|
39
|
+
s.summary = "Provides a simple interface to fluidinfo"
|
42
40
|
|
43
41
|
if s.respond_to? :specification_version then
|
44
42
|
s.specification_version = 3
|
45
43
|
|
46
44
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
-
s.add_runtime_dependency(%q<rest-client>, ["
|
48
|
-
s.add_runtime_dependency(%q<yajl-ruby>, ["
|
49
|
-
s.add_development_dependency(%q<
|
45
|
+
s.add_runtime_dependency(%q<rest-client>, ["~> 1.6.7"])
|
46
|
+
s.add_runtime_dependency(%q<yajl-ruby>, ["~> 1.0.0"])
|
47
|
+
s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
|
48
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
|
50
49
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
51
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.
|
52
|
-
s.add_development_dependency(%q<
|
53
|
-
s.add_development_dependency(%q<
|
50
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
51
|
+
s.add_development_dependency(%q<uuidtools>, ["~> 2.1.2"])
|
52
|
+
s.add_development_dependency(%q<yard>, ["~> 0.7.2"])
|
54
53
|
else
|
55
|
-
s.add_dependency(%q<rest-client>, ["
|
56
|
-
s.add_dependency(%q<yajl-ruby>, ["
|
57
|
-
s.add_dependency(%q<
|
54
|
+
s.add_dependency(%q<rest-client>, ["~> 1.6.7"])
|
55
|
+
s.add_dependency(%q<yajl-ruby>, ["~> 1.0.0"])
|
56
|
+
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
57
|
+
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
|
58
58
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
59
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
60
|
-
s.add_dependency(%q<
|
61
|
-
s.add_dependency(%q<
|
59
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
60
|
+
s.add_dependency(%q<uuidtools>, ["~> 2.1.2"])
|
61
|
+
s.add_dependency(%q<yard>, ["~> 0.7.2"])
|
62
62
|
end
|
63
63
|
else
|
64
|
-
s.add_dependency(%q<rest-client>, ["
|
65
|
-
s.add_dependency(%q<yajl-ruby>, ["
|
66
|
-
s.add_dependency(%q<
|
64
|
+
s.add_dependency(%q<rest-client>, ["~> 1.6.7"])
|
65
|
+
s.add_dependency(%q<yajl-ruby>, ["~> 1.0.0"])
|
66
|
+
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
67
|
+
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
|
67
68
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
68
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
69
|
-
s.add_dependency(%q<
|
70
|
-
s.add_dependency(%q<
|
69
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
70
|
+
s.add_dependency(%q<uuidtools>, ["~> 2.1.2"])
|
71
|
+
s.add_dependency(%q<yard>, ["~> 0.7.2"])
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
@@ -0,0 +1,182 @@
|
|
1
|
+
require "rest-client"
|
2
|
+
require "cgi"
|
3
|
+
require "yajl"
|
4
|
+
require "base64"
|
5
|
+
require "set"
|
6
|
+
|
7
|
+
module Fluidinfo
|
8
|
+
ITERABLE_TYPES = Set.new [Array]
|
9
|
+
SERIALIZEABLE_TYPES = Set.new [NilClass, String, Fixnum, Float, Symbol,
|
10
|
+
TrueClass, FalseClass, Array]
|
11
|
+
JSON_TYPES = Set.new ["application/json",
|
12
|
+
"application/vnd.fluiddb.value+json"]
|
13
|
+
|
14
|
+
class Client
|
15
|
+
# The main fluidinfo instance.
|
16
|
+
MAIN = 'https://fluiddb.fluidinfo.com'
|
17
|
+
# The sandbox instance, test your code here.
|
18
|
+
SANDBOX = 'https://sandbox.fluidinfo.com'
|
19
|
+
|
20
|
+
def initialize(instance=:main)
|
21
|
+
if instance == :sandbox
|
22
|
+
@instance = SANDBOX
|
23
|
+
else
|
24
|
+
@instance = MAIN
|
25
|
+
end
|
26
|
+
@headers = {
|
27
|
+
:accept => "*/*",
|
28
|
+
:user_agent => "fluidinfo.rb/#{Fluidinfo.version}"
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
def login(user, pass)
|
33
|
+
@headers[:authorization] = "Basic " +
|
34
|
+
(Base64.encode64 "#{user}:#{pass}").strip
|
35
|
+
end
|
36
|
+
|
37
|
+
def logout
|
38
|
+
@headers.delete :authorization
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Call GET on one of the APIs
|
43
|
+
#
|
44
|
+
# +options+ contains URI arguments that will be appended to +path+
|
45
|
+
# consult the {Fluidinfo API documentation}[api.fluidinfo.com] for a list of
|
46
|
+
# appropriate options
|
47
|
+
def get(path, options={})
|
48
|
+
url = build_url path, options
|
49
|
+
Response.new(RestClient.get url, @headers)
|
50
|
+
end
|
51
|
+
|
52
|
+
##
|
53
|
+
# Call HEAD on the /about or /object API to test for the existence
|
54
|
+
# of a tag
|
55
|
+
def head(path)
|
56
|
+
path = @instance + path
|
57
|
+
Response.new(RestClient.head path, @headers)
|
58
|
+
end
|
59
|
+
|
60
|
+
##
|
61
|
+
# Call POST on one of the APIs
|
62
|
+
#
|
63
|
+
# +options[:body]+ contains the request payload. For some API
|
64
|
+
# calls this may be empty.
|
65
|
+
def post(path, options={})
|
66
|
+
path = @instance + path
|
67
|
+
if options[:body]
|
68
|
+
payload = build_payload options
|
69
|
+
headers = @headers.merge :content_type => payload[:mime]
|
70
|
+
Response.new(RestClient.post path, payload[:body], headers)
|
71
|
+
else
|
72
|
+
Response.new(RestClient.post path, nil, @headers)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Call PUT on one of the APIs
|
78
|
+
#
|
79
|
+
# +options[:body]+ contains the request payload.
|
80
|
+
#
|
81
|
+
# +options[:mime]+ contains the MIME-type unless the payload is
|
82
|
+
# JSON-encodable
|
83
|
+
def put(path, options={})
|
84
|
+
url = build_url path, options
|
85
|
+
payload = build_payload options
|
86
|
+
headers = @headers.merge(:content_type => payload[:mime],
|
87
|
+
:content_length => payload[:size])
|
88
|
+
Response.new(RestClient.put url, payload[:body], headers)
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# Call DELETE on one of the APIs
|
93
|
+
#
|
94
|
+
# +options+ contains URI arguments that will be appended to +path+
|
95
|
+
# consult the {Fluidinfo API documentation}[api.fluidinfo.com] for a list
|
96
|
+
# of appropriate options
|
97
|
+
def delete(path, options={})
|
98
|
+
url = build_url path, options
|
99
|
+
# nothing returned in response body for DELETE
|
100
|
+
Response.new(RestClient.delete url, @headers)
|
101
|
+
end
|
102
|
+
|
103
|
+
private
|
104
|
+
##
|
105
|
+
# Build a url from the given path and url args
|
106
|
+
def build_url(path, options={})
|
107
|
+
opts = options.reject do |key, val|
|
108
|
+
[:body, :mime].include? key
|
109
|
+
end
|
110
|
+
args = opts.inject([]) do |arr, (key, val)|
|
111
|
+
if key == :tags
|
112
|
+
# dealing with tag list
|
113
|
+
val.each do |tag|
|
114
|
+
arr << "tag=#{tag}"
|
115
|
+
end
|
116
|
+
else
|
117
|
+
arr << "#{key}=#{CGI.escape val.to_s}"
|
118
|
+
end
|
119
|
+
arr
|
120
|
+
end.join('&')
|
121
|
+
# fix for /about API
|
122
|
+
if path.start_with? '/about/'
|
123
|
+
path = path.split("/").map{|x| CGI.escape x}.join("/")
|
124
|
+
end
|
125
|
+
if args != ''
|
126
|
+
"#{@instance}#{path}?#{args}"
|
127
|
+
else
|
128
|
+
"#{@instance}#{path}"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# Build the payload from the options hash
|
134
|
+
def build_payload(options)
|
135
|
+
payload = options.reject {|k,v| !([:body, :mime].include? k)}
|
136
|
+
if payload[:mime]
|
137
|
+
# user set mime-type, let them deal with it :)
|
138
|
+
# fix for ruby 1.8
|
139
|
+
if payload[:body].is_a? File
|
140
|
+
payload[:size] = payload[:body].path.size
|
141
|
+
else
|
142
|
+
payload[:size] = payload[:body].size
|
143
|
+
end
|
144
|
+
elsif payload[:body].is_a? Hash
|
145
|
+
payload[:body] = Yajl.dump payload[:body]
|
146
|
+
payload[:mime] = "application/json"
|
147
|
+
elsif SERIALIZEABLE_TYPES.include? payload[:body].class
|
148
|
+
if ITERABLE_TYPES.include? payload[:body].class
|
149
|
+
if is_set_of_strings? payload[:body]
|
150
|
+
# set of strings is primitive
|
151
|
+
payload[:mime] = "application/vnd.fluiddb.value+json"
|
152
|
+
else
|
153
|
+
# we have an Array with some non-String items
|
154
|
+
payload[:mime] = "application/json"
|
155
|
+
end
|
156
|
+
else
|
157
|
+
# primitive type
|
158
|
+
payload[:mime] = "application/vnd.fluiddb.value+json"
|
159
|
+
end
|
160
|
+
payload[:body] = Yajl.dump payload[:body]
|
161
|
+
else
|
162
|
+
raise TypeError, "You must supply the mime-type"
|
163
|
+
end
|
164
|
+
payload
|
165
|
+
end
|
166
|
+
|
167
|
+
##
|
168
|
+
# Check if payload is a "set of strings"
|
169
|
+
def is_set_of_strings?(list)
|
170
|
+
# are all elements unique strings?
|
171
|
+
list.all? { |x| x.is_a? String } && list == list.uniq
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def self.version
|
176
|
+
# This was borrowed from the rest-client gem :)
|
177
|
+
version_path = File.dirname(__FILE__) + "/../../VERSION"
|
178
|
+
return File.read(version_path).chomp if File.file?(version_path)
|
179
|
+
"0.0.0"
|
180
|
+
end
|
181
|
+
|
182
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "yajl"
|
2
|
+
|
3
|
+
module Fluidinfo
|
4
|
+
class Response
|
5
|
+
attr_reader :status, :headers, :content, :value, :response
|
6
|
+
|
7
|
+
def initialize(response)
|
8
|
+
@response = response
|
9
|
+
@status = response.code
|
10
|
+
@headers = response.headers
|
11
|
+
@content = response.body
|
12
|
+
@value = if JSON_TYPES.include? @headers[:content_type]
|
13
|
+
Yajl.load @content
|
14
|
+
else
|
15
|
+
@content
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def [](key)
|
20
|
+
@value[key]
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
data/lib/fluidinfo.rb
CHANGED
@@ -1,189 +1,2 @@
|
|
1
|
-
require "
|
2
|
-
require "
|
3
|
-
require "cgi"
|
4
|
-
require "yajl/json_gem"
|
5
|
-
require "base64"
|
6
|
-
require "set"
|
7
|
-
|
8
|
-
module Fluidinfo
|
9
|
-
ITERABLE_TYPES = Set.new [Array]
|
10
|
-
SERIALIZEABLE_TYPES = Set.new [NilClass, String, Fixnum, Float, Symbol,
|
11
|
-
TrueClass, FalseClass, Array]
|
12
|
-
JSON_TYPES = Set.new ["application/json",
|
13
|
-
"application/vnd.fluiddb.value+json"]
|
14
|
-
|
15
|
-
class Client
|
16
|
-
# The main fluidinfo instance.
|
17
|
-
MAIN = 'https://fluiddb.fluidinfo.com'
|
18
|
-
# The sandbox instance, test your code here.
|
19
|
-
SANDBOX = 'https://sandbox.fluidinfo.com'
|
20
|
-
|
21
|
-
def initialize(instance=:main)
|
22
|
-
if instance == :sandbox
|
23
|
-
@instance = SANDBOX
|
24
|
-
else
|
25
|
-
@instance = MAIN
|
26
|
-
end
|
27
|
-
@headers = {
|
28
|
-
:accept => "*/*",
|
29
|
-
:user_agent => "fluidinfo.rb/#{Fluidinfo.version}"
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
def login(user, pass)
|
34
|
-
@headers[:authorization] = "Basic " +
|
35
|
-
(Base64.encode64 "#{user}:#{pass}").strip
|
36
|
-
end
|
37
|
-
|
38
|
-
def logout
|
39
|
-
@headers.delete :authorization
|
40
|
-
end
|
41
|
-
|
42
|
-
##
|
43
|
-
# Call GET on one of the APIs
|
44
|
-
#
|
45
|
-
# +options+ contains URI arguments that will be appended to +path+
|
46
|
-
# consult the {Fluidinfo API documentation}[api.fluidinfo.com] for a list of
|
47
|
-
# appropriate options
|
48
|
-
def get(path, options={})
|
49
|
-
url = build_url path, options
|
50
|
-
response = RestClient.get url, @headers
|
51
|
-
if JSON_TYPES.include? response.headers[:content_type]
|
52
|
-
JSON.parse response
|
53
|
-
else
|
54
|
-
response
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
##
|
59
|
-
# Call HEAD on the /about or /object API to test for the existence
|
60
|
-
# of a tag
|
61
|
-
def head(path)
|
62
|
-
path = @instance + path
|
63
|
-
RestClient.head path, @headers
|
64
|
-
end
|
65
|
-
|
66
|
-
##
|
67
|
-
# Call POST on one of the APIs
|
68
|
-
#
|
69
|
-
# +options[:body]+ contains the request payload. For some API
|
70
|
-
# calls this may be empty.
|
71
|
-
def post(path, options={})
|
72
|
-
path = @instance + path
|
73
|
-
if options[:body]
|
74
|
-
payload = build_payload options
|
75
|
-
headers = @headers.merge :content_type => payload[:mime]
|
76
|
-
JSON.parse(RestClient.post path, payload[:body], headers)
|
77
|
-
else
|
78
|
-
JSON.parse(RestClient.post path, nil, @headers)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
##
|
83
|
-
# Call PUT on one of the APIs
|
84
|
-
#
|
85
|
-
# +options[:body]+ contains the request payload.
|
86
|
-
#
|
87
|
-
# +options[:mime]+ contains the MIME-type unless the payload is
|
88
|
-
# JSON-encodable
|
89
|
-
def put(path, options={})
|
90
|
-
url = build_url path, options
|
91
|
-
payload = build_payload options
|
92
|
-
headers = @headers.merge(:content_type => payload[:mime],
|
93
|
-
:content_length => payload[:size])
|
94
|
-
RestClient.put url, payload[:body], headers
|
95
|
-
end
|
96
|
-
|
97
|
-
##
|
98
|
-
# Call DELETE on one of the APIs
|
99
|
-
#
|
100
|
-
# +options+ contains URI arguments that will be appended to +path+
|
101
|
-
# consult the {Fluidinfo API documentation}[api.fluidinfo.com] for a list
|
102
|
-
# of appropriate options
|
103
|
-
def delete(path, options={})
|
104
|
-
url = build_url path, options
|
105
|
-
# nothing returned in response body for DELETE
|
106
|
-
RestClient.delete url, @headers
|
107
|
-
end
|
108
|
-
|
109
|
-
private
|
110
|
-
##
|
111
|
-
# Build a url from the given path and url args
|
112
|
-
def build_url(path, options={})
|
113
|
-
opts = options.reject do |key, val|
|
114
|
-
[:body, :mime].include? key
|
115
|
-
end
|
116
|
-
args = opts.inject([]) do |arr, (key, val)|
|
117
|
-
if key == :tags
|
118
|
-
# dealing with tag list
|
119
|
-
val.each do |tag|
|
120
|
-
arr << "tag=#{tag}"
|
121
|
-
end
|
122
|
-
else
|
123
|
-
arr << "#{key}=#{CGI.escape val.to_s}"
|
124
|
-
end
|
125
|
-
arr
|
126
|
-
end.join('&')
|
127
|
-
# fix for /about API
|
128
|
-
if path.start_with? '/about/'
|
129
|
-
about = path[7..-1]
|
130
|
-
path = "/about/#{CGI.escape about}"
|
131
|
-
end
|
132
|
-
if args != ''
|
133
|
-
"#{@instance}#{path}?#{args}"
|
134
|
-
else
|
135
|
-
"#{@instance}#{path}"
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
##
|
140
|
-
# Build the payload from the options hash
|
141
|
-
def build_payload(options)
|
142
|
-
payload = options.reject {|k,v| !([:body, :mime].include? k)}
|
143
|
-
if payload[:mime]
|
144
|
-
# user set mime-type, let them deal with it :)
|
145
|
-
# fix for ruby 1.8
|
146
|
-
if payload[:body].is_a? File
|
147
|
-
payload[:size] = payload[:body].path.size
|
148
|
-
else
|
149
|
-
payload[:size] = payload[:body].size
|
150
|
-
end
|
151
|
-
elsif payload[:body].is_a? Hash
|
152
|
-
payload[:body] = JSON.dump payload[:body]
|
153
|
-
payload[:mime] = "application/json"
|
154
|
-
elsif SERIALIZEABLE_TYPES.include? payload[:body].class
|
155
|
-
if ITERABLE_TYPES.include? payload[:body].class
|
156
|
-
if is_set_of_strings? payload[:body]
|
157
|
-
# set of strings is primitive
|
158
|
-
payload[:mime] = "application/vnd.fluiddb.value+json"
|
159
|
-
else
|
160
|
-
# we have an Array with some non-String items
|
161
|
-
payload[:mime] = "application/json"
|
162
|
-
end
|
163
|
-
else
|
164
|
-
# primitive type
|
165
|
-
payload[:mime] = "application/vnd.fluiddb.value+json"
|
166
|
-
end
|
167
|
-
payload[:body] = JSON.dump payload[:body]
|
168
|
-
else
|
169
|
-
raise TypeError, "You must supply the mime-type"
|
170
|
-
end
|
171
|
-
payload
|
172
|
-
end
|
173
|
-
|
174
|
-
##
|
175
|
-
# Check if payload is a "set of strings"
|
176
|
-
def is_set_of_strings?(list)
|
177
|
-
# are all elements unique strings?
|
178
|
-
list.all? { |x| x.is_a? String } && list == list.uniq
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
def self.version
|
183
|
-
# This was borrowed from the rest-client gem :)
|
184
|
-
version_path = File.dirname(__FILE__) + "/../VERSION"
|
185
|
-
return File.read(version_path).chomp if File.file?(version_path)
|
186
|
-
"0.0.0"
|
187
|
-
end
|
188
|
-
|
189
|
-
end
|
1
|
+
require File.join(File.dirname(__FILE__), "/fluidinfo/client")
|
2
|
+
require File.join(File.dirname(__FILE__), "/fluidinfo/response")
|
@@ -1,64 +1,69 @@
|
|
1
|
-
require '
|
1
|
+
require 'fluidinfo'
|
2
2
|
require 'uuidtools'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
describe Fluidinfo do
|
5
|
+
describe "GET" do
|
6
|
+
before(:each) do
|
7
7
|
@fluid = Fluidinfo::Client.new
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
it "should return a Fluidinfo::Response" do
|
11
|
+
r = @fluid.get("/about/fluidinfo")
|
12
|
+
r.should be_a(Fluidinfo::Response)
|
13
|
+
r.should respond_to(:status, :content, :headers, :value, :response)
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "/objects" do
|
17
|
+
it "should retrieve tags correctly" do
|
12
18
|
uid = "e034d8c0-a2e4-4094-895b-3a8065f9696e"
|
13
|
-
tag = "
|
14
|
-
|
19
|
+
tag = "fluiddb/users/username"
|
20
|
+
@fluid.get("/objects/#{uid}/#{tag}").value.should eq("gridaphobe")
|
15
21
|
end
|
16
22
|
|
17
|
-
should
|
23
|
+
it "should process queries correctly" do
|
18
24
|
query = 'fluiddb/users/username = "gridaphobe"'
|
19
25
|
expected = {
|
20
26
|
"ids" => ["e034d8c0-a2e4-4094-895b-3a8065f9696e"]
|
21
27
|
}
|
22
|
-
|
28
|
+
@fluid.get("/objects", :query => query).value.should eq(expected)
|
23
29
|
end
|
24
30
|
|
25
|
-
should
|
31
|
+
it "should retrieve objects with about tag" do
|
26
32
|
uid = "206b5ca5-cd69-469a-9aba-44b28cfb455e"
|
27
33
|
expected = {
|
28
34
|
"about"=>nil,
|
29
35
|
"tagPaths"=>["gridaphobe/test/test_tag"]
|
30
36
|
}
|
31
|
-
|
37
|
+
@fluid.get("/objects/#{uid}",
|
38
|
+
:showAbout => true).value.should eq(expected)
|
32
39
|
end
|
33
|
-
|
34
|
-
should
|
40
|
+
|
41
|
+
it "should retrieve objects without about tag" do
|
35
42
|
uid = "206b5ca5-cd69-469a-9aba-44b28cfb455e"
|
36
43
|
expected = {
|
37
44
|
"tagPaths"=>["gridaphobe/test/test_tag"]
|
38
45
|
}
|
39
|
-
|
46
|
+
@fluid.get("/objects/#{uid}").value.should eq(expected)
|
40
47
|
end
|
41
|
-
|
42
|
-
should
|
48
|
+
|
49
|
+
it "should raise 404 errors on bad request" do
|
43
50
|
uid = "1"
|
44
51
|
tag = "gridaphobe/given-name"
|
45
|
-
|
46
|
-
@fluid.get "/objects/#{uid}/#{tag}"
|
47
|
-
end
|
52
|
+
expect{@fluid.get "/objects/#{uid}/#{tag}"}.to raise_error(RestClient::ResourceNotFound)
|
48
53
|
end
|
49
54
|
end
|
50
55
|
|
51
|
-
|
52
|
-
should
|
56
|
+
describe "/namespaces" do
|
57
|
+
it "should show basic information about namespaces" do
|
53
58
|
user = "gridaphobe"
|
54
59
|
ns = "test"
|
55
60
|
expected = {
|
56
61
|
"id" =>"9c16dcbe-87fd-4fe9-ae0e-699be84f1105"
|
57
62
|
}
|
58
|
-
|
63
|
+
@fluid.get("/namespaces/#{user}/#{ns}").value.should eq(expected)
|
59
64
|
end
|
60
65
|
|
61
|
-
should
|
66
|
+
it "should show detailed information about namespaces" do
|
62
67
|
user = "gridaphobe"
|
63
68
|
ns = "test"
|
64
69
|
expected = {
|
@@ -67,15 +72,15 @@ class FluidinfoTest < Test::Unit::TestCase
|
|
67
72
|
"id" =>"9c16dcbe-87fd-4fe9-ae0e-699be84f1105",
|
68
73
|
"description" =>"test"
|
69
74
|
}
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
75
|
+
@fluid.get("/namespaces/#{user}/#{ns}",
|
76
|
+
:returnDescription => true,
|
77
|
+
:returnTags => true,
|
78
|
+
:returnNamespaces => true).value.should eq(expected)
|
74
79
|
end
|
75
80
|
end
|
76
|
-
|
77
|
-
|
78
|
-
should
|
81
|
+
|
82
|
+
describe "/values" do
|
83
|
+
it "should retrieve a set of tags" do
|
79
84
|
expected = {
|
80
85
|
"results" => {
|
81
86
|
"id" => {
|
@@ -86,53 +91,67 @@ class FluidinfoTest < Test::Unit::TestCase
|
|
86
91
|
}
|
87
92
|
}
|
88
93
|
}
|
89
|
-
|
90
|
-
|
91
|
-
|
94
|
+
@fluid.get("/values",
|
95
|
+
:query => 'fluiddb/users/username="gridaphobe"',
|
96
|
+
:tags => ['fluiddb/users/username',
|
97
|
+
'fluiddb/about']).value.should eq(expected)
|
92
98
|
end
|
93
99
|
end
|
94
100
|
end
|
95
101
|
|
96
|
-
|
97
|
-
|
98
|
-
@fluid = Fluidinfo::Client.new
|
102
|
+
describe "POST" do
|
103
|
+
before(:each) do
|
104
|
+
@fluid = Fluidinfo::Client.new
|
99
105
|
@fluid.login 'test', 'test'
|
100
106
|
end
|
101
107
|
|
102
|
-
|
103
|
-
|
108
|
+
it "should return a Fluidinfo::Response" do
|
109
|
+
r = @fluid.post("/objects")
|
110
|
+
r.should be_a(Fluidinfo::Response)
|
111
|
+
r.should respond_to(:status, :content, :headers, :value, :response)
|
112
|
+
end
|
113
|
+
|
114
|
+
describe "/namespaces" do
|
115
|
+
it "should create new namespaces" do
|
104
116
|
new_ns = UUIDTools::UUID.random_create
|
105
117
|
body = {
|
106
118
|
'description' => 'a test namespace',
|
107
119
|
'name' => new_ns
|
108
120
|
}
|
109
121
|
resp = @fluid.post "/namespaces/test", :body => body
|
110
|
-
|
111
|
-
|
112
|
-
|
122
|
+
resp.status.should eq(201)
|
123
|
+
resp["id"].should_not be_nil
|
124
|
+
|
113
125
|
# now cleanup
|
114
126
|
@fluid.delete "/namespaces/test/#{new_ns}"
|
115
127
|
end
|
116
128
|
end
|
117
129
|
end
|
118
130
|
|
119
|
-
|
120
|
-
|
121
|
-
@fluid = Fluidinfo::Client.new
|
131
|
+
describe "PUT" do
|
132
|
+
before(:each) do
|
133
|
+
@fluid = Fluidinfo::Client.new
|
122
134
|
@fluid.login 'test', 'test'
|
123
135
|
end
|
124
136
|
|
125
|
-
|
126
|
-
|
137
|
+
it "should return a Fluidinfo::Response" do
|
138
|
+
r = @fluid.put("/about/fluidinfo/test/tag", :body => nil)
|
139
|
+
r.should be_a(Fluidinfo::Response)
|
140
|
+
r.should respond_to(:status, :content, :headers, :value, :response)
|
141
|
+
@fluid.delete("/about/fluidinfo/test/tag")
|
142
|
+
end
|
143
|
+
|
144
|
+
describe "/tags" do
|
145
|
+
it "should update primitive tag values" do
|
127
146
|
new_ns = UUIDTools::UUID.random_create
|
128
147
|
ns_body = {
|
129
148
|
'description' => 'a test namespace',
|
130
149
|
'name' => new_ns
|
131
150
|
}
|
132
151
|
resp = @fluid.post '/namespaces/test', :body => ns_body
|
133
|
-
|
134
|
-
ns_id = resp["id"] # for later use
|
152
|
+
resp["id"].should_not be_nil
|
135
153
|
|
154
|
+
ns_id = resp["id"] # for later use
|
136
155
|
new_tag = UUIDTools::UUID.random_create
|
137
156
|
tag_body = {
|
138
157
|
'description' => 'a test tag',
|
@@ -140,34 +159,35 @@ class FluidinfoTest < Test::Unit::TestCase
|
|
140
159
|
'indexed' => false
|
141
160
|
}
|
142
161
|
resp = @fluid.post "/tags/test/#{new_ns}", :body => tag_body
|
143
|
-
|
162
|
+
resp["id"].should_not be_nil
|
163
|
+
|
144
164
|
path = "/objects/#{ns_id}/test/#{new_ns}/#{new_tag}"
|
145
165
|
# Make sure that all primitive values are properly encoded and
|
146
166
|
# sent to Fluidinfo
|
147
167
|
primitives = [1, 1.1, "foo", true, nil, [1, '2', 3]]
|
148
168
|
primitives.each do |p|
|
149
169
|
resp = @fluid.put(path, :body => p)
|
150
|
-
|
170
|
+
@fluid.get(path).value.should eq(p)
|
151
171
|
end
|
152
172
|
|
153
173
|
# now cleanup
|
154
174
|
response = @fluid.delete "/tags/test/#{new_ns}/#{new_tag}"
|
155
|
-
|
156
|
-
|
175
|
+
response.status.should eq(204)
|
176
|
+
|
157
177
|
response = @fluid.delete "/namespaces/test/#{new_ns}"
|
158
|
-
|
178
|
+
response.status.should eq(204)
|
159
179
|
end
|
160
180
|
|
161
|
-
should
|
181
|
+
it "should update opaque tag values" do
|
162
182
|
new_ns = UUIDTools::UUID.random_create
|
163
183
|
ns_body = {
|
164
184
|
'description' => 'a test namespace',
|
165
185
|
'name' => new_ns
|
166
186
|
}
|
167
187
|
resp = @fluid.post '/namespaces/test', :body => ns_body
|
168
|
-
|
169
|
-
ns_id = resp["id"] # for later use
|
188
|
+
resp["id"].should_not be_nil
|
170
189
|
|
190
|
+
ns_id = resp["id"] # for later use
|
171
191
|
new_tag = UUIDTools::UUID.random_create
|
172
192
|
tag_body = {
|
173
193
|
'description' => 'a test tag',
|
@@ -178,24 +198,22 @@ class FluidinfoTest < Test::Unit::TestCase
|
|
178
198
|
file = File.new(__FILE__).read
|
179
199
|
path = "/objects/#{ns_id}/test/#{new_ns}/#{new_tag}"
|
180
200
|
resp = @fluid.put path, :body => file, :mime => "text/ruby"
|
181
|
-
|
201
|
+
File.new(__FILE__).read.should eq(@fluid.get(path).value)
|
182
202
|
|
183
203
|
# now cleanup
|
184
204
|
@fluid.delete "/tags/test/#{new_ns}/#{new_tag}"
|
185
205
|
@fluid.delete "/namespaces/test/#{new_ns}"
|
186
206
|
end
|
187
207
|
|
188
|
-
should
|
208
|
+
it "should raise TypeError on malformed request" do
|
189
209
|
file = File.new(__FILE__)
|
190
|
-
|
191
|
-
@fluid.put("/objects", :body => file)
|
192
|
-
end
|
210
|
+
expect {@fluid.put "/objects", :body => file}.to raise_error(TypeError)
|
193
211
|
end
|
194
212
|
end
|
195
213
|
end
|
196
|
-
|
197
|
-
|
198
|
-
|
214
|
+
|
215
|
+
describe "private functions" do
|
216
|
+
before(:each) do
|
199
217
|
@fluid = Fluidinfo::Client.new
|
200
218
|
def @fluid.test_build_payload(*args)
|
201
219
|
build_payload(*args)
|
@@ -204,37 +222,40 @@ class FluidinfoTest < Test::Unit::TestCase
|
|
204
222
|
build_url(*args)
|
205
223
|
end
|
206
224
|
end
|
207
|
-
|
208
|
-
|
209
|
-
|
225
|
+
|
226
|
+
describe "build_url" do
|
227
|
+
it "escapes &'s in query tag-values" do
|
210
228
|
query = "test/tag=\"1&2\""
|
211
|
-
|
212
|
-
|
229
|
+
expected = "https://fluiddb.fluidinfo.com/objects?query=test%2Ftag%3D%221%262%22"
|
230
|
+
@fluid.test_build_url("/objects", :query => query).should eq(expected)
|
231
|
+
|
213
232
|
query = "oreilly.com/title=\"HTML & CSS: The Good Parts\""
|
214
233
|
tags = ["oreilly.com/isbn"]
|
215
|
-
|
216
|
-
|
234
|
+
expected = "https://fluiddb.fluidinfo.com/values?query=oreilly.com%2Ftitle%3D%22HTML+%26+CSS%3A+The+Good+Parts%22&tag=oreilly.com/isbn"
|
235
|
+
@fluid.test_build_url("/values",
|
236
|
+
:query => query,
|
237
|
+
:tags => tags).should eq(expected)
|
217
238
|
end
|
218
239
|
|
219
|
-
|
240
|
+
it "escapes &'s in about-values" do
|
220
241
|
about = "tom & jerry"
|
221
|
-
|
222
|
-
|
242
|
+
expected = "https://fluiddb.fluidinfo.com/about/tom+%26+jerry"
|
243
|
+
@fluid.test_build_url('/about/tom & jerry').should eq(expected)
|
223
244
|
end
|
224
245
|
end
|
225
246
|
|
226
|
-
|
227
|
-
|
247
|
+
describe "build_payload" do
|
248
|
+
it "sets proper mime-types" do
|
228
249
|
primitives = [1, 1.1, true, false, nil, ["1", "2", "hi"]]
|
229
250
|
primitives.each do |p|
|
230
251
|
h = @fluid.test_build_payload :body => p
|
231
|
-
|
252
|
+
h[:mime].should eq("application/vnd.fluiddb.value+json")
|
232
253
|
end
|
233
|
-
|
254
|
+
|
234
255
|
non_primitives = [[1, 2, 3], {"hi" => "there"}]
|
235
256
|
non_primitives.each do |n|
|
236
257
|
h = @fluid.test_build_payload :body => n
|
237
|
-
|
258
|
+
h[:mime].should eq("application/json")
|
238
259
|
end
|
239
260
|
end
|
240
261
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluidinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,45 +9,55 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
13
|
-
default_executable:
|
12
|
+
date: 2011-09-17 00:00:00.000000000Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rest-client
|
17
|
-
requirement: &
|
16
|
+
requirement: &70220778276580 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
|
-
- -
|
19
|
+
- - ~>
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.6.
|
21
|
+
version: 1.6.7
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
24
|
+
version_requirements: *70220778276580
|
26
25
|
- !ruby/object:Gem::Dependency
|
27
26
|
name: yajl-ruby
|
28
|
-
requirement: &
|
27
|
+
requirement: &70220778275920 !ruby/object:Gem::Requirement
|
29
28
|
none: false
|
30
29
|
requirements:
|
31
|
-
- -
|
30
|
+
- - ~>
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
32
|
+
version: 1.0.0
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
|
-
version_requirements: *
|
35
|
+
version_requirements: *70220778275920
|
37
36
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
39
|
-
requirement: &
|
37
|
+
name: rake
|
38
|
+
requirement: &70220778275320 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
40
|
requirements:
|
42
|
-
- -
|
41
|
+
- - ~>
|
43
42
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
43
|
+
version: 0.9.2
|
45
44
|
type: :development
|
46
45
|
prerelease: false
|
47
|
-
version_requirements: *
|
46
|
+
version_requirements: *70220778275320
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: &70220778274720 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.6.0
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70220778274720
|
48
58
|
- !ruby/object:Gem::Dependency
|
49
59
|
name: bundler
|
50
|
-
requirement: &
|
60
|
+
requirement: &70220778274120 !ruby/object:Gem::Requirement
|
51
61
|
none: false
|
52
62
|
requirements:
|
53
63
|
- - ~>
|
@@ -55,40 +65,40 @@ dependencies:
|
|
55
65
|
version: 1.0.0
|
56
66
|
type: :development
|
57
67
|
prerelease: false
|
58
|
-
version_requirements: *
|
68
|
+
version_requirements: *70220778274120
|
59
69
|
- !ruby/object:Gem::Dependency
|
60
70
|
name: jeweler
|
61
|
-
requirement: &
|
71
|
+
requirement: &70220778273520 !ruby/object:Gem::Requirement
|
62
72
|
none: false
|
63
73
|
requirements:
|
64
74
|
- - ~>
|
65
75
|
- !ruby/object:Gem::Version
|
66
|
-
version: 1.
|
76
|
+
version: 1.6.4
|
67
77
|
type: :development
|
68
78
|
prerelease: false
|
69
|
-
version_requirements: *
|
79
|
+
version_requirements: *70220778273520
|
70
80
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
72
|
-
requirement: &
|
81
|
+
name: uuidtools
|
82
|
+
requirement: &70220778272920 !ruby/object:Gem::Requirement
|
73
83
|
none: false
|
74
84
|
requirements:
|
75
|
-
- -
|
85
|
+
- - ~>
|
76
86
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
87
|
+
version: 2.1.2
|
78
88
|
type: :development
|
79
89
|
prerelease: false
|
80
|
-
version_requirements: *
|
90
|
+
version_requirements: *70220778272920
|
81
91
|
- !ruby/object:Gem::Dependency
|
82
|
-
name:
|
83
|
-
requirement: &
|
92
|
+
name: yard
|
93
|
+
requirement: &70220778272320 !ruby/object:Gem::Requirement
|
84
94
|
none: false
|
85
95
|
requirements:
|
86
|
-
- -
|
96
|
+
- - ~>
|
87
97
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
98
|
+
version: 0.7.2
|
89
99
|
type: :development
|
90
100
|
prerelease: false
|
91
|
-
version_requirements: *
|
101
|
+
version_requirements: *70220778272320
|
92
102
|
description: This gem provides a simple interface to fluidinfo, built on top of the
|
93
103
|
rest-client gem.
|
94
104
|
email: gridaphobe@gmail.com
|
@@ -99,6 +109,7 @@ extra_rdoc_files:
|
|
99
109
|
- README.rdoc
|
100
110
|
files:
|
101
111
|
- .document
|
112
|
+
- .rspec
|
102
113
|
- .rvmrc
|
103
114
|
- Gemfile
|
104
115
|
- Gemfile.lock
|
@@ -108,9 +119,9 @@ files:
|
|
108
119
|
- VERSION
|
109
120
|
- fluidinfo.gemspec
|
110
121
|
- lib/fluidinfo.rb
|
111
|
-
-
|
112
|
-
-
|
113
|
-
|
122
|
+
- lib/fluidinfo/client.rb
|
123
|
+
- lib/fluidinfo/response.rb
|
124
|
+
- spec/fluidinfo_spec.rb
|
114
125
|
homepage: http://github.com/gridaphobe/fluidinfo.rb
|
115
126
|
licenses:
|
116
127
|
- MIT
|
@@ -126,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
137
|
version: '0'
|
127
138
|
segments:
|
128
139
|
- 0
|
129
|
-
hash:
|
140
|
+
hash: 3187277794314220845
|
130
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
142
|
none: false
|
132
143
|
requirements:
|
@@ -135,10 +146,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
146
|
version: '0'
|
136
147
|
requirements: []
|
137
148
|
rubyforge_project:
|
138
|
-
rubygems_version: 1.
|
149
|
+
rubygems_version: 1.8.10
|
139
150
|
signing_key:
|
140
151
|
specification_version: 3
|
141
152
|
summary: Provides a simple interface to fluidinfo
|
142
|
-
test_files:
|
143
|
-
- test/helper.rb
|
144
|
-
- test/test_fluidinfo.rb
|
153
|
+
test_files: []
|
data/test/helper.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require 'test/unit'
|
11
|
-
require 'shoulda'
|
12
|
-
|
13
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
-
require 'fluidinfo'
|
16
|
-
|
17
|
-
class Test::Unit::TestCase
|
18
|
-
end
|