bets 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/bets/version.rb +1 -1
- data/lib/bets.rb +24 -7
- metadata +1 -1
data/lib/bets/version.rb
CHANGED
data/lib/bets.rb
CHANGED
@@ -62,6 +62,9 @@ module Bets
|
|
62
62
|
'ИСТИНА' => 'true',
|
63
63
|
'ЛОЖЬ' => 'false'
|
64
64
|
}
|
65
|
+
trap "INT" do
|
66
|
+
Process.exit
|
67
|
+
end
|
65
68
|
instance_eval "betlinks_init"
|
66
69
|
end
|
67
70
|
|
@@ -117,23 +120,37 @@ module Bets
|
|
117
120
|
def exec
|
118
121
|
@binds.each do |b|
|
119
122
|
|
120
|
-
text =<<EOF
|
121
123
|
def ff_goto(str)
|
122
124
|
@ff.goto(str)
|
125
|
+
rescue Exception => error
|
126
|
+
puts "Ошибка открытия страницы #{str}: #{error}"
|
123
127
|
end
|
124
128
|
def ff_click(str)
|
125
|
-
instance_eval "@ff.wait_until{@ff
|
129
|
+
instance_eval "@ff.wait_until{@ff.#{str}.exists?};@ff.#{str}.click"
|
126
130
|
end
|
127
131
|
def ff_set(str, value)
|
128
|
-
instance_eval "@ff.wait_until{@ff
|
132
|
+
instance_eval "@ff.wait_until{@ff.#{str}.exists?};@ff.#{str}.set(#{value})"
|
133
|
+
rescue Exception => error
|
134
|
+
puts "Ошибка установки значения в поле #{str}: #{error}"
|
129
135
|
end
|
130
136
|
def ff_get(str, name)
|
131
|
-
instance_eval "@ff.wait_until{@ff
|
137
|
+
instance_eval "@ff.wait_until{@ff.#{str}.exists?};@ff.#{str}.#{name}"
|
138
|
+
rescue Exception => error
|
139
|
+
puts "Ошибка считывания значения из поля #{str}: #{error}"
|
132
140
|
end
|
133
|
-
|
134
|
-
|
141
|
+
|
142
|
+
text =<<EOF
|
143
|
+
результат = FALSE;
|
144
|
+
#{@names[b[0]]}
|
145
|
+
if результат
|
146
|
+
#{@names[b[1]]}
|
147
|
+
end;
|
135
148
|
EOF
|
136
|
-
|
149
|
+
begin
|
150
|
+
instance_eval text
|
151
|
+
rescue Exception => error
|
152
|
+
puts "Ошибка в программе: #{error}"
|
153
|
+
end
|
137
154
|
end
|
138
155
|
end
|
139
156
|
public
|