3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/id-substitutions.rb', line 3
def sub line
return line if not line
unless @raw
ref = ""
if @references.find_index(line[0])
ref = line[0]
line = line[1..-1]
end
datetime = Time.new.to_s.split()[0..1]
date = datetime[0]
time = datetime[1][/[0-9]+:[0-9]+/]
hour = time[/[0-9]+/]
line.gsub! "?", @node
return line if line == "$"
if line[0] == "$"
line = line[1..-1] if line[1..-1]
line = @nodes[line] if @nodes[line]
line = line[0] if line[0]
end
return ref + line
else
return line
end
end
|