travis-ci
138 of 138 new or added lines in 20 files covered. (100.0%)
6188 of 9792 relevant lines covered (63.19%)
6.85 hits per line
1 |
require "yast"
|
1✔ |
2 |
require "cwm/common_widgets"
|
1✔ |
3 |
|
|
4 |
Yast.import "IP" |
1✔ |
5 |
Yast.import "Popup" |
1✔ |
6 |
|
|
7 |
module Y2Network |
1✔ |
8 |
module Widgets |
1✔ |
9 |
class IPAddress < CWM::InputField |
1✔ |
10 |
def initialize(settings) |
1✔ |
11 |
textdomain "network"
|
7✔ |
12 |
|
|
13 |
@settings = settings
|
7✔ |
14 |
end
|
|
15 |
|
|
16 |
def label |
1✔ |
17 |
_("&IP Address")
|
1✔ |
18 |
end
|
|
19 |
|
|
20 |
def help |
1✔ |
21 |
# TODO: write it
|
|
22 |
""
|
1✔ |
23 |
end
|
|
24 |
|
|
25 |
def opt |
1✔ |
26 |
[:hstretch]
|
2✔ |
27 |
end
|
|
28 |
|
|
29 |
def init |
1✔ |
|
self.value = @settings.ip_address |
× |
31 |
end
|
|
32 |
|
|
33 |
def store |
1✔ |
|
@settings.ip_address = value
|
× |
35 |
end
|
|
36 |
|
|
37 |
def validate |
1✔ |
38 |
return true if Yast::IP.Check(value) |
1✔ |
39 |
|
|
40 |
Yast::Popup.Error(_("No valid IP address.")) |
1✔ |
41 |
focus |
1✔ |
42 |
false
|
1✔ |
43 |
end
|
|
44 |
end
|
|
45 |
end
|
|
46 |
end
|