win32-taskscheduler 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,29 +1,33 @@
1
- require 'rubygems'
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = 'win32-taskscheduler'
5
- spec.version = '0.2.2'
6
- spec.authors = ['Park Heesob', 'Daniel J. Berger']
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 = 'A library for the Windows task scheduler'
12
- spec.test_files = Dir['test/test*']
13
- spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
14
-
15
- spec.rubyforge_project = 'win32utils'
16
-
17
- spec.extra_rdoc_files = [
18
- 'README',
19
- 'CHANGES',
20
- 'MANIFEST',
21
- 'doc/taskscheduler.txt'
22
- ]
23
-
24
- spec.description = <<-EOF
25
- The win32-taskscheduler library provides an interface to the MS Windows
26
- Task Scheduler. With this interface you can create new scheduled tasks,
27
- configure existing tasks, or delete tasks.
28
- EOF
29
- end
1
+ require 'rubygems'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'win32-taskscheduler'
5
+ spec.version = '0.3.0'
6
+ spec.authors = ['Park Heesob', 'Daniel J. Berger']
7
+ spec.license = 'Artistic 2.0'
8
+ spec.email = 'djberg96@gmail.com'
9
+ spec.homepage = 'http://www.rubyforge.org/projects/win32utils'
10
+ spec.summary = 'A library for the Windows task scheduler'
11
+ spec.test_files = Dir['test/test*']
12
+ spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
13
+
14
+ spec.rubyforge_project = 'win32utils'
15
+
16
+ spec.add_dependency('structured_warnings')
17
+
18
+ spec.add_development_dependency('test-unit')
19
+ spec.add_development_dependency('rake')
20
+ spec.add_development_dependency('win32-security')
21
+
22
+ spec.extra_rdoc_files = [
23
+ 'README',
24
+ 'CHANGES',
25
+ 'MANIFEST',
26
+ ]
27
+
28
+ spec.description = <<-EOF
29
+ The win32-taskscheduler library provides an interface to the MS Windows
30
+ Task Scheduler. With this interface you can create new scheduled tasks,
31
+ configure existing tasks, or delete tasks.
32
+ EOF
33
+ end
metadata CHANGED
@@ -1,77 +1,116 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: win32-taskscheduler
3
- version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Park Heesob
14
8
  - Daniel J. Berger
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2012-02-29 00:00:00 Z
20
- dependencies: []
21
-
22
- description: " The win32-taskscheduler library provides an interface to the MS Windows\n Task Scheduler. With this interface you can create new scheduled tasks,\n configure existing tasks, or delete tasks.\n"
12
+ date: 2014-01-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: structured_warnings
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'
28
+ - !ruby/object:Gem::Dependency
29
+ name: test-unit
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: win32-security
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
+ description: |2
71
+ The win32-taskscheduler library provides an interface to the MS Windows
72
+ Task Scheduler. With this interface you can create new scheduled tasks,
73
+ configure existing tasks, or delete tasks.
23
74
  email: djberg96@gmail.com
24
75
  executables: []
25
-
26
76
  extensions: []
27
-
28
- extra_rdoc_files:
77
+ extra_rdoc_files:
29
78
  - README
30
79
  - CHANGES
31
80
  - MANIFEST
32
- - doc/taskscheduler.txt
33
- files:
81
+ files:
34
82
  - CHANGES
35
- - doc/taskscheduler.txt
36
- - examples/taskscheduler_example.rb
37
- - lib/win32/taskscheduler.rb
38
83
  - MANIFEST
39
- - Rakefile
40
84
  - README
85
+ - Rakefile
86
+ - examples/taskscheduler_example.rb
87
+ - lib/win32/taskscheduler.rb
88
+ - lib/win32/windows/helper.rb
41
89
  - test/test_taskscheduler.rb
42
90
  - win32-taskscheduler.gemspec
43
91
  homepage: http://www.rubyforge.org/projects/win32utils
44
- licenses:
92
+ licenses:
45
93
  - Artistic 2.0
94
+ metadata: {}
46
95
  post_install_message:
47
96
  rdoc_options: []
48
-
49
- require_paths:
97
+ require_paths:
50
98
  - lib
51
- required_ruby_version: !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
60
- required_rubygems_version: !ruby/object:Gem::Requirement
61
- none: false
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- hash: 3
66
- segments:
67
- - 0
68
- version: "0"
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
69
109
  requirements: []
70
-
71
110
  rubyforge_project: win32utils
72
- rubygems_version: 1.8.10
111
+ rubygems_version: 2.2.1
73
112
  signing_key:
74
- specification_version: 3
113
+ specification_version: 4
75
114
  summary: A library for the Windows task scheduler
76
- test_files:
115
+ test_files:
77
116
  - test/test_taskscheduler.rb
