travis-ci
47 of 47 new or added lines in 9 files covered. (100.0%)
2775 of 9733 relevant lines covered (28.51%)
0.32 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"
|
× |
12 |
|
|
13 |
@settings = settings
|
× |
14 |
end
|
|
15 |
|
|
16 |
def label |
1✔ |
17 |
_("&IP Address")
|
× |
18 |
end
|
|
19 |
|
|
20 |
def help |
1✔ |
21 |
# TODO: write it
|
|
22 |
""
|
× |
23 |
end
|
|
24 |
|
|
25 |
def opt |
1✔ |
26 |
[:hstretch]
|
× |
27 |
end
|
|
28 |
|
|
29 |
def init |
1✔ |
30 |
self.value = @settings["IPADDR"] |
× |
31 |
end
|
|
32 |
|
|
33 |
def store |
1✔ |
34 |
@settings["IPADDR"] = value |
× |
35 |
end
|
|
36 |
|
|
37 |
def validate |
1✔ |
38 |
return true if Yast::IP.Check(value) |
× |
39 |
|
|
40 |
Yast::Popup.Error(_("No valid IP address.")) |
× |
41 |
focus |
× |
42 |
false
|
× |
43 |
end
|
|
44 |
end
|
|
45 |
end
|
|
46 |
end
|