goodguide-gibbon 0.11.3 → 0.11.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82fbb34a8e39b9fcde0e687ebab9bdd283532f59
4
- data.tar.gz: 2d89f1edb1117639947eb1d179bb782e91e9e167
3
+ metadata.gz: 0bd09c258129158f9313c83ebda01eb248023591
4
+ data.tar.gz: 7521749f7f88ea8d3d3b3be0208d77e210f6bac4
5
5
  SHA512:
6
- metadata.gz: a8096b1c237f645f88349a62b8e8b5eb00172ebaaa7655abcc8160c2374121810d623ef0c7dac65e509648ce262aa920ad540b0cd4c9fe497cf3e514a1a2031f
7
- data.tar.gz: fd03320f9a84009e09154a1d5e9cf1f6e77ddf90509010ad5026237f25be06f78950abf62f32c71710317e831e472e92e17e515807d46362cb1264a8d0b411a1
6
+ metadata.gz: d532921c46484f25d0f585e3bd9265b67a0429cb15e04f3a830a9c88e7afa82b0b17ed71c655b056a8425c88064ecc329109c50168431610a673c2c865c7cead
7
+ data.tar.gz: 8c3114bae320cb7618a2968807d7a0ea17f0ef889f33c181ce9744f25b8270400b9278a714b6b5a7afb43fb710674eb320c4749e27e6ed59d45258be04ab4d7f
@@ -27,8 +27,9 @@ module GoodGuide
27
27
 
28
28
  ruby_hash = { '__isHash__' => true }
29
29
 
