fbe 0.0.5 → 0.0.6
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/lib/fbe/fb.rb +1 -1
- data/lib/fbe.rb +1 -1
- data/rules/basic.fe +28 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fab7625b074b08c9833722e095ed311608a4a327c4c0b3388ec498675f7547d3
|
4
|
+
data.tar.gz: 25ae45a82dd59a4a1a98b6bf4850e073839371eed3fd3b1a23b94698151e0354
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9a4b21c1f88fa90307424b15b61f54143e8e044483907fea9fa3b697be95ea9dff8cec442aec4bd4c90887da7f9d6559d0fd766f9217034da95d4c2d3cf72ba
|
7
|
+
data.tar.gz: b6a9fbf625b2874080fe8edb81adc4377e6f9a7b17e3600c890d5e1336b4c5a8c47b97ef04bb39426a46b572dc10cc1962be14f68a3a0850bddda2fc2fcc6bdb
|
data/lib/fbe/fb.rb
CHANGED
@@ -37,7 +37,7 @@ def Fbe.fb
|
|
37
37
|
uid: '_id'
|
38
38
|
)
|
39
39
|
fb = Factbase::Pre.new(fb) do |f|
|
40
|
-
max = $fb.query('(eq _id (max _id))').each.to_a
|
40
|
+
max = $fb.query('(eq _id (max _id))').each.to_a.first
|
41
41
|
f._id = (max.nil? ? 0 : max._id) + 1
|
42
42
|
f._time = Time.now
|
43
43
|
f._version = "#{Factbase::VERSION}/#{Judges::VERSION}/#{$options.judges_action_version}"
|
data/lib/fbe.rb
CHANGED
data/rules/basic.fe
CHANGED
@@ -29,13 +29,23 @@
|
|
29
29
|
return r
|
30
30
|
')
|
31
31
|
|
32
|
+
(explain (when
|
33
|
+
(exists _id)
|
34
|
+
(and
|
35
|
+
(unique _id)
|
36
|
+
(eq "Integer" (type _id))
|
37
|
+
(one _id))))
|
38
|
+
|
32
39
|
(explain (when
|
33
40
|
(exists what)
|
34
|
-
(
|
41
|
+
(and
|
42
|
+
(matches what "^[a-z]+(-[a-z]+)*$")
|
43
|
+
(one what))))
|
35
44
|
|
36
45
|
(explain (when
|
37
46
|
(exists details)
|
38
47
|
(and
|
48
|
+
(one details)
|
39
49
|
(not (matches details " "))
|
40
50
|
(not (matches details "^.{,80}$"))
|
41
51
|
(not (matches details "[^.]$")))))
|
@@ -43,46 +53,54 @@
|
|
43
53
|
(explain (when
|
44
54
|
(exists where)
|
45
55
|
(and
|
56
|
+
(one where)
|
46
57
|
(eq "String" (type where))
|
47
58
|
(eq "github" where))))
|
48
59
|
|
49
|
-
(explain (when
|
50
|
-
(exists _id)
|
51
|
-
(eq "Integer" (type _id))))
|
52
|
-
|
53
60
|
(explain (when
|
54
61
|
(exists _time)
|
55
|
-
(
|
62
|
+
(and
|
63
|
+
(one _time)
|
64
|
+
(eq "Time" (type _time)))))
|
56
65
|
|
57
66
|
(explain (when
|
58
67
|
(exists _version)
|
59
|
-
(
|
68
|
+
(and
|
69
|
+
(one _version)
|
70
|
+
(eq "String" (type _version)))))
|
60
71
|
|
61
72
|
(explain (when
|
62
73
|
(exists why)
|
63
|
-
(
|
74
|
+
(and
|
75
|
+
(one why)
|
76
|
+
(eq "String" (type why)))))
|
64
77
|
|
65
78
|
(explain (when
|
66
79
|
(exists issue)
|
67
80
|
(and
|
81
|
+
(one issue)
|
68
82
|
(eq "Integer" (type issue))
|
69
83
|
(gt issue 0))))
|
70
84
|
|
71
85
|
(explain (when
|
72
86
|
(exists repository)
|
73
87
|
(and
|
88
|
+
(one repository)
|
74
89
|
(eq "Integer" (type repository))
|
75
90
|
(gt repository 0))))
|
76
91
|
|
77
92
|
(explain (when
|
78
93
|
(exists who)
|
79
94
|
(and
|
95
|
+
(one who)
|
80
96
|
(eq "Integer" (type who))
|
81
97
|
(gt who 0))))
|
82
98
|
|
83
99
|
(explain (when
|
84
100
|
(exists when)
|
85
|
-
(
|
101
|
+
(and
|
102
|
+
(one when)
|
103
|
+
(eq "Time" (type when)))))
|
86
104
|
|
87
105
|
(explain (when
|
88
106
|
(exists issue)
|
@@ -95,6 +113,7 @@
|
|
95
113
|
(explain (when
|
96
114
|
(exists award)
|
97
115
|
(and
|
116
|
+
(one award)
|
98
117
|
(eq "Integer" (type award))
|
99
118
|
(exists when)
|
100
119
|
(exists who)
|