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 +4 -4
- data/CHANGELOG.md +3 -0
- data/LICENSE +21 -0
- data/lemondrop.gemspec +1 -0
- data/lib/lemondrop/plugin.rb +1 -1
- data/lib/lemondrop/plugin/service.rb +7 -6
- data/lib/lemondrop/version.rb +1 -1
- data/spec/lemondrop/plugin/service_spec.rb +4 -4
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4203f5666c419eb4c337a30279c52513480d3da9
|
4
|
+
data.tar.gz: 2ff81e90cf6b4ea73695bd8743f5b2325efd2088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fae63429ffe24e20663ae019deef6acf8ede47674821ef564092e4de18d3e3b437f9927ea13323cd30a42fe6515f677c9a6f741f1f29ce38a1783e282cbb0ce4
|
7
|
+
data.tar.gz: ce7654ab6940e8f9b5e4512461ac095d3302f90a81686e0f66abb97a00c2094a0d9a00afdad6ac179d441da29f7e125878cad01edb80e6e0bce7cce4bb1539fe
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
data/lemondrop.gemspec
CHANGED
@@ -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
|
|
data/lib/lemondrop/plugin.rb
CHANGED
@@ -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
|
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
|
-
|
14
|
-
params[:
|
15
|
-
params[:password] =
|
16
|
-
params[:
|
17
|
-
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
|
-
|
37
|
+
connection
|
37
38
|
end
|
38
39
|
end # class << self
|
39
40
|
end # Service
|
data/lib/lemondrop/version.rb
CHANGED
@@ -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
|
-
|
10
|
+
username: 'redisuser',
|
11
11
|
password: 'redispass',
|
12
|
-
|
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
|
-
|
22
|
+
username: 'redisuser',
|
23
23
|
password: 'redispass',
|
24
|
-
|
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.
|
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:
|
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:
|