csdn-tire 0.5 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tire/index.rb +16 -0
- data/lib/tire/version.rb +1 -1
- data/test/integration/index_test.rb +5 -0
- metadata +3 -2
data/lib/tire/index.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
module Tire
|
3
3
|
class Index
|
4
4
|
include Utils
|
5
|
+
extend Utils
|
5
6
|
|
6
7
|
attr_reader :name, :response
|
7
8
|
|
@@ -9,6 +10,21 @@ module Tire
|
|
9
10
|
@name = name
|
10
11
|
end
|
11
12
|
|
13
|
+
def self.list
|
14
|
+
url = "#{Configuration.url}/index"
|
15
|
+
|
16
|
+
@response = Configuration.client.get(url)
|
17
|
+
if @response.failure?
|
18
|
+
STDERR.puts "[REQUEST FAILED] \n"
|
19
|
+
raise @response.to_s
|
20
|
+
end
|
21
|
+
|
22
|
+
MultiJson.decode(@response.body)
|
23
|
+
ensure
|
24
|
+
curl = %Q|curl -X GET #{url}|
|
25
|
+
logged('Index list', curl)
|
26
|
+
end
|
27
|
+
|
12
28
|
def url
|
13
29
|
"#{Configuration.url}/#{@name}"
|
14
30
|
end
|
data/lib/tire/version.rb
CHANGED
metadata
CHANGED