sra2019 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/sra2019.rb +51 -5
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cdde65c8beb37a6d21417b919fb8c113c86684bbf497e596721ef05ce8eefa7
|
4
|
+
data.tar.gz: 67fe8a0ef11f76d10048ddd2b887ee7512df74b4cca5a4d226fbcb066769ed36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a44dbefc831f46bd0b6056ca5fa9b32b860eca9b1ca1669761427538f8af7dc942e61f312e0dfcb37a384e4156b1566e5ba570bf65c76e591c144d399cd8026
|
7
|
+
data.tar.gz: 64611e6f9ac846085ea12f676f74cf46c7d39a08e1423eb7d43ff2575858b9871bebedbd0bdc5ccedc8af430972a705469d14cfe8dab93f12fe79ac3e18ac84b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/sra2019.rb
CHANGED
@@ -21,31 +21,77 @@ class StepsRecorderAnalyser
|
|
21
21
|
@debug = debug
|
22
22
|
content = RXFHelper.read(s).first
|
23
23
|
puts ('content: ' + content.inspect).debug if @debug
|
24
|
-
parse_steps content
|
24
|
+
@steps = parse_steps content
|
25
|
+
@doc = build @steps
|
25
26
|
|
26
27
|
end
|
27
28
|
|
28
|
-
def to_kbml()
|
29
|
+
def to_kbml(options={})
|
29
30
|
|
30
31
|
|
32
|
+
@doc.xml options
|
31
33
|
|
32
34
|
end
|
33
35
|
|
34
36
|
private
|
37
|
+
|
38
|
+
def build(steps)
|
39
|
+
|
40
|
+
xml = RexleBuilder.new
|
41
|
+
|
42
|
+
xml.kbml do
|
43
|
+
|
44
|
+
steps.each do |h|
|
45
|
+
|
46
|
+
comment = h[:user_comment]
|
47
|
+
|
48
|
+
if comment then
|
49
|
+
|
50
|
+
xml.comment! comment
|
51
|
+
|
52
|
+
# is there text to be typed?
|
53
|
+
typed = comment.scan(/\*[^*]+\*/)
|
54
|
+
typed.each { |x| xml.type x[1..-2] }
|
55
|
+
|
56
|
+
xml.sleep if typed
|
57
|
+
|
58
|
+
else
|
59
|
+
|
60
|
+
h[:keys].each do |keyx|
|
61
|
+
|
62
|
+
key, modifier = keyx.split('-').reverse
|
63
|
+
|
64
|
+
if modifier then
|
65
|
+
xml.send(modifier.downcase.to_sym, {key: key.downcase})
|
66
|
+
else
|
67
|
+
xml.send(key.downcase.to_sym)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
xml.sleep
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
Rexle.new(xml.to_a)
|
80
|
+
end
|
35
81
|
|
36
82
|
def parse_steps(s2)
|
37
83
|
|
38
|
-
puts ('s2: ' + s2.inspect).debug if @debug
|
39
84
|
s = s2[/Recording Session.*(?=<)/]
|
85
|
+
puts ('s: ' + s.inspect).debug if @debug
|
40
86
|
|
41
87
|
raw_steps = s.split(/(?=Step \d+:)/)
|
42
88
|
summary = raw_steps.shift
|
43
89
|
|
44
|
-
|
90
|
+
raw_steps.map do |entry|
|
45
91
|
|
46
92
|
a = entry.split(/<br \/>/)
|
47
93
|
raw_keys = a[0][/(?<=\[)[^\]]+/]
|
48
|
-
keys = raw_keys ? raw_keys.split : []
|
94
|
+
keys = raw_keys ? raw_keys.gsub('...','').split : []
|
49
95
|
|
50
96
|
raw_comment = a[0][/User Comment: (.*)/,1]
|
51
97
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|