lemondrop 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cc2a5a5b680253c65240e9deb0d9ecb4b240cbed
4
+ data.tar.gz: f4a1ef007651c229d397692e029efcd92bdf4e4a
5
+ SHA512:
6
+ metadata.gz: 71b17c7dcf92741b4726e0dfb7b6bbd6ff5c637649b9f7bca330a14b1eda3d29768a69044a1f5c4e00ca43a5047e2f62ae02d7fbf8a762e2113d28735aec7026
7
+ data.tar.gz: 7bfe5270a03a107d9889896369c7ec089420fd0442abaa803e064e87b3d564562c7440a15745ddb962309df42e0bb8d252d696302bc5c2c430960191b7b1c15f
@@ -0,0 +1,6 @@
1
+ # [0.1.0](https://github.com/bklang/lemondrop/compare/v0.0.1...v0.1.0) - [2013-11-30](https://rubygems.org/gems/lemondrop/versions/0.1.0)
2
+ * Allow accessing Redis keys on the Lemondrop constant directly
3
+ * Logging & comment tweaks by Justin Aiken
4
+
5
+ # [0.0.1](https://github.com/bklang/lemondrop/tree/v0.0.1)
6
+ * Initial plugin for connection Adhearsion to Redis
data/README.md CHANGED
@@ -7,3 +7,13 @@ Configuration
7
7
  -------------
8
8
 
9
9
  As with all Adhearsion plugins, type `rake config:show` to see the list of configuration options.
10
+
11
+ Usage
12
+ -----
13
+
14
+ ```ruby
15
+ Lemondrop.set "foo", "bar"
16
+
17
+ Lemondrop.get "foo" #-> bar
18
+
19
+ ```
@@ -2,3 +2,4 @@ module Lemondrop
2
2
  end
3
3
  require "lemondrop/version"
4
4
  require "lemondrop/plugin"
5
+ require "lemondrop/send_connection"
@@ -18,5 +18,4 @@ class Lemondrop::Plugin < Adhearsion::Plugin
18
18
  init :lemondrop do
19
19
  Service.start Adhearsion.config[:lemondrop]
20
20
  end
21
-
22
21
  end
@@ -6,7 +6,7 @@ class Lemondrop::Plugin::Service
6
6
  class << self
7
7
 
8
8
  ##
9
- # Start the Sequel connection with the configured database
9
+ # Start the Redis connection with the configured database
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?
@@ -22,19 +22,19 @@ class Lemondrop::Plugin::Service
22
22
  end
23
23
 
24
24
  ##
25
- # Stop the database connection
25
+ # Stop the redis connection
26
26
  def stop
27
27
  logger.warn "Todo: Close down Redis connections"
28
28
  end
29
29
 
30
30
  ##
31
- # Start the Sequel connection with the configured database
31
+ # Start the connection to the configured Redis server
32
32
  #
33
- # @param params [Hash] Options to establish the database connection
33
+ # @param params [Hash] Options to establish the Redis connection
34
34
  def establish_connection(params)
35
35
  ::Redis.new params
36
+ logger.info "Lemondrop connected to Redis at #{params[:host]}:#{params[:port]}"
36
37
  end
37
-
38
38
  end # class << self
39
39
  end # Service
40
40
 
@@ -0,0 +1,11 @@
1
+ module Lemondrop
2
+ class << self
3
+ def method_missing(meth, *args, &blk)
4
+ if Lemondrop::Plugin::Service.connection && Lemondrop::Plugin::Service.connection.respond_to?(meth)
5
+ Lemondrop::Plugin::Service.connection.send meth, *args, &blk
6
+ else
7
+ super
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Lemondrop
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lemondrop do
4
+ subject { Lemondrop::Plugin::Service }
5
+
6
+ describe 'Lemondrop.do_something' do
7
+ let(:connection) { double 'Lemondrop::Plugin::Service.connection' }
8
+
9
+ it 'gets sent to Redis' do
10
+ Lemondrop::Plugin::Service.stub(:connection).and_return connection
11
+ connection.should_receive(:set).with "foo", "bar"
12
+
13
+ Lemondrop.set "foo", "bar"
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,122 +1,123 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: lemondrop
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 1
9
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Ben Klang
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2013-04-26 00:00:00 -04:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2013-11-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: adhearsion
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
25
17
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 1
30
- version: "2.1"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.1'
31
20
  type: :runtime
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: redis
35
21
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 3
42
- - 0
43
- - 0
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '2.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: redis
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
44
33
  version: 3.0.0
