win32-taskscheduler 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +108 -93
- data/MANIFEST +10 -9
- data/README +72 -68
- data/Rakefile +34 -37
- data/certs/djberg96_pub.pem +21 -0
- data/examples/taskscheduler_example.rb +56 -56
- data/lib/win32-taskscheduler.rb +1 -0
- data/lib/win32/taskscheduler.rb +1383 -1368
- data/lib/win32/windows/helper.rb +45 -42
- data/test/test_taskscheduler.rb +690 -689
- data/win32-taskscheduler.gemspec +33 -34
- metadata +51 -21
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b74ccd6aa98c21f9e0a7bdd20c24e09f7e461450
|
4
|
+
data.tar.gz: a0742bc2c56d80f282a1e5cd37fb1b809e0c3e70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaa9bc605ad45fd60797cf46fb9d4083054ead60552c92e10546e4f2e83247cbf0b6c063c9716e7f729271b4b0f7410fc52cdb349e72b281efea287d5252d8fb
|
7
|
+
data.tar.gz: f338910febc7774ce538465684f39e4b6480eb5f5b78d769b56a2c89eb9a02e41d31ead7bba871c1138b09e138c929416dff779d29a2a005b9e3c3f7d589596e
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
data/CHANGES
CHANGED
@@ -1,93 +1,108 @@
|
|
1
|
-
== 0.3.
|
2
|
-
*
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
*
|
8
|
-
|
9
|
-
*
|
10
|
-
|
11
|
-
*
|
12
|
-
|
13
|
-
|
14
|
-
*
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
*
|
19
|
-
|
20
|
-
|
21
|
-
== 0.
|
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
|
-
* Added
|
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
|
-
|
1
|
+
== 0.3.2 - 18-Mar-2018
|
2
|
+
* Use the block form for FFI::MemoryPointer in the error message helper
|
3
|
+
function. Thanks go to Ethan Brown for the suggestion.
|
4
|
+
* Fixed a potential bug in the helper module, which was also renamed to
|
5
|
+
help prevent any name collisions.
|
6
|
+
* Added the win32-taskscheduler.rb file for convenience.
|
7
|
+
* Added the configure_settings method.
|
8
|
+
* Added the configure_registration_info method.
|
9
|
+
* Added the description and description= aliases for comments.
|
10
|
+
* Added the author and author= aliases for creator.
|
11
|
+
* Some internal cleanup, moving common code to private methods.
|
12
|
+
* Rakefile now assumes Rubygems 2.0 or later for tasks.
|
13
|
+
* Gemspec cleanup, updated home page, removed old rubyforge_project reference.
|
14
|
+
* This gem is now signed.
|
15
|
+
|
16
|
+
== 0.3.1 - 6-Jul-2014
|
17
|
+
* Added FFI as a dependency. Thanks go to Maxime Lapointe for the spot.
|
18
|
+
* Some updates to the win_error helper method. Thanks go to Ethan J. Brown
|
19
|
+
for the suggestions.
|
20
|
+
|
21
|
+
== 0.3.0 - 15-Jan-2014
|
22
|
+
* Rewritten to use Win32OLE instead of using wrapping the C API. Benefits
|
23
|
+
include working on Windows Vista or later, and working with JRuby.
|
24
|
+
* Modified the constructor to accept 3rd and 4th arguments. These indicate
|
25
|
+
which folder to use, and whether or not to create it if it doesn't exist.
|
26
|
+
* The TaskScheduler#save method is now no longer necessary. It is retained
|
27
|
+
for backwards compatibility, but will raise a deprecation warning. In this
|
28
|
+
version simply calling TaskScheduler#activate will implement the task.
|
29
|
+
* Added support for the AT_SYSTEMSTART, AT_LOGON and ON_IDLE trigger types.
|
30
|
+
* Now requires the structured_warnings gem.
|
31
|
+
* Removed the doc directory and separate documentation file. Everything is
|
32
|
+
inlined now. There's still an example under the "examples" directory, too.
|
33
|
+
* Added test-unit, rake, and win32-security as development dependencies.
|
34
|
+
These are needed for testing only.
|
35
|
+
|
36
|
+
== 0.2.2 - 29-Feb-2012
|
37
|
+
* Moved some include statements inside the TaskScheduler class to avoid
|
38
|
+
polluting Object. Thanks go to Josh Cooper for the spot and patch.
|
39
|
+
* Minor formatting tweaks to silence 1.9 warnings.
|
40
|
+
|
41
|
+
== 0.2.1 - 8-Oct-2011
|
42
|
+
* Fixed a bug that would not allow task to run as SYSTEM. Thanks go to
|
43
|
+
Josh cooper for the spot and patch.
|
44
|
+
* Fixed a bug in new_work_item that would cause it to crash if you tried
|
45
|
+
to create a work item that already existed. An error is now raised instead.
|
46
|
+
Thanks go to Pete Higgins for the spot.
|
47
|
+
* The set_trigger and trigger= methods now internally transform and validate
|
48
|
+
the trigger hash in the same manner as new_work_item. Thanks again go to
|
49
|
+
Pete Higgins.
|
50
|
+
* Cleaned up the repo. The C source files have been removed from the main
|
51
|
+
repository (and this gem). They are in a separate branch on github for
|
52
|
+
anyone who misses them.
|
53
|
+
* Refactored the Rakefile, removing tasks related to the old C source files,
|
54
|
+
and added tasks for cleaning, building and installing a gem.
|
55
|
+
* Updated the README file, eliminating references to anything that was only
|
56
|
+
related to the older C version.
|
57
|
+
|
58
|
+
== 0.2.0 - 19-Jun-2009
|
59
|
+
* Rewritten in pure Ruby!
|
60
|
+
* The TaskScheduler::ONCE constant is now a valid trigger type. Thanks go to
|
61
|
+
Uri Iurgel for the spot and patch.
|
62
|
+
* Added the TaskScheduler#exists? method.
|
63
|
+
* Added the TaskScheduler#tasks alias for the TaskScheduler#enum method.
|
64
|
+
* The TaskScheduler#new_work_item method now accepts symbols as well as
|
65
|
+
strings for hash keys, and ignores case. Also, the keys are now validated.
|
66
|
+
* Renamed the example file and test file.
|
67
|
+
* Added the 'example' Rake task.
|
68
|
+
* Fixed some code in the README synopsis that was incorrect.
|
69
|
+
|
70
|
+
== 0.1.0 - 11-May-2008
|
71
|
+
* The TaskScheduler#save instance method now accepts an optional file name.
|
72
|
+
* Most of the TaskScheduler setter methods now return the value specified
|
73
|
+
instead of true.
|
74
|
+
* Removed the RUN_ONLY_IF_DOCKED and RUN_IF_CONNECTED_TO_INTERNET constants.
|
75
|
+
The MSDN docs say that they are unused.
|
76
|
+
* Added more documentation. Much more rdoc friendly now.
|
77
|
+
* Added many more tests.
|
78
|
+
* Better type handling for bad arguments.
|
79
|
+
* Added a Rakefile with tasks for building, installation and testing.
|
80
|
+
* Added a gemspec.
|
81
|
+
* Inlined the rdoc documentation.
|
82
|
+
* Internal project reorganization and code cleanup.
|
83
|
+
|
84
|
+
== 0.0.3 - 1-Mar-2005
|
85
|
+
* Bug fix for the bitFieldToHumanDays() internal function.
|
86
|
+
* Moved the 'examples' directory to the toplevel directory.
|
87
|
+
* Made the CHANGES and README files rdoc friendly.
|
88
|
+
* Minor updates to taskscheduler.h.
|
89
|
+
|
90
|
+
== 0.0.2 - 04-Aug-2004
|
91
|
+
* Now uses the newer allocation framework and replaced all instances of the
|
92
|
+
deprecated STR2CSTR() function with StringValuePtr(). This means that, as
|
93
|
+
of this release, Ruby 1.8.0 or later is required.
|
94
|
+
* Modified the constructor to accept arguments. This is just some sugar for
|
95
|
+
creating a new task item in one call instead of two.
|
96
|
+
* The argument to trigger= now must be a hash. The same goes for the 'type'
|
97
|
+
sub-hash.
|
98
|
+
* Added the add_trigger() method. Actually, the C code for this method was
|
99
|
+
already in place, I simply forgot to create a corresponding Ruby method
|
100
|
+
for it.
|
101
|
+
* Removed the create_trigger() method. This was really nothing more than an
|
102
|
+
alias for trigger=(). I got confused somehow.
|
103
|
+
* Test suite modified and many more tests added.
|
104
|
+
* Documentation updates, including docs for a couple of methods that I had
|
105
|
+
accidentally omitted previously.
|
106
|
+
|
107
|
+
== 0.0.1 - 24-Apr-2004
|
108
|
+
* Initial release
|
data/MANIFEST
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
* CHANGES
|
2
|
-
* MANIFEST
|
3
|
-
* README
|
4
|
-
* Rakefile
|
5
|
-
* win32-taskscheduler.gemspec
|
6
|
-
* lib/win32
|
7
|
-
* lib/win32/
|
8
|
-
*
|
9
|
-
*
|
1
|
+
* CHANGES
|
2
|
+
* MANIFEST
|
3
|
+
* README
|
4
|
+
* Rakefile
|
5
|
+
* win32-taskscheduler.gemspec
|
6
|
+
* lib/win32-taskscheduler.rb
|
7
|
+
* lib/win32/taskscheduler.rb
|
8
|
+
* lib/win32/windows/helper.rb
|
9
|
+
* examples/taskscheduler_test.rb
|
10
|
+
* test/test_taskscheduler.rb
|
data/README
CHANGED
@@ -1,68 +1,72 @@
|
|
1
|
-
= Description
|
2
|
-
The win32-taskscheduler library is a Ruby interface to the MS Windows Task
|
3
|
-
Scheduler. It is analogous to the Unix cron daemon.
|
4
|
-
|
5
|
-
= Installation
|
6
|
-
gem install win32-taskscheduler
|
7
|
-
|
8
|
-
= Synopsis
|
9
|
-
require 'win32/taskscheduler'
|
10
|
-
include Win32
|
11
|
-
|
12
|
-
ts = TaskScheduler.new
|
13
|
-
|
14
|
-
# Create a trigger that starts on April 25, 2014 at 11:05 pm. The trigger
|
15
|
-
# will run on the first and last week of the month, on Monday and Friday,
|
16
|
-
# in the months of April and May.
|
17
|
-
#
|
18
|
-
trigger = {
|
19
|
-
:start_year => 2014,
|
20
|
-
:start_month => 4,
|
21
|
-
:start_day => 25,
|
22
|
-
:start_hour => 23,
|
23
|
-
:start_minute => 5,
|
24
|
-
:trigger_type => TaskScheduler::MONTHLYDOW,
|
25
|
-
:type => {
|
26
|
-
:weeks => TaskScheduler::FIRST_WEEK | TaskScheduler::LAST_WEEK,
|
27
|
-
:days_of_week => TaskScheduler::MONDAY | TaskScheduler::FRIDAY,
|
28
|
-
:months => TaskScheduler::APRIL | TaskScheduler::MAY
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
ts.new_work_item('my_notepad', trigger)
|
33
|
-
ts.application_name = 'notepad.exe'
|
34
|
-
ts.activate('my_notepad')
|
35
|
-
|
36
|
-
= Documentation
|
37
|
-
If you installed this library as a gem then the documentation was built for
|
38
|
-
you and can be viewed if your gem server is running. There is also some
|
39
|
-
documentation on the github wiki page.
|
40
|
-
|
41
|
-
= Acknowledgements
|
42
|
-
This library was modeled to some degree on the Win32::TaskScheduler Perl
|
43
|
-
module by Umberto Nicoletti. However, there are some differences. Please see
|
44
|
-
the documentation for details.
|
45
|
-
|
46
|
-
= Warranty
|
47
|
-
This package is provided "as is" and without any express or
|
48
|
-
implied warranties, including, without limitation, the implied
|
49
|
-
warranties of merchantability and fitness for a particular purpose.
|
50
|
-
|
51
|
-
= Known Issues
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
=
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
1
|
+
= Description
|
2
|
+
The win32-taskscheduler library is a Ruby interface to the MS Windows Task
|
3
|
+
Scheduler. It is analogous to the Unix cron daemon.
|
4
|
+
|
5
|
+
= Installation
|
6
|
+
gem install win32-taskscheduler
|
7
|
+
|
8
|
+
= Synopsis
|
9
|
+
require 'win32/taskscheduler'
|
10
|
+
include Win32
|
11
|
+
|
12
|
+
ts = TaskScheduler.new
|
13
|
+
|
14
|
+
# Create a trigger that starts on April 25, 2014 at 11:05 pm. The trigger
|
15
|
+
# will run on the first and last week of the month, on Monday and Friday,
|
16
|
+
# in the months of April and May.
|
17
|
+
#
|
18
|
+
trigger = {
|
19
|
+
:start_year => 2014,
|
20
|
+
:start_month => 4,
|
21
|
+
:start_day => 25,
|
22
|
+
:start_hour => 23,
|
23
|
+
:start_minute => 5,
|
24
|
+
:trigger_type => TaskScheduler::MONTHLYDOW,
|
25
|
+
:type => {
|
26
|
+
:weeks => TaskScheduler::FIRST_WEEK | TaskScheduler::LAST_WEEK,
|
27
|
+
:days_of_week => TaskScheduler::MONDAY | TaskScheduler::FRIDAY,
|
28
|
+
:months => TaskScheduler::APRIL | TaskScheduler::MAY
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
ts.new_work_item('my_notepad', trigger)
|
33
|
+
ts.application_name = 'notepad.exe'
|
34
|
+
ts.activate('my_notepad')
|
35
|
+
|
36
|
+
= Documentation
|
37
|
+
If you installed this library as a gem then the documentation was built for
|
38
|
+
you and can be viewed if your gem server is running. There is also some
|
39
|
+
documentation on the github wiki page.
|
40
|
+
|
41
|
+
= Acknowledgements
|
42
|
+
This library was modeled to some degree on the Win32::TaskScheduler Perl
|
43
|
+
module by Umberto Nicoletti. However, there are some differences. Please see
|
44
|
+
the documentation for details.
|
45
|
+
|
46
|
+
= Warranty
|
47
|
+
This package is provided "as is" and without any express or
|
48
|
+
implied warranties, including, without limitation, the implied
|
49
|
+
warranties of merchantability and fitness for a particular purpose.
|
50
|
+
|
51
|
+
= Known Issues
|
52
|
+
Some versions of Ruby have been known to segfault when attempting to create
|
53
|
+
a task. If this happens you will need to upgrade your version of Ruby. Or,
|
54
|
+
at least, your version of win32ole.
|
55
|
+
|
56
|
+
In some cases JRuby appears to raise a native exception rather than a
|
57
|
+
Ruby exception on failure. This should be mostly harmless.
|
58
|
+
|
59
|
+
Please submit any bug reports to the project page at:
|
60
|
+
|
61
|
+
http://github.com/djberg96/win32-taskscheduler
|
62
|
+
|
63
|
+
= Copyright
|
64
|
+
(C) 2003-2017 Daniel J. Berger
|
65
|
+
All Rights Reserved
|
66
|
+
|
67
|
+
= License
|
68
|
+
Artistic 2.0
|
69
|
+
|
70
|
+
= Authors
|
71
|
+
Park Heesob
|
72
|
+
Daniel Berger
|
data/Rakefile
CHANGED
@@ -1,37 +1,34 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/clean'
|
3
|
-
require 'rake/testtask'
|
4
|
-
|
5
|
-
CLEAN.include("**/*.gem", "**/*.rbc")
|
6
|
-
|
7
|
-
namespace 'gem' do
|
8
|
-
desc 'Build the win32-taskscheduler gem'
|
9
|
-
task :create => [:clean] do
|
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
|
-
end
|
36
|
-
|
37
|
-
task :default => :test
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
CLEAN.include("**/*.gem", "**/*.rbc")
|
6
|
+
|
7
|
+
namespace 'gem' do
|
8
|
+
desc 'Build the win32-taskscheduler gem'
|
9
|
+
task :create => [:clean] do
|
10
|
+
require 'rubygems/package'
|
11
|
+
spec = eval(IO.read('win32-taskscheduler.gemspec'))
|
12
|
+
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
|
13
|
+
Gem::Package.build(spec, true)
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Install the win32-taskscheduler library as a gem'
|
17
|
+
task :install => [:create] do
|
18
|
+
file = Dir['win32-taskscheduler*.gem'].first
|
19
|
+
sh "gem install -l #{file}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Run the example code'
|
24
|
+
task :example do
|
25
|
+
ruby '-Iib examples/taskscheduler_example.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
desc 'Run the test suite for the win32-taskscheduler library'
|
29
|
+
Rake::TestTask.new do |t|
|
30
|
+
t.verbose = true
|
31
|
+
t.warning = true
|
32
|
+
end
|
33
|
+
|
34
|
+
task :default => :test
|