led 0.2.0 → 0.2.1

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 +5 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3ce0556bf6f8aa9461bf1230790088181e068e5
4
- data.tar.gz: 56b6fd439bbdc6f23be450121f7aa76fd9715105
3
+ metadata.gz: a21ab33fb2807835562b391886b84e45e89e82fa
4
+ data.tar.gz: afe3ee4adfc69ddc739bb728532226fad6bc4566
5
5
  SHA512:
6
- metadata.gz: 09e130a6bad6aab2488a2da7341ca663347611d031333b2bac0d44664c479138b75eac808f1f81244839106e892308aa8cd24e45074e17d02f1ce984f72db1f2
7
- data.tar.gz: d4d538d7ec020cd533cb75decb7c2c65f7bea151af3702fb1a9dc150b9391a6ff1ce0698f149a9dd02079d11768f88805bbbc4f3e838676b440ec260031307af
6
+ metadata.gz: 7ab616d037a2101cdf6c4e280ca4d0e9e132221943d741bb1ee2bda5b780aa659cfd4d0740f9cb618662910580a35420de964cf1e64691a8b162106f67d462fc
7
+ data.tar.gz: a0a373537868b23250aac4de3c0c33b5a47d0aabeba7428467349c9f5cc00d19b1a0736065c9c2fef51f33b854e8b2b9fc55e990f33116efd856a6fa386a3170
data/lib/led.rb CHANGED
@@ -39,12 +39,14 @@ module Led
39
39
  @shas[m] = conn.script('load', @scripts[m])
40
40
  conn.evalsha(@shas[m], [], args)
41
41
  else
42
- handle_command_error(e)
42
+ handle_command_error(e, m)
43
43
  end
44
44
  end
45
45
 
46
- def self.handle_command_error(e)
47
- if e.message =~ /([A-Z][a-zA-Z_0-9]+)(?:\:(.+))?/
46
+ def self.handle_command_error(e, method)
47
+ if e.message =~ /^ERR.+user_script\:([0-9]+)\: (.+)$/
48
+ raise e, "#{method}.lua:#{$1}: #{$2}"
49
+ elsif e.message =~ /^([A-Z][a-zA-Z_0-9]+)(?:\:(.+))?/
48
50
  klass = (Object.const_get($1) rescue Redis::CommandError)
49
51
  raise klass, ($2 || '')
50
52
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: led
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner