redis-objects 0.6.1 → 0.7.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/spec/spec_helper.rb CHANGED
@@ -9,6 +9,8 @@ if $0 =~ /\brspec$/
9
9
  raise "\n===\nThese tests are in bacon, not rspec. Try: bacon #{ARGV * ' '}\n===\n"
10
10
  end
11
11
 
12
+ REDIS_CLASS_NAMES = [:Counter, :HashKey, :List, :Lock, :Set, :SortedSet, :Value]
13
+
12
14
  UNIONSTORE_KEY = 'test:unionstore'
13
15
  INTERSTORE_KEY = 'test:interstore'
14
16
  DIFFSTORE_KEY = 'test:diffstore'
@@ -19,10 +21,17 @@ REDIS_PORT = ENV['REDIS_PORT'] || 9212
19
21
  REDIS_HOST = ENV['REDIS_HOST'] || 'localhost'
20
22
  REDIS_PID = File.expand_path 'redis.pid', File.dirname(__FILE__)
21
23
  REDIS_DUMP = File.expand_path 'redis.rdb', File.dirname(__FILE__)
22
- puts "=> Starting redis-server on #{REDIS_HOST}:#{REDIS_PORT}"
23
- fork_pid = fork do
24
- system "(echo port #{REDIS_PORT}; echo logfile /dev/null; echo daemonize yes; echo pidfile #{REDIS_PID}; echo dbfilename #{REDIS_DUMP}) | #{REDIS_BIN} -"
24
+
25
+ describe 'redis-server' do
26
+ it "starting redis-server on #{REDIS_HOST}:#{REDIS_PORT}" do
27
+ fork_pid = fork do
28
+ system "(echo port #{REDIS_PORT}; echo logfile /dev/null; echo daemonize yes; echo pidfile #{REDIS_PID}; echo dbfilename #{REDIS_DUMP}) | #{REDIS_BIN} -"
29
+ end
30
+ fork_pid.should > 0
31
+ sleep 2
32
+ end
25
33
  end
34
+
26
35
  at_exit do
27
36
  pid = File.read(REDIS_PID).to_i
28
37
  puts "=> Killing #{REDIS_BIN} with pid #{pid}"
@@ -32,11 +41,22 @@ at_exit do
32
41
  File.unlink REDIS_DUMP if File.exists? REDIS_DUMP
33
42
  end
34
43
 
44
+ def raises_exception(&block)
45
+ e = nil
46
+ begin
47
+ block.call
48
+ rescue => e
49
+ end
50
+ e.should.be.is_a?(StandardError)
51
+ end
52
+
35
53
  # Grab a global handle
36
- $redis = Redis.new(:host => REDIS_HOST, :port => REDIS_PORT)
54
+ REDIS_HANDLE = Redis.new(:host => REDIS_HOST, :port => REDIS_PORT)
55
+ #$redis = REDIS_HANDLE
56
+ Redis.current = REDIS_HANDLE
37
57
 
38
58
  SORT_ORDER = {:order => 'desc alpha'}
39
59
  SORT_LIMIT = {:limit => [2, 2]}
40
- SORT_BY = {:by => 'm_*'}
41
- SORT_GET = {:get => 'spec/*/sorted'}.merge!(SORT_LIMIT)
60
+ SORT_BY = {:by => 'm_*'}
61
+ SORT_GET = {:get => 'spec/*/sorted'}.merge!(SORT_LIMIT)
42
62
  SORT_STORE = {:store => "spec/aftersort"}.merge!(SORT_GET)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
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-10-24 00:00:00.000000000 Z
12
+ date: 2013-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -60,19 +60,19 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.2.0
62
62
  description: Map Redis types directly to Ruby objects. Works with any class or ORM.
63
- email: nate@wiger.org
63
+ email: nwiger@gmail.com
64
64
  executables: []
65
65
  extensions: []
66
66
  extra_rdoc_files:
67
- - README.rdoc
67
+ - README.md
68
68
  files:
69
69
  - ATOMICITY.rdoc
70
70
  - CHANGELOG.rdoc
71
71
  - Gemfile
72
- - Gemfile.lock
73
- - README.rdoc
72
+ - README.md
74
73
  - Rakefile
75
74
  - VERSION
75
+ - lib/redis-objects.rb
76
76
  - lib/redis/base_object.rb
77
77
  - lib/redis/counter.rb
78
78
  - lib/redis/hash_key.rb
@@ -92,8 +92,10 @@ files:
92
92
  - lib/redis/sorted_set.rb
93
93
  - lib/redis/value.rb
94
94
  - redis-objects.gemspec
95
+ - spec/redis_autoload_objects_spec.rb
95
96
  - spec/redis_namespace_compat_spec.rb
96
97
  - spec/redis_objects_active_record_spec.rb
98
+ - spec/redis_objects_conn_spec.rb
97
99
  - spec/redis_objects_instance_spec.rb
98
100
  - spec/redis_objects_model_spec.rb
99
101
  - spec/spec_helper.rb
@@ -109,9 +111,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
111
  - - ! '>='
110
112
  - !ruby/object:Gem::Version
111
113
  version: '0'
112
- segments:
113
- - 0
114
- hash: 212928099894229760
115
114
  required_rubygems_version: !ruby/object:Gem::Requirement
116
115
  none: false
117
116
  requirements:
data/Gemfile.lock DELETED
@@ -1,43 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- activemodel (3.2.8)
5
- activesupport (= 3.2.8)
6
- builder (~> 3.0.0)
7
- activerecord (3.2.8)
8
- activemodel (= 3.2.8)
9
- activesupport (= 3.2.8)
10
- arel (~> 3.0.2)
11
- tzinfo (~> 0.3.29)
12
- activesupport (3.2.8)
13
- i18n (~> 0.6)
14
- multi_json (~> 1.0)
15
- arel (3.0.2)
16
- bacon (1.1.0)
17
- builder (3.0.4)
18
- git (1.2.5)
19
- i18n (0.6.1)
20
- jeweler (1.8.4)
21
- bundler (~> 1.0)
22
- git (>= 1.2.5)
23
- rake
24
- rdoc
25
- json (1.7.5)
26
- multi_json (1.3.6)
27
- rake (0.9.2.2)
28
- rdoc (3.12)
29
- json (~> 1.4)
30
- redis (3.0.2)
31
- redis-namespace (1.2.1)
32
- redis (~> 3.0.0)
33
- tzinfo (0.3.33)
34
-
35
- PLATFORMS
36
- ruby
37
-
38
- DEPENDENCIES
39
- activerecord
40
- bacon
41
- jeweler
42
- redis (>= 3.0.2)
43
- redis-namespace