@@ -1,419 +0,0 @@
1
- = Description
2
- This is an interface to the MS Windows task scheduler.
3
- = Synopsis
4
- require 'win32/taskscheduler'
5
- include Win32
6
-
7
- ts = TaskScheduler.new
8
-
9
- # Create a trigger that starts on April 25, 2014 at 11:05 pm. The trigger
10
- # will run on the first and last week of the month, on Monday and Friday,
11
- # in the months of April and May.
12
- #
13
- trigger = {
14
- :start_year => 2014,
15
- :start_month => 4,
16
- :start_day => 25,
17
- :start_hour => 23,
18
- :start_minute => 5,
19
- :trigger_type => TaskScheduler::MONTHLYDOW,
20
- :type => {
21
- :weeks => TaskScheduler::FIRST_WEEK | TaskScheduler::LAST_WEEK,
22
- :days_of_week => TaskScheduler::MONDAY | TaskScheduler::FRIDAY,
23
- :months => TaskScheduler::APRIL | TaskScheduler::MAY
24
- }
25
- }
26
-
27
- ts.new_work_item('my_task', trigger)
28
- ts.application_name = 'notepad.exe'
29
- ts.save
30
-
31
- = Constants
32
- === VERSION
33
- Returns the current version number for this package as a string.
34
-
35
- = Class Methods
36
- === TaskScheduler.new(task_name=nil, trigger=nil)
37
- Returns a new TaskScheduler object. If the task name and trigger are
38
- passed as arguments, then a new work item is created and associated with
39
- that trigger, although you can still activate other tasks with the same
40
- object.
41
-
42
- Passing arguments to the constructor is effectively a shortcut for
43
- TaskScheduler.new plus TaskScheduler#new_work_item.
44
-
45
- = Instance Methods
46
- === TaskScheduler#account_information
47
- Returns the account name associated with the task (but not the password).
48
-
49
- === TaskScheduler#add_trigger(index, trigger)
50
- Adds the given trigger at the specified index.
51
-
52
- === TaskScheduler#activate(job_name)
53
- Activates the given +job_name+.
54
-
55
- === TaskScheduler#application_name
56
- Returns the application associated with the task, i.e. the program that's
57
- to run at the specified date and time.
58
-
59
- === TaskScheduler#application_name=(name)
60
- Sets the application associated with the task, i.e. the application
61
- that runs at the specified date and time.
62
-
63
- === TaskScheduler#comment
64
- Returns the comment associated with the task.
65
-
66
- === TaskScheduler#comment=
67
- Sets the comment associated with the task.
68
-
69
- === TaskScheduler#creator
70
- Returns the name of the user who created the task.
71
-
72
- === TaskScheduler#creator=(name)
73
- Sets the name of the user who created the task.
74
-
75
- === TaskScheduler#delete(task_name)
76
- Deletes the task with the specified name.
77
-
78
- === TaskScheduler#delete_trigger(index)
79
- Deletes the trigger at the specified index.
80
-
81
- === TaskScheduler#enum
82
- Returns an array of task names.
83
-
84
- === TaskScheduler#exit_code
85
- Returns the exit code of from the task scheduler when it last attempted
86
- to run the task.
87
-
88
- === TaskScheduler#flags
89
- Returns a list of flags that modify the behavior of the work item.
90
-
91
- === TaskScheduler#flags=(flags)
92
- Sets a list of flags that modify the behavior of the work item. See the
93
- 'Task Flags' below for a list of valid flags.
94
-
95
- === TaskScheduler#machine=(host)
96
- Sets the active host. If this is not set, then it is assumed you are
97
- working on the local host.
98
-
99
- === TaskScheduler#max_run_time
100
- Returns the maximum length of time, in milliseconds, the task can run
101
- before terminating.
102
-
103
- === TaskScheduler#max_run_time=(milliseconds)
104
- Sets the maximum length of time, in milliseconds, the task can run
105
- before terminating.
106
-
107
- === TaskScheduler#most_recent_run_time
108
- Returns a Time object indicating the most recent time the task ran.
109
- Returns nil if the task has never run.
110
-
111
- === TaskScheduler#new_work_item(task_name, trigger)
112
- Creates a new task with the associated trigger. Note that the application
113
- name hasn't been set, nor has it been saved.
114
-
115
- === TaskSchedule#next_run_time
116
- Returns a Time object indicating the next time the task will run.
117
-
118
- === TaskScheduler#parameters
119
- Returns the parameters that are passed to the scheduled command.
120
-
121
- === TaskScheduler#parameters=(params)
122
- Sets the parameters that are passed to the scheduled command.
123
-
124
- === TaskScheduler#priority
125
- Returns the priority level for the active task (Fixnum).
126
-
127
- === TaskScheduler#priority=(level)
128
- Sets the priority level for the active task. The priority of a task
129
- determines the frequency and length of the time slices for a process.
130
-
131
- See the 'Priority Levels' constants for a list of valid priorities.
132
-
133
- === TaskScheduler#run
134
- Executes the currently active task.
135
-
136
- === TaskScheduler#save
137
- Saves the current task. It also releases all information relative to tasks.
138
- In order to modify this task again you must call Activate() because there
139
- is no active task now.
140
-
141
- === TaskScheduler#set_account_information(account_name, password)
142
- Sets the account name and password used to run the task.
143
-
144
- === TaskScheduler#status
145
- Returns the status of the current task. The possible return values are
146
- "ready", "running", "not scheduled" or "unknown", though the latter should
147
- never occur.
148
-
149
- In the case of "not scheduled", it means that one or more of the
150
- properties that are needed to run the work item on a schedule
151
- have not been set.
152
-
153
- === TaskScheduler#terminate
154
- Terminatest the execution of the active task.
155
-
156
- === TaskScheduler#trigger(index)
157
- Returns a hash that describes the trigger for the active task at the
158
- given index.
159
-
160
- === TaskScheduler#trigger=(trigger_hash){
161
- Takes a hash that sets the various trigger values, i.e. when and how often
162
- the task will run. Valid keys are:
163
-
164
- * start_year # Must be >= current year
165
- * start_month # 1-12
166
- * start_day # 1-31
167
- * start_hour # 0-23
168
- * start_minute # 0-59
169
- * end_year
170
- * end_month
171
- * end_day
172
- * minutes_duration
173
- * minutes_interval
174
- * random_minutes_interval
175
- * flags
176
- * trigger_type
177
- * type # A sub-hash
178
-
179
- The +trigger_type+ determines what values are valid for the
180
- +type+ key. They are as follows:
181
-
182
- Trigger Type Valid +type+ keys
183
- ============ ========================
184
- DAILY days_interval
185
- WEEKLY weeks_interval, days_of_week
186
- MONTHLY_DATE months, days
187
- MONTHLY_DOW weeks, days_of_week, months
188
-
189
- === TaskScheduler#trigger_count
190
- Returns the number of triggers associated with the active task.
191
-
192
- === TaskScheduler#trigger_string
193
- Returns a string that describes the current trigger for the active task.
194
-
195
- === TaskScheduler#working_directory
196
- Returns the current working directory for the active task.
197
-
198
- === TaskScheduler#working_directory=(dir)
199
- Sets the working directory for the scheduled command.
200
-
201
- = Constants
202
- == Standard Constants
203
- === VERSION
204
- Returns the current version number of this package as a String.
205
-
206
- == Trigger Types
207
- === ONCE
208
- Trigger is set to run the task a single time. If this value is used, any
209
- values used in the +type+ trigger key are ignored.
210
-
211
- === DAILY
212
- Trigger is set to run the task on a daily interval.
213
-
214
- === WEEKLY
215
- Trigger is set to run the work item on specific days of a specific week
216
- of a specific month.
217
-
218
- === MONTHLYDATE
219
- Trigger is set to run the task on a specific day(s) of the month.
220
-
221
- === MONTHLYDOW
222
- Trigger is set to run the task on specific days, weeks, and months.
223
-
224
- === ON_IDLE
225
- Trigger is set to run the task if the system remains idle for the amount
226
- of time specified by the idle wait time of the task.
227
-
228
- === AT_SYSTEMSTART
229
- Trigger is set to run the task at system startup. If this value is used,
230
- any values used in the +type+ trigger key are ignored.
231
-
232
- === AT_LOGON
233
- Trigger is set to run the task when a user logs on. If this value is
234
- used, any values used in the +type+ trigger key are ignored.
235
-
236
- == Priority Levels
237
- === IDLE
238
- Typically used for system monitoring applications.
239
-
240
- === BELOW_NORMAL
241
- Between IDLE and NORMAL priority classes.
242
-
243
- === NORMAL
244
- The default priority class. Recommended for most applications.
245
-
246
- === ABOVE_NORMAL
247
- Between NORMAL and HIGH priority classes.
248
-
249
- === HIGH
250
- High priority. Use only for applications that need regular focus.
251
-
252
- === REALTIME
253
- Extremely high priority. May affect other applications. Not recommended
254
- for most applications.
255
-
256
- == Dates
257
- === SUNDAY
258
- The task will run on Sunday.
259
-
260
- === MONDAY
261
- The task will run on Monday.
262
-
263
- === TUESDAY
264
- The task will run on Tuesday.
265
-
266
- === WEDNESDAY
267
- The task will run on Wednesday.
268
-
269
- === THURSDAY
270
- The task will run on Thursday.
271
-
272
- === FRIDAY
273
- The task will run on Friday.
274
-
275
- === SATURDAY
276
- The task will run on Saturday.
277
-
278
- === FIRST_WEEK
279
- The task will run between the 1st and 7th day of the month.
280
-
281
- === SECOND_WEEK
282
- The task will run between the 8th and 14th day of the month.
283
-
284
- === THIRD_WEEK
285
- The task will run between the 15th and the 21st of the month.
286
-
287
- === FOURTH_WEEK
288
- The task will run between the 22nd and 28th day of the month.
289
-
290
- === LAST_WEEK
291
- The task will run between the last seven days of the month.
292
-
293
- === JANUARAY
294
- The task will run in January.
295
-
296
- === FEBRUARY
297
- The task will run in Februrary.
298
-
299
- === MARCH
300
- The task will run in March.
301
-
302
- === APRIL
303
- The task will run in April.
304
-
305
- === MAY
306
- The task will run in May.
307
-
308
- === JUNE
309
- The task will run in June.
310
-
311
- === JULY
312
- The task will run in July.
313
-
314
- === AUGUST
315
- The task will run in August.
316
-
317
- === SEPTEMBER
318
- The task will run in September.
319
-
320
- === OCTOBER
321
- The task will run in October.
322
-
323
- === NOVEMBER
324
- The task will run in November.
325
-
326
- === DECEMBER
327
- The task will run in December.
328
-
329
- == Task Flags
330
- === INTERACTIVE
331
- This flag is used when converting Windows NT AT service jobs into work
332
- items. The Windows NT AT service job refers to At.exe, the Windows NT
333
- command-line utility used for creating jobs for the Windows NT Schedule
334
- service. The Task Scheduler service replaces the Schedule service and is
335
- backwards compatible with it. The conversion occurs when the Task
336
- Scheduler is installed on Windows NT/Windows 2000 for example, if you
337
- install Internet Explorer 4.0, or upgrade to Windows 2000. During the
338
- setup process, the Task Scheduler installation code searches the registry
339
- for jobs created for the AT service and creates work items that will
340
- accomplish the same operation.
341
-
342
- For such converted jobs, the interactive flag is set if the work item is
343
- intended to be displayed to the user. When this flag is not set, no work
344
- items are displayed in the Tasks folder, and no user interface associated
345
- with the work item is presented to the user when the work item is
346
- executed.
347
-
348
- === DELETE_WHEN_DONE
349
- The work item will be deleted when there are no more scheduled run times.
350
-
351
- === DISABLED
352
- The work item is disabled. This is useful to temporarily prevent a work
353
- item from running at the scheduled time(s).
354
-
355
- === HIDDEN
356
- The work item created will be hidden.
357
-
358
- === RUN_ONLY_IF_LOGGED_ON
359
- The work item runs only if the user specified in +set_account_information+
360
- is logged on interactively. This flag has no effect on work items set to
361
- run in the local account.
362
-
363
- === START_ONLY_IF_IDLE
364
- The work item begins only if the computer is not in use at the scheduled
365
- start time.
366
-
367
- === SYSTEM_REQUIRED
368
- The work item causes the system to be resumed, or awakened, if the system
369
- is running on battery power. This flag is supported only on systems that
370
- support resume timers.
371
-
372
- === KILL_ON_IDLE_END
373
- The work item terminates if the computer makes an idle to non-idle
374
- transition while the work item is running. The computer is not
375
- considered idle until the IdleWait triggers' time elapses with no user
376
- input.
377
-
378
- === RESTART_ON_IDLE_RESUME
379
- The work item starts again if the computer makes a non-idle to idle
380
- transition before all the work item's task triggers elapse.
381
- (Use this flag in conjunction with KILL_ON_IDLE_END.)
382
-
383
- === DONT_START_IF_ON_BATTERIES
384
- The work item does not start if its target computer is running on
385
- battery power.
386
-
387
- === KILL_IF_GOING_ON_BATTERIES
388
- The work item ends, and the associated application quits if the work
389
- item's target computer switches to battery power.
390
-
391
- = Notes
392
- The terms "work item" and "task" are effectively synonymous for purposes
393
- of this documentation.
394
-
395
- = Known Bugs
396
- The 'account_information()' method appears to be busted.
397
-
398
- Please log all bug reports on the project page at
399
- http://rubyforge.org/projects/win32utils
400
-
401
- = Future Plans
402
- Add support for Windows Vista and later.
403
- Add support for IDLE, SYSTEMSTART and LOGON.
404
-
405
- = Copyright
406
- (C) 2003-2009 Daniel J. Berger, All Rights Reserved
407
-
408
- = License
409
- Ruby's
410
-
411
- = Warranty
412
- This package is provided "as is" and without any express or
413
- implied warranties, including, without limitation, the implied
414
- warranties of merchantability and fitness for a particular purpose.
415
-
416
- = Authors and Testers
417
- Park Heesob
418
- Daniel J. Berger
419
- Shashank Date