quicky 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +0 -66
- data/lib/quicky/timer.rb +9 -3
- data/lib/quicky/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,66 +0,0 @@
|
|
1
|
-
Rest Wrapper
|
2
|
-
-------------
|
3
|
-
|
4
|
-
HTTP/REST client wrapper that provides a standard interface for making http requests using different http clients.
|
5
|
-
If no client is specified it will choose the best one you have installed.
|
6
|
-
|
7
|
-
Getting Started
|
8
|
-
==============
|
9
|
-
|
10
|
-
Install the gem:
|
11
|
-
|
12
|
-
gem install rest
|
13
|
-
|
14
|
-
Create an Rest client:
|
15
|
-
|
16
|
-
@rest = Rest::Client.new()
|
17
|
-
|
18
|
-
To choose a specific underlying http client lib:
|
19
|
-
|
20
|
-
@rest = Rest::Client.new(:gem=>:typhoeus)
|
21
|
-
|
22
|
-
Supported http libraries are:
|
23
|
-
|
24
|
-
* rest-client
|
25
|
-
* net-http-persistent
|
26
|
-
* typhoeus
|
27
|
-
|
28
|
-
Then use it:
|
29
|
-
|
30
|
-
GET
|
31
|
-
=========
|
32
|
-
|
33
|
-
@rest.get(url, options...)
|
34
|
-
|
35
|
-
options:
|
36
|
-
|
37
|
-
- :params => query params for url
|
38
|
-
- :headers => headers
|
39
|
-
|
40
|
-
POST
|
41
|
-
======
|
42
|
-
|
43
|
-
@rest.post(url, options...)
|
44
|
-
|
45
|
-
options:
|
46
|
-
|
47
|
-
- :body => POST body
|
48
|
-
- :headers => headers
|
49
|
-
|
50
|
-
PUT
|
51
|
-
======
|
52
|
-
|
53
|
-
@rest.put(url, options...)
|
54
|
-
|
55
|
-
options:
|
56
|
-
|
57
|
-
- :body => POST body
|
58
|
-
- :headers => headers
|
59
|
-
|
60
|
-
DELETE
|
61
|
-
======
|
62
|
-
|
63
|
-
@rest.delete(url, options...)
|
64
|
-
|
65
|
-
|
66
|
-
|
data/lib/quicky/timer.rb
CHANGED
@@ -6,13 +6,19 @@ module Quicky
|
|
6
6
|
@collector = {}
|
7
7
|
end
|
8
8
|
|
9
|
-
def loop(name, x, &blk)
|
9
|
+
def loop(name, x, options={}, &blk)
|
10
|
+
if options[:warmup]
|
11
|
+
options[:warmup].times do |i|
|
12
|
+
puts "Warming up... #{i}"
|
13
|
+
yield
|
14
|
+
end
|
15
|
+
end
|
10
16
|
x.times do |i|
|
11
|
-
time(name, &blk)
|
17
|
+
time(name, options, &blk)
|
12
18
|
end
|
13
19
|
end
|
14
20
|
|
15
|
-
def time(name, &blk)
|
21
|
+
def time(name, options={}, &blk)
|
16
22
|
t = Time.now
|
17
23
|
yield
|
18
24
|
duration = Time.now.to_f - t.to_f
|
data/lib/quicky/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quicky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: test-unit
|