win32-taskscheduler 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10db6c303493c5c308511397a042a8595eeb63da
4
- data.tar.gz: 3d8cca5c8168f5232c6cbfb1ffa0924dac6d81d9
3
+ metadata.gz: 73d17d442fa2fa10b337a907dd0c2831b722cf56
4
+ data.tar.gz: 60051a6eb63417dce9a9dd9e2428b32e6afc21c1
5
5
  SHA512:
6
- metadata.gz: 435915b83d71f4f2fb45222d530be067ea6a36d1fb7d4584cd67ef72b7f6f83af677e73b31c03186fb41568c68c5ce0d674c065a9c5dfa50cadf852f19ec8a6e
7
- data.tar.gz: 1c0a7dbe1185f14cbb897510ffe1fa4d99299d2de655ec0e639c00a55fa91976d3b08533e4af3cd2dcdd906afe7c8e2c3fb3d9c8f6ef6f6af4c720d5d87bd914
6
+ metadata.gz: 0b84db2f85f3703e0f60f435d77736100169b20bbc5dd43dcd3ee3a43c6869aa7f8db0bc8fcfc9fd934040e716fbad262e62b1c00b78290df512289a33459e18
7
+ data.tar.gz: 9dcbf5dfd9bca8b15f52741c913d602dacf31ae706c89dda1cb6e25362ca65d98434a8f0e172c33edfe1d8cc9bcce2a087ef5183bb7cf00b3edad1f36374df86
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.3.1 - 6-Jul-2014
2
+ * Added FFI as a dependency. Thanks go to Maxime Lapointe for the spot.
3
+ * Some updates to the win_error helper method. Thanks go to Ethan J. Brown
4
+ for the suggestions.
5
+
1
6
  == 0.3.0 - 15-Jan-2014
2
7
  * Rewritten to use Win32OLE instead of using wrapping the C API. Benefits
3
8
  include working on Windows Vista or later, and working with JRuby.
data/Rakefile CHANGED
@@ -17,9 +17,9 @@ namespace 'gem' do
17
17
  end
18
18
 
19
19
  desc 'Install the win32-taskscheduler library as a gem'
20
- task :install => [:build] do
20
+ task :install => [:create] do
21
21
  file = Dir['win32-taskscheduler*.gem'].first
22
- sh "gem install #{file}"
22
+ sh "gem install -l #{file}"
23
23
  end
24
24
  end
25
25
 
@@ -12,7 +12,7 @@ module Win32
12
12
  include Windows::Helper
13
13
 
14
14
  # The version of the win32-taskscheduler library
15
- VERSION = '0.3.0'
15
+ VERSION = '0.3.1'
16
16
 
17
17
  # The Error class is typically raised if any TaskScheduler methods fail.
18
18
  class Error < StandardError; end
@@ -4,18 +4,27 @@ module Windows
4
4
  module Helper
5
5
  extend FFI::Library
6
6
 
7
+ FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200
8
+ FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000
9
+ FORMAT_MESSAGE_MAX_WIDTH_MASK = 0x000000FF
10
+
7
11
  ffi_lib :kernel32
8
12
 
9
13
  attach_function :FormatMessage, :FormatMessageA,
10
14
  [:ulong, :pointer, :ulong, :ulong, :pointer, :ulong, :pointer], :ulong
11
15
 
12
16
  def win_error(function, err=FFI.errno)
13
- flags = 0x00001000 | 0x00000200
14
17
  buf = FFI::MemoryPointer.new(:char, 1024)
15
18
 
16
- FormatMessage(flags, nil, err , 0x0409, buf, 1024, nil)
19
+ flags = FORMAT_MESSAGE_IGNORE_INSERTS |
20
+ FORMAT_MESSAGE_FROM_SYSTEM |
21
+ FORMAT_MESSAGE_MAX_WIDTH_MASK
22
+
23
+ # 0x0409 == MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)
24
+ # We use English for errors because Ruby uses English for errors.
25
+ len = FormatMessage(flags, nil, err , 0x0409, buf, buf.size, nil)
17
26
 
18
- function + ': ' + buf.read_string.strip
27
+ function + ': ' + buf.read_string(len).strip
19
28
  end
20
29
 
21
30
  def ole_error(function, err)
@@ -41,7 +41,7 @@ class TC_TaskScheduler < Test::Unit::TestCase
41
41
  end
42
42
 
43
43
  test "version constant is set to expected value" do
44
- assert_equal('0.3.0', TaskScheduler::VERSION)
44
+ assert_equal('0.3.1', TaskScheduler::VERSION)
45
45
  end
46
46
 
47
47
  test "account_information method basic functionality" do
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-taskscheduler'
5
- spec.version = '0.3.0'
5
+ spec.version = '0.3.1'
6
6
  spec.authors = ['Park Heesob', 'Daniel J. Berger']
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
13
13
 
14
14
  spec.rubyforge_project = 'win32utils'
15
15
 
16
+ spec.add_dependency('ffi')
16
17
  spec.add_dependency('structured_warnings')
17
18
 
18
19
  spec.add_development_dependency('test-unit')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-taskscheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Park Heesob
@@ -9,8 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-15 00:00:00.000000000 Z
12
+ date: 2014-07-06 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: ffi
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: structured_warnings
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
122
  version: '0'
109
123
  requirements: []
110
124
  rubyforge_project: win32utils
111
- rubygems_version: 2.2.1
125
+ rubygems_version: 2.2.2
112
126
  signing_key:
113
127
  specification_version: 4
114
128
  summary: A library for the Windows task scheduler