30
- js_hash[:each].methodcall(js_hash, lambda { |a, b, c|
31
- k, v = defined?(JRUBY_VERSION) ? [a, b] : [b, c]
30
+ js_hash[:each].methodcall(js_hash, lambda { |*args|
31
+ args.shift unless defined?(JRUBY_VERSION)
32
+ k, v = args
32
33
  ruby_hash[k] = obj_to_ruby(v)
33
34
  })
34
35
 
@@ -671,7 +671,8 @@ Variant = (function() {
671
671
  if (values.length !== names.length) {
672
672
  throw new TypeError("wrong number of arguments: " + values.length + " for " + names.length);
673
673
  }
674
- return klass.call(this, names, values);
674
+ klass.call(this, names, values);
675
+ return this;
675
676
  };
676
677
  subclass.prototype = allocate(klass.prototype);
677
678
  subclass.prototype._tag = tag;
@@ -957,16 +958,6 @@ Gibbon.Hash = Hash = (function(_super) {
957
958
 
958
959
  saltLen = salt.length;
959
960
 
960
- Hash.prototype.loadKey = function(k) {
961
- return salt + k;
962
- };
963
-
964
- Hash.prototype.dumpKey = function(k) {
965
- if (k.indexOf(salt) === 0) {
966
- return k.slice(saltLen);
967
- }
968
- };
969
-
970
961
  Hash.prototype.get = function(k) {
971
962
  return this[salt + k];
972
963
  };
@@ -985,7 +976,9 @@ Gibbon.Hash = Hash = (function(_super) {
985
976
  for (k in this) {
986
977
  if (!__hasProp.call(this, k)) continue;
987
978
  v = this[k];
988
- _results.push(f(k.slice(saltLen), v));
979
+ if (k.indexOf(salt) === 0) {
980
+ _results.push(f(k.slice(saltLen), v));
981
+ }
989
982
  }
990
983
  return _results;
991
984
  };
@@ -2019,13 +2012,14 @@ analyze = Gibbon.analyze = (function() {
2019
2012
  }
2020
2013
 
2021
2014
  NativeContext.prototype.query = function(id, query, cb) {
2022
- var cacheKey,
2015
+ var cacheKey, lookupFn,
2023
2016
  _this = this;
2024
2017
  cacheKey = "" + id + "/" + query.type + " " + (query.args.join(' '));
2025
2018
  if (this.queryCache.has(cacheKey)) {
2026
2019
  return Thunk.trampoline(cb(this.queryCache.get(cacheKey)));
2027
2020
  }
2028
- return this.externalLookup.call(null, id, query, Type, function(err, analysis) {
2021
+ lookupFn = this.externalLookup;
2022
+ return lookupFn(id, query, Type, function(err, analysis) {
2029
2023
  var result;
2030
2024
  result = err ? TypeLookup.error(err) : TypeLookup.response(query, analysis);
2031
2025
  _this.queryCache.set(cacheKey, result);
@@ -6423,10 +6417,23 @@ Gibbon.CompiledCode = CompiledCode = (function() {
6423
6417
  };
6424
6418
 
6425
6419
  CompiledCode.prototype.outputType = function(key) {
6420
+ var e, type;
6426
6421
  if (key == null) {
6427
6422
  key = '/';
6428
6423
  }
6429
- return this.semantics.get(key).flow.type;
6424
+ try {
6425
+ type = this.semantics.get(key).flow.type;
6426
+ if (type == null) {
6427
+ throw "null type at " + key + ": " + (JSON.stringify(this.semantics));
6428
+ }
6429
+ if (!type.cases) {
6430
+ throw "type without cases at " + key + ": JSON.stringify(@semantics)}";
6431
+ }
6432
+ return type;
6433
+ } catch (_error) {
6434
+ e = _error;
6435
+ throw "" + e + " thrown at " + key + ": " + (JSON.stringify(this.semantics));
6436
+ }
6430
6437
  };
6431
6438
 
6432
6439
  return CompiledCode;
@@ -661,7 +661,8 @@ Variant = (function() {
661
661
  if (values.length !== names.length) {
662
662
  throw new TypeError("wrong number of arguments: " + values.length + " for " + names.length);
663
663
  }
664
- return klass.call(this, names, values);
664
+ klass.call(this, names, values);
665
+ return this;
665
666
  };
666
667
  subclass.prototype = allocate(klass.prototype);
667
668
  subclass.prototype._tag = tag;
@@ -947,16 +948,6 @@ Gibbon.Hash = Hash = (function(_super) {
947
948
 
948
949
  saltLen = salt.length;
949
950
 
950
- Hash.prototype.loadKey = function(k) {
951
- return salt + k;
952
- };
953
-
954
- Hash.prototype.dumpKey = function(k) {
955
- if (k.indexOf(salt) === 0) {
956
- return k.slice(saltLen);
957
- }
958
- };
959
-
960
951
  Hash.prototype.get = function(k) {
961
952
  return this[salt + k];
962
953
  };
@@ -975,7 +966,9 @@ Gibbon.Hash = Hash = (function(_super) {
975
966
  for (k in this) {
976
967
  if (!__hasProp.call(this, k)) continue;
977
968
  v = this[k];
978
- _results.push(f(k.slice(saltLen), v));
969
+ if (k.indexOf(salt) === 0) {
970
+ _results.push(f(k.slice(saltLen), v));
971
+ }
979
972
  }
980
973
  return _results;
981
974
  };
@@ -2005,13 +1998,14 @@ analyze = Gibbon.analyze = (function() {
2005
1998
  }
2006
1999
 
2007
2000
  NativeContext.prototype.query = function(id, query, cb) {
2008
- var cacheKey,
2001
+ var cacheKey, lookupFn,
2009
2002
  _this = this;
2010
2003
  cacheKey = "" + id + "/" + query.type + " " + (query.args.join(' '));
2011
2004
  if (this.queryCache.has(cacheKey)) {
2012
2005
  return Thunk.trampoline(cb(this.queryCache.get(cacheKey)));
2013
2006
  }
2014
- return this.externalLookup.call(null, id, query, Type, function(err, analysis) {
2007
+ lookupFn = this.externalLookup;
2008
+ return lookupFn(id, query, Type, function(err, analysis) {
2015
2009
  var result;
2016
2010
  result = err ? TypeLookup.error(err) : TypeLookup.response(query, analysis);
2017
2011
  _this.queryCache.set(cacheKey, result);
@@ -6360,10 +6354,23 @@ Gibbon.CompiledCode = CompiledCode = (function() {
6360
6354
  };
6361
6355
 
6362
6356
  CompiledCode.prototype.outputType = function(key) {
6357
+ var e, type;
6363
6358
  if (key == null) {
6364
6359
  key = '/';
6365
6360
  }
6366
- return this.semantics.get(key).flow.type;
6361
+ try {
6362
+ type = this.semantics.get(key).flow.type;
6363
+ if (type == null) {
6364
+ throw "null type at " + key + ": " + (JSON.stringify(this.semantics));
6365
+ }
6366
+ if (!type.cases) {
6367
+ throw "type without cases at " + key + ": JSON.stringify(@semantics)}";
6368
+ }
6369
+ return type;
6370
+ } catch (_error) {
6371
+ e = _error;
6372
+ throw "" + e + " thrown at " + key + ": " + (JSON.stringify(this.semantics));
6373
+ }
6367
6374
  };
6368
6375
 
6369
6376
  return CompiledCode;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gibbon",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "A data language",
5
5
  "keywords": ["language"],
6
6
  "author": "Jay Adkisson <jjmadkisson at gmail dot com>",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goodguide-gibbon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Adkisson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-01 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Run and analyze gibbon code from ruby or a browser (via a ruby app).
14
14
  email:
@@ -19,35 +19,35 @@ extensions:
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - Gemfile
22
- - ext/mkrf_conf.rb
23
22
  - goodguide-gibbon.gemspec
24
23
  - lib/goodguide/gibbon.rb
25
24
  - lib/goodguide/gibbon/version.rb
26
- - vendor/gibbon/gibbon.browser.dev.js
27
- - vendor/gibbon/gibbon.browser.js
28
25
  - vendor/gibbon/package.json
26
+ - vendor/gibbon/gibbon.browser.js
27
+ - vendor/gibbon/gibbon.browser.dev.js
28
+ - ext/mkrf_conf.rb
29
29
  homepage: http://github.com/GoodGuide/goodguide-gibbon
30
30
  licenses: []
31
31
  metadata: {}
32
- post_install_message:
32
+ post_install_message:
33
33
  rdoc_options: []
34
34
  require_paths:
35
35
  - lib
36
36
  required_ruby_version: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  requirements:
43
- - - ">="
43
+ - - '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  requirements: []
47
47
  rubyforge_project: goodguide-gibbon
48
- rubygems_version: 2.2.2
49
- signing_key:
48
+ rubygems_version: 2.1.9
49
+ signing_key:
50
50
  specification_version: 4
51
51
  summary: Ruby bindings for the gibbon data language
52
52
  test_files: []
53
- has_rdoc:
53
+ has_rdoc: