goodguide-gibbon 0.14.0 → 0.14.2
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.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/goodguide/gibbon.rb +17 -0
- data/lib/goodguide/gibbon/version.rb +6 -2
- data/vendor/gibbon/gibbon.browser.dev.js +30 -0
- data/vendor/gibbon/gibbon.browser.js +30 -0
- data/vendor/gibbon/package.json +3 -4
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68b9d67850eefaf6beb8331b64d608743564a410
|
4
|
+
data.tar.gz: c570344632c7b9733db5debd4a77b5a4b1bb1c1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec7c7635932a1cf02446cd449812fff7093ead9f3e97a18681edb8d0246192b71bd4ff8265fb6f2e7cafe36be602b5d995fd513930420b77ccb7b948f151892f
|
7
|
+
data.tar.gz: dd413b4032913bf99b45a42862bf761c197c2a6d82727a83692b1dabaee81adf0bc0c187e35bb5d0aa768041e1ae32fe0526740c78a788cdd2da4f3e11384f69
|
data/Gemfile
CHANGED
data/lib/goodguide/gibbon.rb
CHANGED
@@ -340,6 +340,23 @@ module GoodGuide
|
|
340
340
|
raise StaticError.new(*a)
|
341
341
|
end
|
342
342
|
|
343
|
+
# Define custom queries to be made avaialble in Gibbon clients.
|
344
|
+
# Note: DO NOT use `return` within these blocks. Because they're not
|
345
|
+
# functions, this results in a `LocalJumpError` (in MRI ruby) or, even
|
346
|
+
# worse, silently kills the current thread (in JRuby).
|
347
|
+
#
|
348
|
+
# E.g.,
|
349
|
+
# BAD:
|
350
|
+
# query :foo do |arg|
|
351
|
+
# return false unless arg.present?
|
352
|
+
# # ...
|
353
|
+
# end
|
354
|
+
#
|
355
|
+
# GOOD:
|
356
|
+
# query :foo do |arg|
|
357
|
+
# break false unless arg.present?
|
358
|
+
# # ...
|
359
|
+
# end
|
343
360
|
def self.query(type, opts={}, &impl)
|
344
361
|
arity = opts.fetch(:arity, 1)
|
345
362
|
super type, opts do |input, args, builder|
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
1
|
+
# stdlib
|
2
|
+
require 'json'
|
3
|
+
require 'pathname'
|
2
4
|
|
3
5
|
module GoodGuide
|
4
6
|
module Gibbon
|
5
7
|
def self.version
|
6
|
-
|
8
|
+
install_path = Pathname.new(__FILE__).dirname.parent.parent.parent
|
9
|
+
package_json = install_path.join('vendor/gibbon/package.json')
|
10
|
+
JSON.load(package_json.read)['version']
|
7
11
|
end
|
8
12
|
end
|
9
13
|
end
|
@@ -5831,6 +5831,22 @@ stdlib = Gibbon.stdlib = (function() {
|
|
5831
5831
|
return Core.fail('missing');
|
5832
5832
|
}
|
5833
5833
|
},
|
5834
|
+
assert: {
|
5835
|
+
type: parse.type('assert { %a -> bool } = %a -> %a'),
|
5836
|
+
compile: function(input, _arg) {
|
5837
|
+
var cond;
|
5838
|
+
cond = _arg[0];
|
5839
|
+
return cond.app(input).branch(input, Core.fail('assertion failed'));
|
5840
|
+
}
|
5841
|
+
},
|
5842
|
+
"assert-any": {
|
5843
|
+
type: parse.type('assert-any = [%a] -> [%a]'),
|
5844
|
+
compile: function(input, _arg) {
|
5845
|
+
var cond;
|
5846
|
+
cond = _arg[0];
|
5847
|
+
return input.len().op2('>', Core.constant(0)).branch(input, Core.fail('empty list'));
|
5848
|
+
}
|
5849
|
+
},
|
5834
5850
|
blank: {
|
5835
5851
|
type: parse.type('blank = % -> %a'),
|
5836
5852
|
compile: function() {
|
@@ -6106,6 +6122,20 @@ stdlib = Gibbon.stdlib = (function() {
|
|
6106
6122
|
compile: function() {
|
6107
6123
|
return FALSE;
|
6108
6124
|
}
|
6125
|
+
},
|
6126
|
+
assert: {
|
6127
|
+
type: parse.type('assert { %a -> bool } = %a -> %a'),
|
6128
|
+
compile: function(input, _arg) {
|
6129
|
+
var block;
|
6130
|
+
block = _arg[0];
|
6131
|
+
return block.app(input).branch(input, Core.fail('assert'));
|
6132
|
+
}
|
6133
|
+
},
|
6134
|
+
"assert-any": {
|
6135
|
+
type: parse.type('assert-any = [%a] -> [%a]'),
|
6136
|
+
compile: function(input) {
|
6137
|
+
return input.len().op2('>', Core.constant(0)).branch(input, Core.fail('assert-any'));
|
6138
|
+
}
|
6109
6139
|
}
|
6110
6140
|
};
|
6111
6141
|
})();
|
@@ -5767,6 +5767,22 @@ stdlib = Gibbon.stdlib = (function() {
|
|
5767
5767
|
return Core.fail('missing');
|
5768
5768
|
}
|
5769
5769
|
},
|
5770
|
+
assert: {
|
5771
|
+
type: parse.type('assert { %a -> bool } = %a -> %a'),
|
5772
|
+
compile: function(input, _arg) {
|
5773
|
+
var cond;
|
5774
|
+
cond = _arg[0];
|
5775
|
+
return cond.app(input).branch(input, Core.fail('assertion failed'));
|
5776
|
+
}
|
5777
|
+
},
|
5778
|
+
"assert-any": {
|
5779
|
+
type: parse.type('assert-any = [%a] -> [%a]'),
|
5780
|
+
compile: function(input, _arg) {
|
5781
|
+
var cond;
|
5782
|
+
cond = _arg[0];
|
5783
|
+
return input.len().op2('>', Core.constant(0)).branch(input, Core.fail('empty list'));
|
5784
|
+
}
|
5785
|
+
},
|
5770
5786
|
blank: {
|
5771
5787
|
type: parse.type('blank = % -> %a'),
|
5772
5788
|
compile: function() {
|
@@ -6042,6 +6058,20 @@ stdlib = Gibbon.stdlib = (function() {
|
|
6042
6058
|
compile: function() {
|
6043
6059
|
return FALSE;
|
6044
6060
|
}
|
6061
|
+
},
|
6062
|
+
assert: {
|
6063
|
+
type: parse.type('assert { %a -> bool } = %a -> %a'),
|
6064
|
+
compile: function(input, _arg) {
|
6065
|
+
var block;
|
6066
|
+
block = _arg[0];
|
6067
|
+
return block.app(input).branch(input, Core.fail('assert'));
|
6068
|
+
}
|
6069
|
+
},
|
6070
|
+
"assert-any": {
|
6071
|
+
type: parse.type('assert-any = [%a] -> [%a]'),
|
6072
|
+
compile: function(input) {
|
6073
|
+
return input.len().op2('>', Core.constant(0)).branch(input, Core.fail('assert-any'));
|
6074
|
+
}
|
6045
6075
|
}
|
6046
6076
|
};
|
6047
6077
|
})();
|
data/vendor/gibbon/package.json
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "gibbon",
|
3
|
-
"version": "0.14.
|
3
|
+
"version": "0.14.2",
|
4
4
|
"description": "A data language",
|
5
5
|
"keywords": ["language"],
|
6
|
-
"author": "Jeanine Adkisson <
|
6
|
+
"author": "Jeanine Adkisson <jeanine.adkisson@gmail.com>",
|
7
7
|
"repository": "git://github.com/GoodGuide/gibbon",
|
8
8
|
|
9
9
|
"files": ["index.js", "src", "test", "Makefile", "package.json"],
|
@@ -12,8 +12,7 @@
|
|
12
12
|
"mocha": "1.8.x",
|
13
13
|
"chai": "1.5.x",
|
14
14
|
"coffee-script": "1.6.x",
|
15
|
-
"supervisor": "0.5.x"
|
16
|
-
"node-inspector": "0.2.x"
|
15
|
+
"supervisor": "0.5.x"
|
17
16
|
},
|
18
17
|
"dependencies": {
|
19
18
|
"parsimmon": "0.6.x",
|
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.14.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeanine Adkisson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-22 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:
|
@@ -45,9 +45,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
45
|
version: '0'
|
46
46
|
requirements: []
|
47
47
|
rubyforge_project: goodguide-gibbon
|
48
|
-
rubygems_version: 2.
|
48
|
+
rubygems_version: 2.4.5.1
|
49
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:
|