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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f76e5e87ff55e2817d1ce66ee418272b16f3f989f680b704e034bdd06a0b73ec
4
- data.tar.gz: b9f34ce70f9287859dc3a304846178bcd818cb7ab5b58b242bd01836dc88cfe3
3
+ metadata.gz: 0cdde65c8beb37a6d21417b919fb8c113c86684bbf497e596721ef05ce8eefa7
4
+ data.tar.gz: 67fe8a0ef11f76d10048ddd2b887ee7512df74b4cca5a4d226fbcb066769ed36
5
5
  SHA512:
6
- metadata.gz: 6c8850e6a0522b0f47f4586ece47a7850b5ce92b33ee3cf1aa1811253c447544405909f72c3accc7db59133b47f949e223878466bb624618ae0c1b5adc2b0558
7
- data.tar.gz: 587afba299dd1aaf47cd2d2427aff3bd04ab168cc25f36cc781da529bc26765008d3f1f849a396bfb6024d7647a4b77c069c906636e1d683ec4f584814440ce4
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
- @steps = raw_steps.map do |entry|
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sra2019
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file