win32-service 0.7.0-x86-mswin32-60 → 0.7.1-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +247 -238
- data/MANIFEST +18 -18
- data/README +74 -45
- data/Rakefile +139 -128
- data/doc/daemon.txt +157 -157
- data/doc/service.txt +365 -368
- data/examples/demo_daemon.rb +89 -89
- data/examples/demo_daemon_ctl.rb +122 -122
- data/examples/demo_services.rb +23 -23
- data/ext/win32/daemon.c +611 -596
- data/lib/win32/daemon.so +0 -0
- data/lib/win32/service.rb +1638 -1607
- data/test/test_win32_daemon.rb +58 -58
- data/test/test_win32_service.rb +409 -251
- data/test/test_win32_service_configure.rb +97 -86
- data/test/test_win32_service_create.rb +131 -103
- data/test/test_win32_service_info.rb +184 -179
- data/test/test_win32_service_status.rb +113 -111
- data/win32-service.gemspec +41 -49
- metadata +6 -6
@@ -1,111 +1,113 @@
|
|
1
|
-
########################################################################
|
2
|
-
#
|
3
|
-
#
|
4
|
-
# Test case for the Struct::ServiceStatus struct.
|
5
|
-
########################################################################
|
6
|
-
require 'rubygems'
|
7
|
-
gem 'test-unit'
|
8
|
-
|
9
|
-
require 'win32/service'
|
10
|
-
require 'test/unit'
|
11
|
-
|
12
|
-
class
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
1
|
+
########################################################################
|
2
|
+
# test_win32_service_status.rb
|
3
|
+
#
|
4
|
+
# Test case for the Struct::ServiceStatus struct.
|
5
|
+
########################################################################
|
6
|
+
require 'rubygems'
|
7
|
+
gem 'test-unit'
|
8
|
+
|
9
|
+
require 'win32/service'
|
10
|
+
require 'test/unit'
|
11
|
+
|
12
|
+
class TC_Win32_ServiceStatus_Struct < Test::Unit::TestCase
|
13
|
+
def setup
|
14
|
+
@service_name = 'Schedule'
|
15
|
+
@service_stat = Win32::Service.status(@service_name)
|
16
|
+
|
17
|
+
@types = [
|
18
|
+
'file system driver',
|
19
|
+
'kernel driver',
|
20
|
+
'own process',
|
21
|
+
'share process',
|
22
|
+
'recognizer token',
|
23
|
+
'driver',
|
24
|
+
'win32',
|
25
|
+
'all',
|
26
|
+
'own process, interactive',
|
27
|
+
'share process, interactive',
|
28
|
+
nil
|
29
|
+
]
|
30
|
+
|
31
|
+
@states = [
|
32
|
+
'continue pending',
|
33
|
+
'pause pending',
|
34
|
+
'paused',
|
35
|
+
'running',
|
36
|
+
'start pending',
|
37
|
+
'stop pending',
|
38
|
+
'stopped',
|
39
|
+
nil
|
40
|
+
]
|
41
|
+
|
42
|
+
@controls = [
|
43
|
+
'netbind change',
|
44
|
+
'param change',
|
45
|
+
'pause continue',
|
46
|
+
'shutdown',
|
47
|
+
'stop',
|
48
|
+
'hardware profile change',
|
49
|
+
'power event',
|
50
|
+
'session change'
|
51
|
+
]
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_service_status_service_type
|
55
|
+
assert_respond_to(@service_stat, :service_type)
|
56
|
+
assert(@types.include?(@service_stat.service_type))
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_service_status_current_state
|
60
|
+
assert_respond_to(@service_stat, :current_state)
|
61
|
+
assert(@states.include?(@service_stat.current_state))
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_service_status_controls_accepted
|
65
|
+
assert_respond_to(@service_stat, :controls_accepted)
|
66
|
+
assert_kind_of(Array, @service_stat.controls_accepted)
|
67
|
+
@service_stat.controls_accepted.each{ |control|
|
68
|
+
assert_true(@controls.include?(control))
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_service_status_win32_exit_code
|
73
|
+
assert_respond_to(@service_stat, :win32_exit_code)
|
74
|
+
assert_kind_of(Fixnum, @service_stat.win32_exit_code)
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_service_status_service_specific_exit_code
|
78
|
+
assert_respond_to(@service_stat, :service_specific_exit_code)
|
79
|
+
assert_kind_of(Fixnum, @service_stat.service_specific_exit_code)
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_service_status_check_point
|
83
|
+
assert_respond_to(@service_stat, :check_point)
|
84
|
+
assert_kind_of(Fixnum, @service_stat.check_point)
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_service_status_wait_hint
|
88
|
+
assert_respond_to(@service_stat, :wait_hint)
|
89
|
+
assert_kind_of(Fixnum, @service_stat.wait_hint)
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_service_status_interactive
|
93
|
+
assert_respond_to(@service_stat, :interactive)
|
94
|
+
assert([true, false].include?(@service_stat.interactive))
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_service_status_pid
|
98
|
+
assert_respond_to(@service_stat, :pid)
|
99
|
+
assert_kind_of(Fixnum, @service_stat.pid)
|
100
|
+
end
|
101
|
+
|
102
|
+
def test_service_status_service_flags
|
103
|
+
assert_respond_to(@service_stat, :service_flags)
|
104
|
+
assert_kind_of(Fixnum, @service_stat.service_flags)
|
105
|
+
end
|
106
|
+
|
107
|
+
def teardown
|
108
|
+
@service_stat = nil
|
109
|
+
@types = nil
|
110
|
+
@states = nil
|
111
|
+
@controls = nil
|
112
|
+
end
|
113
|
+
end
|
data/win32-service.gemspec
CHANGED
@@ -1,49 +1,41 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
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
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
class that is included as part of the library.
|
43
|
-
EOF
|
44
|
-
end
|
45
|
-
|
46
|
-
if $PROGRAM_NAME == __FILE__
|
47
|
-
Gem.manage_gems if Gem::RubyGemsVersion.to_f < 1.0
|
48
|
-
Gem::Builder.new(spec).build
|
49
|
-
end
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'win32-service'
|
5
|
+
spec.version = '0.7.1'
|
6
|
+
spec.authors = ['Daniel J. Berger', 'Park Heesob']
|
7
|
+
spec.license = 'Artistic 2.0'
|
8
|
+
spec.email = 'djberg96@gmail.com'
|
9
|
+
spec.homepage = 'http://www.rubyforge.org/projects/win32utils'
|
10
|
+
spec.platform = Gem::Platform::RUBY
|
11
|
+
spec.summary = 'An interface for MS Windows services'
|
12
|
+
spec.test_files = Dir['test/test*.rb']
|
13
|
+
spec.has_rdoc = true
|
14
|
+
spec.extensions = ['ext/extconf.rb']
|
15
|
+
|
16
|
+
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
17
|
+
|
18
|
+
spec.extra_rdoc_files = [
|
19
|
+
'CHANGES',
|
20
|
+
'README',
|
21
|
+
'MANIFEST',
|
22
|
+
'doc/service.txt',
|
23
|
+
'doc/daemon.txt',
|
24
|
+
'ext/win32/daemon.c'
|
25
|
+
]
|
26
|
+
|
27
|
+
spec.rubyforge_project = 'win32utils'
|
28
|
+
spec.required_ruby_version = '>= 1.8.2'
|
29
|
+
|
30
|
+
spec.add_dependency('windows-pr', '>= 1.0.8')
|
31
|
+
spec.add_development_dependency('test-unit', '>= 2.0.2')
|
32
|
+
|
33
|
+
spec.description = <<-EOF
|
34
|
+
The win32-service library provides a Ruby interface to services on
|
35
|
+
MS Windows. You can create new services, or control, configure and
|
36
|
+
inspect existing services.
|
37
|
+
|
38
|
+
In addition, you can create a pure Ruby service by using the Daemon
|
39
|
+
class that is included as part of the library.
|
40
|
+
EOF
|
41
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: x86-mswin32-60
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2010-02-09 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -21,11 +21,11 @@ dependencies:
|
|
21
21
|
requirements:
|
22
22
|
- - ">="
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 1.0.
|
24
|
+
version: 1.0.8
|
25
25
|
version:
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: test-unit
|
28
|
-
type: :
|
28
|
+
type: :development
|
29
29
|
version_requirement:
|
30
30
|
version_requirements: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 2.0.2
|
35
35
|
version:
|
36
|
-
description: "
|
36
|
+
description: " The win32-service library provides a Ruby interface to services on\n MS Windows. You can create new services, or control, configure and\n inspect existing services.\n\n In addition, you can create a pure Ruby service by using the Daemon\n class that is included as part of the library.\n"
|
37
37
|
email: djberg96@gmail.com
|
38
38
|
executables: []
|
39
39
|
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements: []
|
91
91
|
|
92
92
|
rubyforge_project: win32utils
|
93
|
-
rubygems_version: 1.3.
|
93
|
+
rubygems_version: 1.3.5
|
94
94
|
signing_key:
|
95
95
|
specification_version: 3
|
96
96
|
summary: An interface for MS Windows services
|