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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0bd981045950a59b0f29f63f7800d15dedaad68
4
- data.tar.gz: 6c83a226cf2869ac01bc6b8b31f9eb5368f958e3
3
+ metadata.gz: 7471df6d70bb592054a2af7c3c5c1ff1ab8c0f8c
4
+ data.tar.gz: 6f7524eb8b95366ce4150421d5bd3e1811d242f5
5
5
  SHA512:
6
- metadata.gz: 0b70263c98a9f183a90b2dfff72e3e93f01dbc5d68167835492917adb9a045e7969d09e41afea1a24e2b812602a353123f2c23a352a4faf4d444cc0cb4ae0d9a
7
- data.tar.gz: f18ee09e17e8b396a3fa26a15ef1c8c7c48f26079df5679962e40dc3e620544be8ec05896ede434237936bafe102229c441487c6ee4d415c21c1bc088c5d7a61
6
+ metadata.gz: 632a6d4885dadc45b4457835aa83ca31544da964300b9bd4283e21c04fa5773b488edd298b962de8332e970c50f354e8cab0e7396cd86e9334da625afc2bf3d0
7
+ data.tar.gz: daaf4a3fdd304dd0e1983ee2158613a259bfdd9b66b8c910ea737abd3f8ce5a802e8de9167de9a192b44881182eff3b9944df1c804f7049e3abb6dfdcb030bd8
@@ -7,14 +7,13 @@ require 'json'
7
7
  module Lightning
8
8
  module Bolt
9
9
  class Codex
10
- def initialize(bookstore, theorems, reports, memory)
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
- #rule = rotar(rule, @keys["keys"]["remember"]) ? remember(rule) : rule
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
- #end
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(index)
289
- return @memory[index]
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
- rule = decrypt(bank[0])
295
- @memory[bank[1]] = rule
296
- return rule
297
- end
298
-
299
- def unique?(rule)
300
- @memories.each do | memory |
301
- if memory.eql?(rule)
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
@@ -44,10 +44,6 @@ module Lightning
44
44
  return false
45
45
  end
46
46
  end
47
-
48
- def urandom()
49
- return system('cat /dev/urandom | base64 | head -c 5')
50
- end
51
47
  end
52
48
  end
53
49
  end
@@ -13,6 +13,6 @@ keys:
13
13
  range: \[.+\.\..+\]
14
14
  repeat: \{[0-9]+:[0-9]+\}
15
15
  subsets: \[(\\-|.-\\.|.-.|\\.|.)+\]
16
- memorize: +:[a-zA-Z]+-[a-zA-Z0-9]+
16
+ memorize: (\\+:[a-zA-Z]+(-[a-zA-Z0-9]+)?)
17
17
  subset: \<[0-9]+:[0-9]+\>
18
18
  escapable: \\.
@@ -1,5 +1,5 @@
1
1
  module Lightning
2
2
  module Bolt
3
- VERSION = "1.3.0"
3
+ VERSION = "1.4.0"
4
4
  end
5
5
  end
@@ -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.3.0
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-22 00:00:00.000000000 Z
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