win32-service 0.8.2 → 0.8.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c52768b016ef3a9947a0ca64496067ec76ae75a
4
- data.tar.gz: 79a37c086022643af8f1691b8d49682976aa6f2a
3
+ metadata.gz: 00420c9a08f4efbc505916adfdf394aaa827d88d
4
+ data.tar.gz: 7cc804d073520c13b7a0d3cb376eef7594131d7b
5
5
  SHA512:
6
- metadata.gz: 7346088e3cba19b598f03a2e736dac8ef90f16e07adb52f0a16702ec700d1513877ae3ed3cf3eb7def02d26efdab0d98c4578a66a51dd33b3a4c2a53204c7c82
7
- data.tar.gz: ca96bdc251b1ea198d1b5ebe045a6425e15def41f32daad345d1a4c12904d8d1775f3cbb36e14ba2e9474166d9aeecf24046473b53325cde9275e907f184a004
6
+ metadata.gz: 2468f2cddb5f34466323c9e000d5655fe533c67b120e836bb79cdc08359afc44087b35031a3815d6d2b809650c7c060dfe8f51779f2e0c201f29c6462b16550d
7
+ data.tar.gz: d37585b5947428e224cd0840ddc806c6a5359971a1eedd3bd3b325eff0a1914e1c5fb07177a10a5ed81a01cb9b644a49e3e6b351fb302e5d5e43e5ca5da1621d
data/CHANGES CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.8.3 - 1-Nov-2013
2
+ * Fixed a bug where a service's state could be changed when merely
3
+ interrogating the service. Thanks go to Glenn Sarti / Puppet Labs
4
+ for the spot.
5
+ * Fixed a bug where attempting to get the description of a service that
6
+ has no description could raise an error. Now an empty string is returned.
7
+
1
8
  == 0.8.2 - 13-Aug-2013
2
9
  * Fixed a bug in the Service.start method where it was not handling arguments
3
10
  properly. Thanks go to Sean Karlage for the spot.
data/lib/win32/daemon.rb CHANGED
@@ -18,7 +18,7 @@ module Win32
18
18
  extend Windows::Functions
19
19
 
20
20
  # The version of this library
21
- VERSION = '0.8.2'
21
+ VERSION = '0.8.3'
22
22
 
23
23
  private
24
24
 
@@ -118,10 +118,14 @@ module Win32
118
118
  dwState = SERVICE_PAUSED
119
119
  when SERVICE_CONTROL_CONTINUE
120
120
  dwState = SERVICE_RUNNING
121
+ #else
122
+ # TODO: Handle other control codes? Retain the current state?
121
123
  end
122
124
 
123
- # Set the status of the service.
124
- SetTheServiceStatus.call(dwState, NO_ERROR, 0, 0)
125
+ # Set the status of the service except on interrogation.
126
+ unless dwCtrlCode == SERVICE_CONTROL_INTERROGATE
127
+ SetTheServiceStatus.call(dwState, NO_ERROR, 0, 0)
128
+ end
125
129
 
126
130
  # Tell service_main thread to stop.
127
131
  if dwCtrlCode == SERVICE_CONTROL_STOP || dwCtrlCode == SERVICE_CONTROL_SHUTDOWN
data/lib/win32/service.rb CHANGED
@@ -17,7 +17,7 @@ module Win32
17
17
  extend Windows::Functions
18
18
 
19
19
  # The version of the win32-service library
20
- VERSION = '0.8.2'
20
+ VERSION = '0.8.3'
21
21
 
22
22
  # SCM security and access rights
23
23
 
@@ -1064,7 +1064,7 @@ module Win32
1064
1064
 
1065
1065
  buf = get_config2_info(handle_scs, SERVICE_CONFIG_DESCRIPTION)
1066
1066
 
1067
- if buf.read_pointer.null?
1067
+ if buf.is_a?(Fixnum) || buf.read_pointer.null?
1068
1068
  description = ''
1069
1069
  else
1070
1070
  description = buf.read_pointer.read_string
@@ -1338,6 +1338,10 @@ module Win32
1338
1338
 
1339
1339
  err_num = FFI.errno
1340
1340
 
1341
+ # This is a bit hacky since it means we have to check the type of value
1342
+ # we get back, but we don't always want to raise an error either,
1343
+ # depending on what we're trying to get at.
1344
+ #
1341
1345
  if !bool && err_num == ERROR_INSUFFICIENT_BUFFER
1342
1346
  config2_buf = FFI::MemoryPointer.new(:char, bytes_needed.read_ulong)
1343
1347
  elsif err_num == ERROR_FILE_NOT_FOUND
@@ -17,7 +17,7 @@ class TC_Daemon < Test::Unit::TestCase
17
17
  end
18
18
 
19
19
  test "version number is set properly" do
20
- assert_equal('0.8.2', Daemon::VERSION)
20
+ assert_equal('0.8.3', Daemon::VERSION)
21
21
  end
22
22
 
23
23
  test "constructor basic functionality" do
@@ -52,7 +52,7 @@ class TC_Win32_Service < Test::Unit::TestCase
52
52
  end
53
53
 
54
54
  test "version number is expected value" do
55
- assert_equal('0.8.2', Win32::Service::VERSION)
55
+ assert_equal('0.8.3', Win32::Service::VERSION)
56
56
  end
57
57
 
58
58
  test "services basic functionality" do
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-service'
5
- spec.version = '0.8.2'
5
+ spec.version = '0.8.3'
6
6
  spec.authors = ['Daniel J. Berger', 'Park Heesob']
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
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.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-13 00:00:00.000000000 Z
12
+ date: 2013-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.0.3
115
+ rubygems_version: 2.1.10
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: An interface for MS Windows services