lightning-bolt 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lightning/bolt/codex.rb +13 -21
- data/lib/lightning/bolt/fuzzer.rb +0 -4
- data/lib/lightning/bolt/keys.yml +1 -1
- data/lib/lightning/bolt/version.rb +1 -1
- data/lightning-bolt.gemspec +2 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7471df6d70bb592054a2af7c3c5c1ff1ab8c0f8c
|
4
|
+
data.tar.gz: 6f7524eb8b95366ce4150421d5bd3e1811d242f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 632a6d4885dadc45b4457835aa83ca31544da964300b9bd4283e21c04fa5773b488edd298b962de8332e970c50f354e8cab0e7396cd86e9334da625afc2bf3d0
|
7
|
+
data.tar.gz: daaf4a3fdd304dd0e1983ee2158613a259bfdd9b66b8c910ea737abd3f8ce5a802e8de9167de9a192b44881182eff3b9944df1c804f7049e3abb6dfdcb030bd8
|
data/lib/lightning/bolt/codex.rb
CHANGED
@@ -7,14 +7,13 @@ require 'json'
|
|
7
7
|
module Lightning
|
8
8
|
module Bolt
|
9
9
|
class Codex
|
10
|
-
def initialize(bookstore, theorems,
|
10
|
+
def initialize(bookstore, theorems, memory)
|
11
11
|
@cypher = Lightning::Bolt::Cypher.new(bookstore)
|
12
12
|
@fuzzer = Lightning::Bolt::Fuzzer.new('UTF-8')
|
13
13
|
@keys = YAML.load_file("#{File.dirname(__FILE__)}/keys.yml")
|
14
14
|
@passable = true
|
15
15
|
@unique = false
|
16
16
|
@theorems = theorems
|
17
|
-
@reports = reports
|
18
17
|
@memory = memory
|
19
18
|
end
|
20
19
|
|
@@ -49,7 +48,7 @@ module Lightning
|
|
49
48
|
rule = rotar(rule, @keys["keys"]["and"]) ? concat(rule) : rule
|
50
49
|
rule = rotar(rule, @keys["keys"]["exist"]) ? exist(rule) : rule
|
51
50
|
rule = rotar(rule, @keys["keys"]["escapable"]) ? escapable(rule) : rule
|
52
|
-
|
51
|
+
rule = rotar(rule, @keys["keys"]["remember"]) ? remember(rule) : rule
|
53
52
|
return rule
|
54
53
|
end
|
55
54
|
|
@@ -126,8 +125,7 @@ module Lightning
|
|
126
125
|
swap = subranges[@fuzzer.random_number(0,subranges.size)]
|
127
126
|
rule = rule.sub(rangeset, swap)
|
128
127
|
end
|
129
|
-
|
130
|
-
elsif subsets.size > 0
|
128
|
+
elsif subsets.size > 0
|
131
129
|
charset = []
|
132
130
|
subsets.each do | subset |
|
133
131
|
if subset
|
@@ -285,24 +283,18 @@ module Lightning
|
|
285
283
|
return decrypt(rule)
|
286
284
|
end
|
287
285
|
|
288
|
-
def remember(
|
289
|
-
|
290
|
-
end
|
291
|
-
|
292
|
-
def memorize(rule)
|
286
|
+
def remember(rule)
|
287
|
+
cortex = rule.scan(Regexp.new(@keys["keys"]["memorize"]))
|
293
288
|
bank = rule.split("+:")
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
return false
|
303
|
-
end
|
289
|
+
memory = @memory[bank[1]]
|
290
|
+
if memory
|
291
|
+
return memory
|
292
|
+
else
|
293
|
+
bank = rule.split("+:")
|
294
|
+
rule = decrypt(bank[0])
|
295
|
+
memory = decrypt(bank[0])
|
296
|
+
return memory
|
304
297
|
end
|
305
|
-
return true
|
306
298
|
end
|
307
299
|
|
308
300
|
end
|
data/lib/lightning/bolt/keys.yml
CHANGED
data/lightning-bolt.gemspec
CHANGED
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.add_dependency "thor", "~> 0.19"
|
23
23
|
spec.add_dependency "xelor", "~> 0.1"
|
24
|
+
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.11"
|
25
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "minitest", "~> 5.9"
|
26
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lightning-bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austin Vecchio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.9'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5.9'
|
69
83
|
description: A configurable web safe data generator
|
70
84
|
email:
|
71
85
|
- au.vecchio@gmail.com
|