lemondrop 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5997d77f1b1d98604ffb647c26e4582da676a3a
4
- data.tar.gz: fec5f195c1697ae8c52ab27f1e28b4c9fd67673b
3
+ metadata.gz: 4203f5666c419eb4c337a30279c52513480d3da9
4
+ data.tar.gz: 2ff81e90cf6b4ea73695bd8743f5b2325efd2088
5
5
  SHA512:
6
- metadata.gz: ff30f6f96a44b7606af7117d20891a2a8c2b2854b0029e2b43609842923cd45886894f415ca46f1f3ce3e33ef6a825b72f441f6b30c1f7340ecb379f604f2ab7
7
- data.tar.gz: de9126f978dcf3fa5dbbed92c3e6d5ae45d7bd15d92dd0c32341a74b577ac021dc2a08f7cbda83e046050dafe566a1dd6c2a24866577971a05620da1114b9da6
6
+ metadata.gz: fae63429ffe24e20663ae019deef6acf8ede47674821ef564092e4de18d3e3b437f9927ea13323cd30a42fe6515f677c9a6f741f1f29ce38a1783e282cbb0ce4
7
+ data.tar.gz: ce7654ab6940e8f9b5e4512461ac095d3302f90a81686e0f66abb97a00c2094a0d9a00afdad6ac179d441da29f7e125878cad01edb80e6e0bce7cce4bb1539fe
@@ -1,3 +1,6 @@
1
+ # [0.1.2](https://github.com/bklang/lemondrop/compare/v0.1.1...v0.1.2) - [2014-01-06](https://rubygems.org/gems/lemondrop/versions/0.1.2)
2
+ * Fix using Redis with no password set
3
+
1
4
  # [0.1.1](https://github.com/bklang/lemondrop/compare/v0.1.0...v0.1.1) - [2013-12-11](https://rubygems.org/gems/lemondrop/versions/0.1.1)
2
5
  * Fix Redis accessors on Lemondrop constant
3
6
 
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Mojo Lingo LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = ""
11
11
  s.summary = %q{Redis plugin for Adhearsion}
12
12
  s.description = %q{This gem provides a plugin for Adhearsion, allowing you to create and use Redis as a queue or data source in your Adhearsion application.}
13
+ s.license = 'MIT'
13
14
 
14
15
  s.rubyforge_project = "lemondrop"
15
16
 
@@ -9,7 +9,7 @@ class Lemondrop::Plugin < Adhearsion::Plugin
9
9
  config :lemondrop do
10
10
  uri '' , :desc => 'URI to the Redis instance. Use this or specify each piece of connection information separately below.'
11
11
  username '' , :desc => 'valid database username'
12
- password '' , :desc => 'valid database password'
12
+ password nil , :desc => 'valid database password'
13
13
  host 'localhost', :desc => 'host where the database is running'
14
14
  port 6379 , :desc => 'port where the database is listening'
15
15
  socket '' , :desc => 'path to Unix socket where Redis is listening (Optional; to use, set host and port to nil)'
@@ -10,11 +10,11 @@ class Lemondrop::Plugin::Service
10
10
  def start(config)
11
11
  params = config.to_hash.select { |k,v| !v.nil? }
12
12
  unless params[:uri].nil? || params[:uri].empty?
13
- redis_uri = URI.parse params[:uri]
14
- params[:user] = redis_uri.user
15
- params[:password] = redis_uri.password
16
- params[:host] = redis_uri.host
17
- params[:port] = redis_uri.port || params[:port]
13
+ uri = URI.parse params[:uri]
14
+ params[:username] = uri.user
15
+ params[:password] = uri.password
16
+ params[:hostname] = uri.hostname
17
+ params[:port] = uri.port || params[:port]
18
18
  params.delete :uri
19
19
  end
20
20
 
@@ -32,8 +32,9 @@ class Lemondrop::Plugin::Service
32
32
  #
33
33
  # @param params [Hash] Options to establish the Redis connection
34
34
  def establish_connection(params)
35
+ connection = ::Redis.new params
35
36
  logger.info "Lemondrop connected to Redis at #{params[:host]}:#{params[:port]}"
36
- ::Redis.new params
37
+ connection
37
38
  end
38
39
  end # class << self
39
40
  end # Service
@@ -1,3 +1,3 @@
1
1
  module Lemondrop
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -7,9 +7,9 @@ describe Lemondrop::Plugin::Service do
7
7
  it 'should allow specifying a URI for the connection information' do
8
8
  config = {uri: 'redis://redisuser:redispass@foo.bar.com:9530/'}
9
9
  expected_params = {
10
- user: 'redisuser',
10
+ username: 'redisuser',
11
11
  password: 'redispass',
12
- host: 'foo.bar.com',
12
+ hostname: 'foo.bar.com',
13
13
  port: 9530
14
14
  }
15
15
  subject.should_receive(:establish_connection).once.with(expected_params)
@@ -19,9 +19,9 @@ describe Lemondrop::Plugin::Service do
19
19
  it 'should default to the correct port if the URI does not specify one' do
20
20
  config = {uri: 'redis://redisuser:redispass@foo.bar.com/', port: 6379}
21
21
  expected_params = {
22
- user: 'redisuser',
22
+ username: 'redisuser',
23
23
  password: 'redispass',
24
- host: 'foo.bar.com',
24
+ hostname: 'foo.bar.com',
25
25
  port: 6379
26
26
  }
27
27
  subject.should_receive(:establish_connection).once.with(expected_params)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lemondrop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Klang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-11 00:00:00.000000000 Z
11
+ date: 2014-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adhearsion
@@ -119,6 +119,7 @@ files:
119
119
  - .gitignore
120
120
  - CHANGELOG.md
121
121
  - Gemfile
122
+ - LICENSE
122
123
  - README.md
123
124
  - Rakefile
124
125
  - lemondrop.gemspec
@@ -131,7 +132,8 @@ files:
131
132
  - spec/lemondrop/send_connection_spec.rb
132
133
  - spec/spec_helper.rb
133
134
  homepage: ''
134
- licenses: []
135
+ licenses:
136
+ - MIT
135
137
  metadata: {}
136
138
  post_install_message:
137
139
  rdoc_options: []
@@ -157,4 +159,3 @@ test_files:
157
159
  - spec/lemondrop/plugin/service_spec.rb
158
160
  - spec/lemondrop/send_connection_spec.rb
159
161
  - spec/spec_helper.rb
160
- has_rdoc: