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.
Files changed (3) hide show
  1. data/lib/bets/version.rb +1 -1
  2. data/lib/bets.rb +24 -7
  3. metadata +1 -1
data/lib/bets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bets
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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.\#{str}.exists?};@ff.\#{str}.click"
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.\#{str}.exists?};@ff.\#{str}.set(\#{value})"
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.\#{str}.exists?};@ff.\#{str}.\#{name}"
137
+ instance_eval "@ff.wait_until{@ff.#{str}.exists?};@ff.#{str}.#{name}"
138
+ rescue Exception => error
139
+ puts "Ошибка считывания значения из поля #{str}: #{error}"
132
140
  end
133
- результат = FALSE;
134
- #{@names[b[0]]} if результат then #{@names[b[1]]} end;
141
+
142
+ text =<<EOF
143
+ результат = FALSE;
144
+ #{@names[b[0]]}
145
+ if результат
146
+ #{@names[b[1]]}
147
+ end;
135
148
  EOF
136
- instance_eval text
149
+ begin
150
+ instance_eval text
151
+ rescue Exception => error
152
+ puts "Ошибка в программе: #{error}"
153
+ end
137
154
  end
138
155
  end
139
156
  public
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: