win32-taskscheduler 2.0.1 → 2.0.4

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.
@@ -1,4 +1,4 @@
1
- require_relative 'sid'
1
+ require_relative "sid"
2
2
 
3
3
  module Win32
4
4
  class TaskScheduler
@@ -221,11 +221,11 @@ module Win32
221
221
  IDLE_PRIORITY_CLASS = 9 # Or 10
222
222
 
223
223
  CLSCTX_INPROC_SERVER = 0x1
224
- CLSID_CTask = [0x148BD520, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8')
225
- CLSID_CTaskScheduler = [0x148BD52A, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8')
226
- IID_ITaskScheduler = [0x148BD527, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8')
227
- IID_ITask = [0x148BD524, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8')
228
- IID_IPersistFile = [0x0000010b, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46].pack('LSSC8')
224
+ CLSID_CTask = [0x148BD520, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack("LSSC8")
225
+ CLSID_CTaskScheduler = [0x148BD52A, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack("LSSC8")
226
+ IID_ITaskScheduler = [0x148BD527, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack("LSSC8")
227
+ IID_ITask = [0x148BD524, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack("LSSC8")
228
+ IID_IPersistFile = [0x0000010b, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46].pack("LSSC8")
229
229
 
230
230
  # Days of month
231
231
 
@@ -1,4 +1,4 @@
1
- require 'ffi'
1
+ require "ffi"
2
2
 
3
3
  module Win32
4
4
  class TaskScheduler
@@ -12,14 +12,14 @@ module Win32
12
12
  ffi_lib :kernel32, :advapi32
13
13
 
14
14
  attach_function :FormatMessage, :FormatMessageA,
15
- [:ulong, :pointer, :ulong, :ulong, :pointer, :ulong, :pointer], :ulong
15
+ %i{ulong pointer ulong ulong pointer ulong pointer}, :ulong
16
16
 
17
- attach_function :ConvertStringSidToSidW, [ :pointer, :pointer ], :bool
18
- attach_function :LookupAccountSidW, [ :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer ], :bool
19
- attach_function :LocalFree, [ :pointer ], :pointer
17
+ attach_function :ConvertStringSidToSidW, %i{pointer pointer}, :bool
18
+ attach_function :LookupAccountSidW, %i{pointer pointer pointer pointer pointer pointer pointer}, :bool
19
+ attach_function :LocalFree, [:pointer], :pointer
20
20
 
21
- def win_error(function, err=FFI.errno)
22
- err_msg = ''
21
+ def win_error(function, err = FFI.errno)
22
+ err_msg = ""
23
23
  flags = FORMAT_MESSAGE_IGNORE_INSERTS |
24
24
  FORMAT_MESSAGE_FROM_SYSTEM |
25
25
  FORMAT_MESSAGE_MAX_WIDTH_MASK
@@ -28,8 +28,8 @@ module Win32
28
28
  # We use English for errors because Ruby uses English for errors.
29
29
 
30
30
  FFI::MemoryPointer.new(:char, 1024) do |buf|
31
- len = FormatMessage(flags, nil, err , 0x0409, buf, buf.size, nil)
32
- err_msg = function + ': ' + buf.read_string(len).strip
31
+ len = FormatMessage(flags, nil, err, 0x0409, buf, buf.size, nil)
32
+ err_msg = function + ": " + buf.read_string(len).strip
33
33
  end
34
34
 
35
35
  err_msg
@@ -43,7 +43,7 @@ module Win32
43
43
  error = match.captures.first.hex
44
44
  win_error(function, error)
45
45
  else
46
- "#{function}: #{err.to_s}"
46
+ "#{function}: #{err}"
47
47
  end
48
48
  end
49
49
  end
@@ -1,4 +1,4 @@
1
- require_relative 'helper'
1
+ require_relative "helper"
2
2
 
3
3
  module FFI
4
4
  class Pointer
@@ -21,10 +21,10 @@ module FFI
21
21
  def wide_to_utf8(wstring)
22
22
  # ensure it is actually UTF-16LE
23
23
  # Ruby likes to mark binary data as ASCII-8BIT
24
- wstring = wstring.force_encoding('UTF-16LE')
24
+ wstring = wstring.force_encoding("UTF-16LE")
25
25
 
26
26
  # encode it all as UTF-8 and remove trailing CRLF and NULL characters
27
- wstring.encode('UTF-8').strip
27
+ wstring.encode("UTF-8").strip
28
28
  end
29
29
  end
30
30
  end
@@ -36,27 +36,27 @@ module Win32
36
36
  ERROR_INSUFFICIENT_BUFFER = 122
37
37
 
38
38
  def self.LocalSystem
39
- from_string_sid('S-1-5-18')
39
+ from_string_sid("S-1-5-18")
40
40
  end
41
41
 
42
42
  def self.NtLocal
43
- from_string_sid('S-1-5-19')
43
+ from_string_sid("S-1-5-19")
44
44
  end
45
45
 
46
46
  def self.NtNetwork
47
- from_string_sid('S-1-5-20')
47
+ from_string_sid("S-1-5-20")
48
48
  end
49
49
 
50
50
  def self.BuiltinAdministrators
51
- from_string_sid('S-1-5-32-544')
51
+ from_string_sid("S-1-5-32-544")
52
52
  end
53
53
 
54
54
  def self.BuiltinUsers
55
- from_string_sid('S-1-5-32-545')
55
+ from_string_sid("S-1-5-32-545")
56
56
  end
57
57
 
58
58
  def self.Guests
59
- from_string_sid('S-1-5-32-546')
59
+ from_string_sid("S-1-5-32-546")
60
60
  end
61
61
 
62
62
  # Converts a string-format security identifier (SID) into a valid, functional SID
@@ -77,13 +77,13 @@ module Win32
77
77
  def self.utf8_to_wide(ustring)
78
78
  # ensure it is actually UTF-8
79
79
  # Ruby likes to mark binary data as ASCII-8BIT
80
- ustring = (ustring + '').force_encoding('UTF-8')
80
+ ustring = (ustring + "").force_encoding("UTF-8")
81
81
 
82
82
  # ensure we have the double-null termination Windows Wide likes
83
83
  ustring += "\000\000" if ustring.empty? || ustring[-1].chr != "\000"
84
84
 
85
85
  # encode it all as UTF-16LE AKA Windows Wide Character AKA Windows Unicode
86
- ustring.encode('UTF-16LE')
86
+ ustring.encode("UTF-16LE")
87
87
  end
88
88
 
89
89
  # Accepts a security identifier (SID) as input.
@@ -97,7 +97,7 @@ module Win32
97
97
  referenced_domain_name_size = FFI::Buffer.new(:long).write_long(0)
98
98
 
99
99
  if LookupAccountSidW(nil, sid, nil, name_size, nil, referenced_domain_name_size, nil)
100
- raise 'Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountSid, and got no error!'
100
+ raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountSid, and got no error!"
101
101
  elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER
102
102
  raise FFI::LastError.error
103
103
  end
@@ -2,29 +2,44 @@ module Win32
2
2
  class TaskScheduler
3
3
  module TimeCalcHelper
4
4
 
5
- # Returns actual no of days for given month;
6
- # Array with a 0 is defined to give actual result without
7
- # any manipulation. eg, DAYS_IN_A_MONTH[1] = 31
8
- # 0(NUMBER) is kept to avoid exceptions during calculations
9
- DAYS_IN_A_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
10
-
11
- # Returns no of days in a given month of a year
5
+ # No of days in given month. Deliberately placed 0 in the
6
+ # beginning to avoid any miscalculations
7
+ #
8
+ DAYS_IN_A_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31].freeze
9
+
10
+ # No of days in a month for given year
11
+ #
12
+ # @param [Integer] month
13
+ # @param [Integer] year
14
+ # @return [Integer] No of days
15
+ #
12
16
  def days_in_month(month, year)
13
- (month == 2 && is_leap_year?(year)) ? 29 : DAYS_IN_A_MONTH[month]
17
+ month == 2 && is_leap_year?(year) ? 29 : DAYS_IN_A_MONTH[month]
14
18
  end
15
19
 
16
- # Year is leap when it is a multiple of 4 and not a multiple of 100.
17
- # But it can be a multiple of 400
20
+ # Checks weather the given year is a leap year or not
21
+ #
22
+ # @param [Integer] year
23
+ # @return [Boolean]
24
+ #
18
25
  def is_leap_year?(year)
19
26
  (((year % 4).zero? && !(year % 100).zero?) || (year % 400).zero?)
20
27
  end
21
28
 
22
- # Returns total time duration in minutes
29
+ # Calculates the total minutes within given PTM format time
30
+ #
31
+ # @param [Integer] time_str
32
+ # @return [Integer] Time duration in minutes
33
+ #
23
34
  def time_in_minutes(time_str)
24
35
  time_in_seconds(time_str) / 60
25
36
  end
26
37
 
27
- # Calculates total time duration in seconds
38
+ # Calculates the total seconds within given PTM format time
39
+ #
40
+ # @param [Integer] time_str the time in PTM format
41
+ # @return [Integer] Time duration in seconds
42
+ #
28
43
  def time_in_seconds(time_str)
29
44
  dt_tm_hash = time_details(time_str)
30
45
  curr_time = Time.now
@@ -54,17 +69,20 @@ module Win32
54
69
  future_time.to_i - curr_time.to_i
55
70
  end
56
71
 
57
- # a will contain extra value of low_rank (in high_rank(eg min));
58
- # b will hold actual low_rank value(ie sec) Example:
59
- # low_rank = 65, high_rank = 2, div_val = 60
60
- # Hence a = 1; b = 5
72
+ # Adjusts the overlapping seconds and returns actual minutes and seconds
73
+ #
74
+ # @example
75
+ # extra_time(65, 2, 60) #=> => [5, 3]
76
+ #
61
77
  def extra_time(low_rank, high_rank, div_val)
62
78
  a, b = low_rank.divmod(div_val)
63
79
  high_rank += a; low_rank = b
64
80
  [low_rank, high_rank]
65
81
  end
66
82
 
67
- def extra_months(month_count, year_count, init_month, init_year)
83
+ # Adjusts the overlapping months and returns actual month and year
84
+ #
85
+ def extra_months(month_count, year_count, _init_month, _init_year)
68
86
  year, month_count = month_count.divmod(12)
69
87
  if year.positive? && month_count.zero?
70
88
  month_count = 12
@@ -74,7 +92,8 @@ module Win32
74
92
  [month_count, year_count]
75
93
  end
76
94
 
77
- # Returns no of actual days with all overloaded months & Years
95
+ # Adjusts the overlapping years and months and returns actual days, month and year
96
+ #
78
97
  def extra_days(days_count, month_count, year_count, init_month, init_year)
79
98
  # Will keep increamenting them with surplus days
80
99
  days = days_count
@@ -82,13 +101,13 @@ module Win32
82
101
  yr = init_year
83
102
 
84
103
  loop do
85
- days -= days_in_month(mth, yr)
86
- break if days <= 0
87
- mth += 1
88
- if mth > 12
89
- mth = 1; yr += 1
90
- end
91
- days_count = days
104
+ days -= days_in_month(mth, yr)
105
+ break if days <= 0
106
+ mth += 1
107
+ if mth > 12
108
+ mth = 1; yr += 1
109
+ end
110
+ days_count = days
92
111
  end
93
112
 
94
113
  # Setting actual incremented values
@@ -98,34 +117,46 @@ module Win32
98
117
  [days_count, month_count, year_count]
99
118
  end
100
119
 
101
- # Extracts "P_Y_M_DT_H_M_S" format and
102
- # Returns a hash with applicable values of
103
- # (keys =>) [:year, :month, :day, :hour, :min, :sec]
104
- # Example: "PT3S" => {sec: 3}
120
+ # Extracts a hash out of given PTM formatted time
121
+ #
122
+ # @param [String] time_str
123
+ # @return [Hash<:year, :month, :day, :hour, :min, :sec>] With their values in Integer
124
+ #
125
+ # @example
126
+ # time_details("PT3S") #=> {sec: 3}
127
+ #
105
128
  def time_details(time_str)
106
129
  tm_detail = {}
107
- if time_str.to_s != ''
130
+ if time_str.to_s != ""
108
131
  # time_str will be like "PxxYxxMxxDTxxHxxMxxS"
109
132
  # Ignoring 'P' and extracting date and time
110
- dt, tm = time_str[1..-1].split('T')
133
+ dt, tm = time_str[1..-1].split("T")
111
134
 
112
135
  # Replacing strings
113
- if dt.to_s != ''
114
- dt['Y'] = 'year' if dt['Y']; dt['M'] = 'month' if dt['M']; dt['D'] = 'day' if dt['D']
115
- dt_tm_array_to_hash(dt, tm_detail)
136
+ if dt.to_s != ""
137
+ dt["Y"] = "year" if dt["Y"]; dt["M"] = "month" if dt["M"]; dt["D"] = "day" if dt["D"]
138
+ dt_tm_string_to_hash(dt, tm_detail)
116
139
  end
117
140
 
118
- if tm.to_s != ''
119
- tm['H'] = 'hour' if tm['H']; tm['M'] = 'min' if tm['M']; tm['S'] = 'sec' if tm['S']
120
- dt_tm_array_to_hash(tm, tm_detail)
141
+ if tm.to_s != ""
142
+ tm["H"] = "hour" if tm["H"]; tm["M"] = "min" if tm["M"]; tm["S"] = "sec" if tm["S"]
143
+ dt_tm_string_to_hash(tm, tm_detail)
121
144
  end
122
145
  end
123
146
  tm_detail
124
147
  end
125
148
 
126
- # Method to convert date/time array to hash
127
- def dt_tm_array_to_hash(arr, tm_detail)
128
- arr.split(/(\d+)/)[1..-1].each_slice(2).inject(tm_detail) { |h, i| h[i.last.to_sym] = i.first; h }
149
+ # Converts the given date/time string to the hash
150
+ #
151
+ # @param [String] str
152
+ # @param [Hash] tm_detail May be loaded
153
+ # @return [Hash]
154
+ #
155
+ # @example
156
+ # dt_tm_string_to_hash("10year3month", {}) #=> {:year=>"10", :month=>"3"}
157
+ #
158
+ def dt_tm_string_to_hash(str, tm_detail)
159
+ str.split(/(\d+)/)[1..-1].each_slice(2).each_with_object(tm_detail) { |i, h| h[i.last.to_sym] = i.first; }
129
160
  end
130
161
  end
131
162
  end
@@ -1,6 +1,6 @@
1
1
  module Win32
2
2
  class TaskScheduler
3
3
  # The version of the win32-taskscheduler library
4
- VERSION = '2.0.1'.freeze
4
+ VERSION = "2.0.4".freeze
5
5
  end
6
6
  end
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: 2.0.1
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Park Heesob
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-11-01 00:00:00.000000000 Z
12
+ date: 2019-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -53,20 +53,6 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
- - !ruby/object:Gem::Dependency
57
- name: rake
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
56
  - !ruby/object:Gem::Dependency
71
57
  name: win32-security
72
58
  requirement: !ruby/object:Gem::Requirement
@@ -81,20 +67,6 @@ dependencies:
81
67
  - - ">="
82
68
  - !ruby/object:Gem::Version
83
69
  version: '0'
84
- - !ruby/object:Gem::Dependency
85
- name: rspec
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '3.0'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '3.0'
98
70
  description: |2
99
71
  The win32-taskscheduler library provides an interface to the MS Windows
100
72
  Task Scheduler. With this interface you can create new scheduled tasks,
@@ -102,19 +74,8 @@ description: |2
102
74
  email: djberg96@gmail.com
103
75
  executables: []
104
76
  extensions: []
105
- extra_rdoc_files:
106
- - README.md
107
- - CHANGELOG.md
108
- - RELEASE_NOTES.md
77
+ extra_rdoc_files: []
109
78
  files:
110
- - CHANGELOG.md
111
- - Gemfile
112
- - README.md
113
- - RELEASE_NOTES.md
114
- - Rakefile
115
- - VERSION
116
- - appveyor.yml
117
- - examples/taskscheduler_example.rb
118
79
  - lib/win32-taskscheduler.rb
119
80
  - lib/win32/taskscheduler.rb
120
81
  - lib/win32/taskscheduler/constants.rb
@@ -122,15 +83,7 @@ files:
122
83
  - lib/win32/taskscheduler/sid.rb
123
84
  - lib/win32/taskscheduler/time_calc_helper.rb
124
85
  - lib/win32/taskscheduler/version.rb
125
- - spec/functional/win32/taskscheduler/time_calc_helper_spec.rb
126
- - spec/functional/win32/taskscheduler_spec.rb
127
- - spec/spec_helper.rb
128
- - spec/unit/win32/taskscheduler/constants_spec.rb
129
- - spec/unit/win32/taskscheduler/time_calc_helper_spec.rb
130
- - spec/unit/win32/taskscheduler_spec.rb
131
- - test/test_taskscheduler.rb
132
- - win32-taskscheduler.gemspec
133
- homepage: http://github.com/chef/win32-taskscheduler
86
+ homepage: https://github.com/chef/win32-taskscheduler
134
87
  licenses:
135
88
  - Artistic-2.0
136
89
  metadata: {}
@@ -154,5 +107,4 @@ rubygems_version: 2.7.6
154
107
  signing_key:
155
108
  specification_version: 4
156
109
  summary: A library for the Windows task scheduler
157
- test_files:
158
- - test/test_taskscheduler.rb
110
+ test_files: []
@@ -1,184 +0,0 @@
1
- # win32-taskscheduler change log
2
-
3
- Note: this log contains only changes from win32-taskscheduler release 0.4.0 and later
4
- -- it does not contain the changes from prior releases. To view change history
5
- prior to release 0.4.0, please visit the [source repository](https://github.com/chef/win32-taskscheduler/commits).
6
-
7
- <!-- latest_release 2.0.1 -->
8
- ## [win32-taskscheduler-2.0.1](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-2.0.1) (2018-11-01)
9
-
10
- #### Merged Pull Requests
11
- - Minor Fix for logon_type flag while task registration [#75](https://github.com/chef/win32-taskscheduler/pull/75) ([Nimesh-Msys](https://github.com/Nimesh-Msys))
12
- - Bump version to 2.0 [#71](https://github.com/chef/win32-taskscheduler/pull/71) ([btm](https://github.com/btm))
13
- <!-- latest_release -->
14
-
15
- <!-- release_rollup since=2.0.0 -->
16
- ### Changes since 2.0.0 release
17
-
18
- #### Merged Pull Requests
19
- - Minor Fix for logon_type flag while task registration [#75](https://github.com/chef/win32-taskscheduler/pull/75) ([Nimesh-Msys](https://github.com/Nimesh-Msys)) <!-- 2.0.1 -->
20
- <!-- release_rollup -->
21
-
22
- <!-- latest_stable_release -->
23
- ## [win32-taskscheduler-2.0.0](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-2.0.0) (2018-10-11)
24
-
25
- #### Merged Pull Requests
26
- - Move helpers under the Win32::TaskScheduler namespace [#70](https://github.com/chef/win32-taskscheduler/pull/70) ([btm](https://github.com/btm))
27
- - Bump version to 2.0 [#71](https://github.com/chef/win32-taskscheduler/pull/71) ([btm](https://github.com/btm))
28
- <!-- latest_stable_release -->
29
-
30
- ## [win32-taskscheduler-1.0.12](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-1.0.12) (2018-10-11)
31
-
32
- #### Merged Pull Requests
33
- - Refactored configure_settings [#67](https://github.com/chef/win32-taskscheduler/pull/67) ([btm](https://github.com/btm))
34
- - Fixing user registration at Non English version of windows [#69](https://github.com/chef/win32-taskscheduler/pull/69) ([Nimesh-Msys](https://github.com/Nimesh-Msys))
35
-
36
- ## [win32-taskscheduler-1.0.10](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-1.0.10) (2018-07-24)
37
-
38
- #### Merged Pull Requests
39
- - Fix exists? method breaking task full path search [#62](https://github.com/chef/win32-taskscheduler/pull/62) ([Vasu1105](https://github.com/Vasu1105))
40
-
41
- ## [win32-taskscheduler-1.0.9](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-1.0.9) (2018-07-23)
42
-
43
- #### Merged Pull Requests
44
- - MSYS-835 Setup appveyor [#55](https://github.com/chef/win32-taskscheduler/pull/55) ([Vasu1105](https://github.com/Vasu1105))
45
- - Remove the cert [#53](https://github.com/chef/win32-taskscheduler/pull/53) ([tas50](https://github.com/tas50))
46
- - Add github templates and codeowners file [#52](https://github.com/chef/win32-taskscheduler/pull/52) ([tas50](https://github.com/tas50))
47
- - Remove the Manifest file and add a gitignore file [#57](https://github.com/chef/win32-taskscheduler/pull/57) ([tas50](https://github.com/tas50))
48
- - [MSYS-827] Add functional test cases [#58](https://github.com/chef/win32-taskscheduler/pull/58) ([Nimesh-Msys](https://github.com/Nimesh-Msys))
49
- - Add DisallowStartIfOnBatteries and StopIfGoingOnBatteries task configs [#61](https://github.com/chef/win32-taskscheduler/pull/61) ([dheerajd-msys](https://github.com/dheerajd-msys))
50
- - Fix priority should return unique value. [#60](https://github.com/chef/win32-taskscheduler/pull/60) ([Vasu1105](https://github.com/Vasu1105))
51
-
52
- ## [win32-taskscheduler-1.0.2](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-1.0.2) (2018-06-13)
53
- - Fix for exists? method returning false for task without full path. [#43](https://github.com/chef/win32-taskscheduler/pull/43)([#Vasu1105](https://github.com/Vasu1105))
54
- - Fix to set user information at the time of creation of task. [#42](https://github.com/chef/win32-taskscheduler/pull/42)([#Vasu1105](https://github.com/Vasu1105))
55
- - Fix exists? method to find task in given path and if path or folder not present return false. [#40](https://github.com/chef/win32-taskscheduler/pull/40)([#Vasu1105](https://github.com/Vasu1105))
56
- - Fix for undefined method nil:Nilclass error when force flag is passed to create folder. [#32](https://github.com/chef/win32-taskscheduler/pull/32)([#Vasu1105](https://github.com/Vasu1105))
57
-
58
- ## [v0.4.1](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-0.4.1) (15-May-2018)
59
- - Fix the issue of "no mapping" while creating Windows task for SYSTEM USERS. [#30](https://github.com/chef/win32-taskscheduler/pull/30) ([#NAshwini](https://github.com/NAshwini))
60
- - Fix for not to set start time if not set if its 0000-00-00T00:00:00 [#29][(https://github.com/chef/win32-taskscheduler/pull/29) ([#Vasu1105](https://github.com/Vasu1105))
61
-
62
-
63
- ## [v0.4.0](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-0.4.0) (5-Apr-2018)
64
- - Updated code to create task without trigger. [#25](https://github.com/chef/win32-taskscheduler/pull/25) ([#Vasu1105](https://github.com/Vasu1105))
65
- - Fix for execution time limit and weeks of month. [#23](https://github.com/chef/win32-taskscheduler/pull/23) ([#Vasu1105](https://github.com/Vasu1105))
66
- - Added methods to get and set principal information of the task. [#22](https://github.com/chef/win32-taskscheduler/pull/22) ([#Nimesh-Msys](https://github.com/Nimesh-Msys))
67
- - Added methods to retrieve settings(all/Idle/Network) of current task. [#21](https://github.com/chef/win32-taskscheduler/pull/21) ([#Nimesh-Msys](https://github.com/Nimesh-Msys))
68
- - Refactored constants, moved predefined MSDN constns to another file. [#20](https://github.com/chef/win32-taskscheduler/pull/20) ([#Nimesh-Msys](https://github.com/Nimesh-Msys))
69
- - Added code to handle on idle trigger and on idle settings. [#19](https://github.com/chef/win32-taskscheduler/pull/19) ([#Vasu1105](https://github.com/Vasu1105))
70
- - Fix for trigger at_logon and at_system_start. [#18](https://github.com/chef/win32-taskscheduler/pull/18) ([#Nimesh-Msys](https://github.com/Nimesh-Msys))
71
- - Added get_task and enabled? method. [#17](https://github.com/chef/win32-taskscheduler/pull/17) ([#Vasu1105](https://github.com/Vasu1105))
72
- - Fix for undefined method 'weeks' error while updating week_of_month[#16](https://github.com/chef/win32-taskscheduler/pull/16) ([#Vasu1105](https://github.com/Vasu1105))
73
- - Fix for handling days of month for trigger_type MONTHLYDATE. [#15](https://github.com/chef/win32-taskscheduler/pull/15)([#Vasu1105](https://github.com/Vasu1105))
74
- - Fix for setting system user for scheduled task. [#14](https://github.com/chef/win32-taskscheduler/pull/14) ([#Vasu1105](https://github.com/Vasu1105))
75
- - Fix for Wrong value is set for end_day, end_year, end_month it should be EndBoundary and not StartBoundary. [#13](https://github.com/chef/win32-taskscheduler/pull/13)([#Vasu1105](https://github.com/Vasu1105))
76
-
77
- ## [v0.3.2](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-0.3.2) (18-Mar-2017)
78
- - Use the block form for FFI::MemoryPointer in the error message helper
79
- function. Thanks go to Ethan Brown for the suggestion.
80
- - Fixed a potential bug in the helper module, which was also renamed to
81
- help prevent any name collisions.
82
- - Added the win32-taskscheduler.rb file for convenience.
83
- - Added the configure_settings method.
84
- - Added the configure_registration_info method.
85
- - Added the description and description= aliases for comments.
86
- - Added the author and author= aliases for creator.
87
- - Some internal cleanup, moving common code to private methods.
88
- - Rakefile now assumes Rubygems 2.0 or later for tasks.
89
- - Gemspec cleanup, updated home page, removed old rubyforge_project reference.
90
- - This gem is now signed.
91
-
92
- ## [v0.3.1](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-0.3.1) (6-Jul-2014)
93
- - Added FFI as a dependency. Thanks go to Maxime Lapointe for the spot.
94
- - Some updates to the win_error helper method. Thanks go to Ethan J. Brown
95
- for the suggestions.
96
-
97
- ## [v0.3.0](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-0.3.0) (15-Jan-2014)
98
- - Rewritten to use Win32OLE instead of using wrapping the C API. Benefits
99
- include working on Windows Vista or later, and working with JRuby.
100
- - Modified the constructor to accept 3rd and 4th arguments. These indicate
101
- which folder to use, and whether or not to create it if it doesn't exist.
102
- - The TaskScheduler#save method is now no longer necessary. It is retained
103
- for backwards compatibility, but will raise a deprecation warning. In this
104
- version simply calling TaskScheduler#activate will implement the task.
105
- - Added support for the AT_SYSTEMSTART, AT_LOGON and ON_IDLE trigger types.
106
- - Now requires the structured_warnings gem.
107
- - Removed the doc directory and separate documentation file. Everything is
108
- inlined now. There's still an example under the "examples" directory, too.
109
- - Added test-unit, rake, and win32-security as development dependencies.
110
- These are needed for testing only.
111
-
112
- ## [v0.2.2](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-0.2.2)(29-Feb-2012)
113
- - Moved some include statements inside the TaskScheduler class to avoid
114
- polluting Object. Thanks go to Josh Cooper for the spot and patch.
115
- - Minor formatting tweaks to silence 1.9 warnings.
116
-
117
- ## [v0.2.1](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-0.2.1) (8-Oct-2011)
118
- - Fixed a bug that would not allow task to run as SYSTEM. Thanks go to
119
- Josh cooper for the spot and patch.
120
- - Fixed a bug in new_work_item that would cause it to crash if you tried
121
- to create a work item that already existed. An error is now raised instead.
122
- Thanks go to Pete Higgins for the spot.
123
- - The set_trigger and trigger= methods now internally transform and validate
124
- the trigger hash in the same manner as new_work_item. Thanks again go to
125
- Pete Higgins.
126
- - Cleaned up the repo. The C source files have been removed from the main
127
- repository (and this gem). They are in a separate branch on github for
128
- anyone who misses them.
129
- - Refactored the Rakefile, removing tasks related to the old C source files,
130
- and added tasks for cleaning, building and installing a gem.
131
- - Updated the README file, eliminating references to anything that was only
132
- related to the older C version.
133
-
134
- ## [v0.2.0](https://github.com/chef/win32-taskscheduler/tree/win32-taskscheduler-0.2.0)(19-Jun-2009)
135
- - Rewritten in pure Ruby!
136
- - The TaskScheduler::ONCE constant is now a valid trigger type. Thanks go to
137
- Uri Iurgel for the spot and patch.
138
- - Added the TaskScheduler#exists? method.
139
- - Added the TaskScheduler#tasks alias for the TaskScheduler#enum method.
140
- - The TaskScheduler#new_work_item method now accepts symbols as well as
141
- strings for hash keys, and ignores case. Also, the keys are now validated.
142
- - Renamed the example file and test file.
143
- - Added the 'example' Rake task.
144
- - Fixed some code in the README synopsis that was incorrect.
145
-
146
- ## [v0.1.0](11-May-2008)
147
- - The TaskScheduler#save instance method now accepts an optional file name.
148
- - Most of the TaskScheduler setter methods now return the value specified
149
- instead of true.
150
- - Removed the RUN_ONLY_IF_DOCKED and RUN_IF_CONNECTED_TO_INTERNET constants.
151
- The MSDN docs say that they are unused.
152
- - Added more documentation. Much more rdoc friendly now.
153
- - Added many more tests.
154
- - Better type handling for bad arguments.
155
- - Added a Rakefile with tasks for building, installation and testing.
156
- - Added a gemspec.
157
- - Inlined the rdoc documentation.
158
- - Internal project reorganization and code cleanup.
159
-
160
- ## [v0.0.3](1-Mar-2005)
161
- - Bug fix for the bitFieldToHumanDays() internal function.
162
- - Moved the 'examples' directory to the toplevel directory.
163
- - Made the CHANGES and README files rdoc friendly.
164
- - Minor updates to taskscheduler.h.
165
-
166
- ## [v0.0.2](04-Aug-2004)
167
- - Now uses the newer allocation framework and replaced all instances of the
168
- deprecated STR2CSTR() function with StringValuePtr(). This means that, as
169
- of this release, Ruby 1.8.0 or later is required.
170
- - Modified the constructor to accept arguments. This is just some sugar for
171
- creating a new task item in one call instead of two.
172
- - The argument to trigger= now must be a hash. The same goes for the 'type'
173
- sub-hash.
174
- - Added the add_trigger() method. Actually, the C code for this method was
175
- already in place, I simply forgot to create a corresponding Ruby method
176
- for it.
177
- - Removed the create_trigger() method. This was really nothing more than an
178
- alias for trigger=(). I got confused somehow.
179
- - Test suite modified and many more tests added.
180
- - Documentation updates, including docs for a couple of methods that I had
181
- accidentally omitted previously.
182
-
183
- ## [v0.0.1](24-Apr-2004)
184
- - Initial release