iron_cache 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -5
- data/README.md +4 -5
- data/lib/iron_cache/items.rb +1 -1
- data/lib/iron_cache/version.rb +1 -1
- data/test/test_iron_cache.rb +0 -17
- data/test/test_memcached.rb +1 -1
- data/test/test_performance.rb +21 -0
- data/test/tmp.rb +26 -0
- metadata +6 -2
data/Gemfile.lock
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
iron_cache (1.1.
|
4
|
+
iron_cache (1.1.1)
|
5
5
|
iron_core (>= 0.2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
iron_core (0.
|
10
|
+
iron_core (0.3.3)
|
11
11
|
rest (>= 2.0.0)
|
12
12
|
memcache-client (1.8.5)
|
13
13
|
mime-types (1.19)
|
14
|
-
minitest (3.
|
14
|
+
minitest (3.3.0)
|
15
15
|
net-http-persistent (2.7)
|
16
16
|
rake (0.9.2.2)
|
17
|
-
rest (2.0.
|
17
|
+
rest (2.0.2)
|
18
18
|
net-http-persistent
|
19
19
|
rest-client (>= 0.3.0)
|
20
20
|
rest-client (1.6.7)
|
21
21
|
mime-types (>= 1.16)
|
22
22
|
test-unit (2.5.1)
|
23
|
-
uber_config (0.0.
|
23
|
+
uber_config (0.0.6)
|
24
24
|
|
25
25
|
PLATFORMS
|
26
26
|
ruby
|
data/README.md
CHANGED
@@ -4,13 +4,13 @@ IronCache Ruby Client
|
|
4
4
|
Getting Started
|
5
5
|
==============
|
6
6
|
|
7
|
-
1
|
7
|
+
1\. Install the gem:
|
8
8
|
|
9
9
|
gem install iron_cache
|
10
10
|
|
11
|
-
2
|
11
|
+
2\. Setup your Iron.io credentials: http://dev.iron.io/articles/configuration/
|
12
12
|
|
13
|
-
3
|
13
|
+
3\. Create an IronCache client object:
|
14
14
|
|
15
15
|
@client = IronCache::Client.new
|
16
16
|
|
@@ -27,8 +27,7 @@ Now you can use it:
|
|
27
27
|
|
28
28
|
**Put** an item in the cache:
|
29
29
|
|
30
|
-
|
31
|
-
p item
|
30
|
+
@cache.put("mykey", "hello world!")
|
32
31
|
|
33
32
|
**Get** an item from the cache:
|
34
33
|
|
data/lib/iron_cache/items.rb
CHANGED
@@ -10,7 +10,7 @@ module IronCache
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def path(key, options={})
|
13
|
-
path = "projects/#{@client.project_id}/caches/#{
|
13
|
+
path = "projects/#{@client.project_id}/caches/#{CGI::escape(options[:cache_name] || @client.cache_name)}/items/#{CGI::escape(key)}#{'/increment' if options[:increment] == true}"
|
14
14
|
end
|
15
15
|
|
16
16
|
# options:
|
data/lib/iron_cache/version.rb
CHANGED
data/test/test_iron_cache.rb
CHANGED
@@ -8,23 +8,6 @@ class IronCacheTests < TestBase
|
|
8
8
|
super
|
9
9
|
end
|
10
10
|
|
11
|
-
def test_performance_put_message
|
12
|
-
@client.cache_name = 'test_basics'
|
13
|
-
assert_performance 0.02 do
|
14
|
-
@client.items.put("key", "value")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_performance_put_100_messages
|
19
|
-
@client.cache_name = 'test_basics'
|
20
|
-
assert_performance 10 do
|
21
|
-
100.times do
|
22
|
-
res = @client.items.put("key", "value")
|
23
|
-
puts "putting message #{res.inspect}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
11
|
def test_basics
|
29
12
|
@client.cache_name = 'test_basics'
|
30
13
|
clear_queue
|
data/test/test_memcached.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
gem 'test-unit'
|
2
|
+
require 'test/unit'
|
3
|
+
require 'yaml'
|
4
|
+
require_relative 'test_base'
|
5
|
+
|
6
|
+
class TestPerformance < TestBase
|
7
|
+
def setup
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_performance_put_100_messages
|
12
|
+
@client.cache_name = 'test_basics'
|
13
|
+
assert_performance 10 do
|
14
|
+
100.times do |i|
|
15
|
+
res = @client.items.put("key", "value")
|
16
|
+
puts "putting message #{res.inspect}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
data/test/tmp.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
gem 'test-unit'
|
2
|
+
require 'test/unit'
|
3
|
+
require 'yaml'
|
4
|
+
require_relative 'test_base'
|
5
|
+
|
6
|
+
class IronCacheTests < TestBase
|
7
|
+
def setup
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_keys
|
12
|
+
@client.cache_name = 'test_keys'
|
13
|
+
clear_queue
|
14
|
+
|
15
|
+
k = "word_count_[EBook"
|
16
|
+
v = "hello world!"
|
17
|
+
res = @client.items.put(k, v)
|
18
|
+
# another naming option we could try:
|
19
|
+
#res = @client.cache('test_basics').items.put("key1", "hello world!")
|
20
|
+
p res
|
21
|
+
assert res.msg
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.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-
|
12
|
+
date: 2012-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: iron_core
|
@@ -129,6 +129,8 @@ files:
|
|
129
129
|
- test/test_base.rb
|
130
130
|
- test/test_iron_cache.rb
|
131
131
|
- test/test_memcached.rb
|
132
|
+
- test/test_performance.rb
|
133
|
+
- test/tmp.rb
|
132
134
|
homepage: https://github.com/iron-io/iron_cache_ruby
|
133
135
|
licenses: []
|
134
136
|
post_install_message:
|
@@ -158,3 +160,5 @@ test_files:
|
|
158
160
|
- test/test_base.rb
|
159
161
|
- test/test_iron_cache.rb
|
160
162
|
- test/test_memcached.rb
|
163
|
+
- test/test_performance.rb
|
164
|
+
- test/tmp.rb
|