nutcracker 0.2.4.7 → 0.2.4.8

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/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
 
4
4
  This library wraps Twitter's [Nutcracker](https://github.com/twitter/twemproxy) in a gem package and provides a simple ruby API to the `nutcracker` executable.
5
5
 
6
- ### DISCLAIMER
7
- this is still a work in progress...
6
+ ### Disclaimer
7
+ this project is still in its early stages, so things could be a little buggy, if you find one, feel free to [report](https://github.com/kontera-technologies/nutcracker/issues) it.
8
8
 
9
9
  ## Motivation
10
10
  The main motivation here is to take the advantages of working with Bundler's dependencies management and to be able to embed Twitter's [Nutcracker](https://github.com/twitter/twemproxy) as a dependency to any Ruby project, this allow you to create small-configuration-only-apps tied to specific version of Nutcracker as I show in the example bellow.
@@ -68,9 +68,12 @@ nutcracker.start
68
68
  nutcracker.join # wait for server to exit
69
69
  ```
70
70
 
71
- ## Wanna build a new version?
71
+ ### Building new gems
72
72
  * Set the version @ `lib/nutcracker/version.rb` ( [Available Versions](https://code.google.com/p/twemproxy/downloads/list) )
73
73
  * run the `rake build` command
74
74
  * look for `nutcracker-X.Y.Z` gem under the pkg folder
75
75
 
76
+ ### Warranty
77
+ This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.
78
+
76
79
  > for more details like licensing etc, please look @ [Nutcracker](https://github.com/twitter/twemproxy)
data/lib/nutcracker.rb CHANGED
@@ -130,14 +130,14 @@ module Nutcracker
130
130
  def redis_info url
131
131
  begin
132
132
  redis = Redis.connect(url: url)
133
- rescue
134
- return Hash.new
133
+ info = redis.info
134
+ db_size = redis.dbsize
135
+ max_memory = redis.config(:get, 'maxmemory')['maxmemory'].to_i
136
+ redis.quit
137
+ rescue Exception
138
+ return {}
135
139
  end
136
-
137
- info = redis.info
138
- db_size = redis.dbsize
139
- max_memory = redis.config(:get, 'maxmemory')['maxmemory'].to_i
140
- redis.quit
140
+
141
141
  {
142
142
  'connections' => info['connected_clients'].to_i,
143
143
  'used_memory' => info['used_memory'].to_f,
@@ -1,3 +1,3 @@
1
1
  module Nutcracker
2
- VERSION = "0.2.4.7"
2
+ VERSION = "0.2.4.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutcracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4.7
4
+ version: 0.2.4.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
236
  version: '0'
237
237
  segments:
238
238
  - 0
239
- hash: 1477241173229409876
239
+ hash: -573202003723177898
240
240
  requirements: []
241
241
  rubyforge_project: ruby-nutcracker
242
242
  rubygems_version: 1.8.25