45
34
  type: :runtime
46
- version_requirements: *id002
47
- - !ruby/object:Gem::Dependency
48
- name: bundler
49
35
  prerelease: false
50
- requirement: &id003 !ruby/object:Gem::Requirement
51
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
52
45
  - - ~>
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 1
56
- - 0
57
- version: "1.0"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
58
48
  type: :development
59
- version_requirements: *id003
60
- - !ruby/object:Gem::Dependency
61
- name: rspec
62
49
  prerelease: false
63
- requirement: &id004 !ruby/object:Gem::Requirement
64
- requirements:
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
65
52
  - - ~>
66
- - !ruby/object:Gem::Version
67
- segments:
68
- - 2
69
- - 5
70
- version: "2.5"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.5'
71
62
  type: :development
72
- version_requirements: *id004
73
- - !ruby/object:Gem::Dependency
74
- name: rake
75
63
  prerelease: false
76
- requirement: &id005 !ruby/object:Gem::Requirement
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- segments:
81
- - 0
82
- version: "0"
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '2.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
83
76
  type: :development
84
- version_requirements: *id005
85
- - !ruby/object:Gem::Dependency
86
- name: mocha
87
77
  prerelease: false
88
- requirement: &id006 !ruby/object:Gem::Requirement
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- segments:
93
- - 0
94
- version: "0"
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mocha
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
95
90
  type: :development
96
- version_requirements: *id006
97
- - !ruby/object:Gem::Dependency
98
- name: guard-rspec
99
91
  prerelease: false
100
- requirement: &id007 !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- segments:
105
- - 0
106
- version: "0"
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
107
104
  type: :development
108
- version_requirements: *id007
109
- description: This gem provides a plugin for Adhearsion, allowing you to create and use Redis as a queue or data source in your Adhearsion application.
110
- email:
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: This gem provides a plugin for Adhearsion, allowing you to create and
112
+ use Redis as a queue or data source in your Adhearsion application.
113
+ email:
111
114
  - bklang@mojolingo.com
112
115
  executables: []
113
-
114
116
  extensions: []
115
-
116
117
  extra_rdoc_files: []
117
-
118
- files:
118
+ files:
119
119
  - .gitignore
120
+ - CHANGELOG.md
120
121
  - Gemfile
121
122
  - README.md
122
123
  - Rakefile
@@ -124,39 +125,36 @@ files:
124
125
  - lib/lemondrop.rb
125
126
  - lib/lemondrop/plugin.rb
126
127
  - lib/lemondrop/plugin/service.rb
128
+ - lib/lemondrop/send_connection.rb
127
129
  - lib/lemondrop/version.rb
128
130
  - spec/lemondrop/plugin/service_spec.rb
131
+ - spec/lemondrop/send_connection_spec.rb
129
132
  - spec/spec_helper.rb
130
- has_rdoc: true
131
- homepage: ""
133
+ homepage: ''
132
134
  licenses: []
133
-
135
+ metadata: {}
134
136
  post_install_message:
135
137
  rdoc_options: []
136
-
137
- require_paths:
138
+ require_paths:
138
139
  - lib
139
- required_ruby_version: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- segments:
144
- - 0
145
- version: "0"
146
- required_rubygems_version: !ruby/object:Gem::Requirement
147
- requirements:
148
- - - ">="
149
- - !ruby/object:Gem::Version
150
- segments:
151
- - 0
152
- version: "0"
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
153
150
  requirements: []
154
-
155
151
  rubyforge_project: lemondrop
156
- rubygems_version: 1.3.6
152
+ rubygems_version: 2.0.6
157
153
  signing_key:
158
- specification_version: 3
154
+ specification_version: 4
159
155
  summary: Redis plugin for Adhearsion
160
- test_files:
156
+ test_files:
161
157
  - spec/lemondrop/plugin/service_spec.rb
158
+ - spec/lemondrop/send_connection_spec.rb
162
159
  - spec/spec_helper.rb
160
+ has_rdoc: