dm-redis-adapter 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source :gemcutter
2
+
3
+ gem "dm-core", ">= 1.2.0"
4
+ gem "dm-validations", ">= 1.2.0"
5
+ gem "dm-types", ">= 1.2.0"
6
+ gem "redis", ">= 2.2"
7
+ gem "jeweler", ">= 1.4.0"
8
+ gem "rspec", "~> 1.3.0"
9
+ gem "rake", ">= 0.8.7"
10
+ gem "hiredis", "~> 0.4.0"
11
+ # gem "ruby-debug19"
12
+ # gem "data_objects", ">= 0.10.1"
13
+ # gem "do_postgres", ">= 0.10.1"
data/README.textile CHANGED
@@ -14,6 +14,7 @@ Please note that as of version 0.5.3 of the gem, the key names that are used for
14
14
 
15
15
  h1. Changelog
16
16
 
17
+ * v0.8.2 Updates to RedisAdapter#initialize to support URI. (thanks @thentenaar)
17
18
  * v0.8.1 Dependency updates by @jof to support newer versions of the redis gem.
18
19
  * v0.8.0 Updates by @sfeu to support composite natural keys.
19
20
  * v0.6.4 Adding the Gemfile so that rake commands work (thanks @kellydunn!)
@@ -104,6 +105,7 @@ Validations on unique fields are now supported through indices and dm-validation
104
105
 
105
106
  h1. Badass contributors
106
107
 
108
+ * <a href="http://github.com/thentenaar">Tim Hentenaar (thentenaar)</a>
107
109
  * <a href="http://github.com/aeden">Anthony Eden (aeden)</a> Gem cleanup, update to jeweler
108
110
  * <a href="http://github.com/sr">Simon Roset (sr)</a> Fixes for edge dm-core
109
111
  * <a href="http://github.com/cehoffman">Chris Hoffman (cehoffman)</a> Fixes for Ruby 1.9, bundler for development deps, fixes for sorting
@@ -123,7 +123,6 @@ module DataMapper
123
123
  properties_to_set = []
124
124
  properties_to_del = []
125
125
 
126
-
127
126
  fields = model.properties(self.name).select {|property| attributes.key?(property)}
128
127
  fields.each do |property|
129
128
  value = attributes[property]
@@ -344,6 +343,19 @@ module DataMapper
344
343
  #
345
344
  # @api semipublic
346
345
  def initialize(name, uri_or_options)
346
+ uri_or_options.delete_if { |k,v| v.nil? || (v.is_a?(String) && v == '') }
347
+
348
+ # If the :path ends in '.sock' assume that this really is a path, otherwise assume it's a DB name
349
+ uri_or_options.delete(:path) if uri_or_options[:path] == '/'
350
+ uri_or_options[:db] = uri_or_options.delete(:path) if uri_or_options[:path] && uri_or_options[:path].match(/\.sock$/)
351
+
352
+ # Parse options from the URI's query string
353
+ if uri_or_options[:query]
354
+ opts = uri_or_options[:query].split(/&/)
355
+ uri_or_options.merge!(Hash[opts.collect { |x| x.split(/=/) }])
356
+ uri_or_options.delete(:query)
357
+ end
358
+
347
359
  super
348
360
  @redis = Redis.new(@options)
349
361
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-redis-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.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: 2013-01-02 00:00:00.000000000 Z
12
+ date: 2013-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dm-core
@@ -64,7 +64,7 @@ dependencies:
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ! '>='
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
69
  version: '2.2'
70
70
  type: :runtime
@@ -72,21 +72,12 @@ dependencies:
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ! '>='
75
+ - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: '2.2'
78
78
  description: DataMapper adapter for the Redis key-value database
79
79
  email: whoahbot@gmail.com
80
- executables:
81
- - autospec
82
- - edit_json.rb
83
- - jeweler
84
- - minitar
85
- - prettify_json.rb
86
- - rake
87
- - rdebug
88
- - rubyforge
89
- - spec
80
+ executables: []
90
81
  extensions: []
91
82
  extra_rdoc_files:
92
83
  - MIT-LICENSE
@@ -105,20 +96,11 @@ files:
105
96
  - spec/self_referential_spec.rb
106
97
  - spec/spec_helper.rb
107
98
  - spec/textual_keys_spec.rb
108
- - bin/autospec
109
- - bin/edit_json.rb
110
- - bin/jeweler
111
- - bin/minitar
112
- - bin/prettify_json.rb
113
- - bin/rake
114
- - bin/rdebug
115
- - bin/rubyforge
116
- - bin/spec
99
+ - Gemfile
117
100
  homepage: http://github.com/whoahbot/dm-redis-adapter
118
101
  licenses: []
119
102
  post_install_message:
120
- rdoc_options:
121
- - --charset=UTF-8
103
+ rdoc_options: []
122
104
  require_paths:
123
105
  - lib
124
106
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -127,9 +109,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
109
  - - ! '>='
128
110
  - !ruby/object:Gem::Version
129
111
  version: '0'
130
- segments:
131
- - 0
132
- hash: -4366875247771912151
133
112
  required_rubygems_version: !ruby/object:Gem::Requirement
134
113
  none: false
135
114
  requirements:
@@ -151,3 +130,4 @@ test_files:
151
130
  - spec/self_referential_spec.rb
152
131
  - spec/spec_helper.rb
153
132
  - spec/textual_keys_spec.rb
133
+ has_rdoc:
data/bin/autospec DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'autospec' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('rspec', 'autospec')
data/bin/edit_json.rb DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'edit_json.rb' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('json_pure', 'edit_json.rb')
data/bin/jeweler DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'jeweler' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('jeweler', 'jeweler')
data/bin/minitar DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'minitar' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('archive-tar-minitar', 'minitar')
data/bin/prettify_json.rb DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'prettify_json.rb' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('json_pure', 'prettify_json.rb')
data/bin/rake DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'rake' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('rake', 'rake')
data/bin/rdebug DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'rdebug' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('ruby-debug19', 'rdebug')
data/bin/rubyforge DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'rubyforge' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('rubyforge', 'rubyforge')
data/bin/spec DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'spec' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('rspec', 'spec')