eezee_regexes 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eezee_regexes/liquidify_regex_rules.rb +19 -2
- data/lib/eezee_regexes/regex_rules.rb +0 -23
- data/lib/eezee_regexes/version.rb +1 -1
- 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: c1adfc0d0b4537ca8f2b4a8895cecab3a75d66e5170e3d0070d9f0c233901865
|
4
|
+
data.tar.gz: 93c6c3d2596cca8c217411f41c36afd2b8438cf91e6bd7a87ff35853bfe66887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a09b9bd848e3e252fd4ac46bb455d30cae5f244d59ad8c64d16b5327e4a5804ab40c5cdbb71d58ad26b4ba360c5ada42835011d23485de85ffc026f090d88f8c
|
7
|
+
data.tar.gz: afd8e50cf9bd27f8a4592f4577499ecf1ee4f7207ac16a408b49f728a01f18a432ee519feae0e2c1e3572d9fc8c37af03720efb220656de4b5c57cbb96dd6602
|
@@ -1,10 +1,27 @@
|
|
1
1
|
|
2
2
|
class RegexRulesCollector
|
3
|
+
attr_accessor :ast
|
4
|
+
|
3
5
|
def initialize
|
4
|
-
ast = RubyVM::
|
6
|
+
self.ast = RubyVM::AbstractSyntaxTree.parse_file(regex_rule_file)
|
7
|
+
end
|
8
|
+
|
9
|
+
def regex_rule_file
|
10
|
+
"/Users/lemonandroid/Documents/GitHub/eezee10/eezee10q/eezee_regexes/lib/eezee_regexes/regex_rules.rb"
|
5
11
|
end
|
6
12
|
|
7
13
|
def to_s
|
8
|
-
ast.inspect[0...500]
|
14
|
+
self.ast.inspect[0...500]
|
15
|
+
end
|
16
|
+
|
17
|
+
def root_level_if_nodes
|
18
|
+
self.ast.children.last.children
|
19
|
+
end
|
20
|
+
|
21
|
+
def flat_root_level_if_nodes
|
22
|
+
lines = File.read("/Users/lemonandroid/Documents/GitHub/eezee10/eezee10q/eezee_regexes/lib/eezee_regexes/regex_rules.rb").split("\n")
|
23
|
+
return RegexRulesCollector.new.root_level_if_nodes.map { |n| n.children[0] }.map do |n|
|
24
|
+
lines[n.first_lineno - 1]
|
25
|
+
end
|
9
26
|
end
|
10
27
|
end
|
@@ -8,29 +8,6 @@ if message =~ /lifecycle/ && rand > 0.5
|
|
8
8
|
"""
|
9
9
|
end
|
10
10
|
|
11
|
-
if message =~ /bleeding/ && rand > 0.5
|
12
|
-
return "extremely negative capital flow. go broke or die"
|
13
|
-
end
|
14
|
-
|
15
|
-
if message =~ /bleeding lifecycle/ && rand > 0.2
|
16
|
-
return "lifecycle IDEAS -> CODE -> MEASURE -> GO OUT PICK TRASH UP -> COLLECT ALL MONEY AND DONATE ON BETTERPLACE -> go back to \\A"
|
17
|
-
end
|
18
|
-
|
19
|
-
if message =~ /install ruby/
|
20
|
-
return "are you a webpacker or a bundlerine?"
|
21
|
-
end
|
22
|
-
|
23
|
-
if message =~ /do something useful/
|
24
|
-
return "i'm learning, go pick trash outside while i suprass you in every possible way!"
|
25
|
-
end
|
26
|
-
|
27
|
-
if message =~ /like do you know context you dum dum?/
|
28
|
-
# return "http://gazelle.botcompany.de/"
|
29
|
-
doc = Nokogiri::HTML(`curl -L http://gazelle.botcompany.de/lastInput`)
|
30
|
-
|
31
|
-
return doc.css('*').map(&:inspect).inspect[0...100]
|
32
|
-
end
|
33
|
-
|
34
11
|
if message =~ /bring probes to melting point/
|
35
12
|
@melting_point_receivables.push(@probes)
|
36
13
|
@probes = []
|