fbe 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fbe/fb.rb +1 -1
  3. data/lib/fbe.rb +1 -1
  4. data/rules/basic.fe +28 -9
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edccc9ab59eb5ab03d811f50b8767dd78cceb04ae1f7100ff69087751c0a8a91
4
- data.tar.gz: 381aa6f00db80c484e929aa139b252228fc932d96be2f0eab2d320e8e7066c0b
3
+ metadata.gz: fab7625b074b08c9833722e095ed311608a4a327c4c0b3388ec498675f7547d3
4
+ data.tar.gz: 25ae45a82dd59a4a1a98b6bf4850e073839371eed3fd3b1a23b94698151e0354
5
5
  SHA512:
6
- metadata.gz: 45d8726787ae9bfdd718980a3cb43662a1e1accc166db30ea464f89328a676fa77fb7cbd7407fe65ff2ece0558aca8fdec8f06b6d0969f59cd2ce7ef88895d88
7
- data.tar.gz: b03684b1597f8bbb7b80b28d67655c5a89e99afdbc6a9206b141a69a266065c5508ce7130ee073e09329f98eb717467c29ff9d7b3f97a76183dff50b4624e4e4
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[0]
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
@@ -27,5 +27,5 @@
27
27
  # License:: MIT
28
28
  module Fbe
29
29
  # Current version of the gem (changed by .rultor.yml on every release)
30
- VERSION = '0.0.5'
30
+ VERSION = '0.0.6'
31
31
  end
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
- (matches what "^[a-z]+(-[a-z]+)*$")))
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
- (eq "Time" (type _time))))
62
+ (and
63
+ (one _time)
64
+ (eq "Time" (type _time)))))
56
65
 
57
66
  (explain (when
58
67
  (exists _version)
59
- (eq "String" (type _version))))
68
+ (and
69
+ (one _version)
70
+ (eq "String" (type _version)))))
60
71
 
61
72
  (explain (when
62
73
  (exists why)
63
- (eq "String" (type why))))
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
- (eq "Time" (type when))))
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko