led 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/led.rb +9 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a835298da09aecfffb3bc9271c2752534a867a01
4
- data.tar.gz: a44ca0714ffad3787af67b713773fa3ab1139b35
3
+ metadata.gz: d3ce0556bf6f8aa9461bf1230790088181e068e5
4
+ data.tar.gz: 56b6fd439bbdc6f23be450121f7aa76fd9715105
5
5
  SHA512:
6
- metadata.gz: 079d2e18f98cdcfba30a92d63edcb020da1c2d179734eedfae983fc57fddd47fac78961c9ecc66825cb6f0ac0779e84c6a989d7f13c5d9cbbc2996e95c5c55ae
7
- data.tar.gz: 6af9b36d1f9dd26815d6dea97551492027e511be31d4f05349d343ce8c600f25635c3495d8511bd82f6d0a9adc63ece05ca4608ff537856b901c69b532f04271
6
+ metadata.gz: 09e130a6bad6aab2488a2da7341ca663347611d031333b2bac0d44664c479138b75eac808f1f81244839106e892308aa8cd24e45074e17d02f1ce984f72db1f2
7
+ data.tar.gz: d4d538d7ec020cd533cb75decb7c2c65f7bea151af3702fb1a9dc150b9391a6ff1ce0698f149a9dd02079d11768f88805bbbc4f3e838676b440ec260031307af
data/lib/led.rb CHANGED
@@ -38,6 +38,15 @@ module Led
38
38
  if e.message =~ /NOSCRIPT/
39
39
  @shas[m] = conn.script('load', @scripts[m])
40
40
  conn.evalsha(@shas[m], [], args)
41
+ else
42
+ handle_command_error(e)
43
+ end
44
+ end
45
+
46
+ def self.handle_command_error(e)
47
+ if e.message =~ /([A-Z][a-zA-Z_0-9]+)(?:\:(.+))?/
48
+ klass = (Object.const_get($1) rescue Redis::CommandError)
49
+ raise klass, ($2 || '')
41
50
  else
42
51
  raise e
43
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: led
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-26 00:00:00.000000000 Z
11
+ date: 2013-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis