ruby_raider 4.1.0 → 4.2.0
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 +4 -4
- data/.github/workflows/e2e_tests.yml +3 -0
- data/README.md +52 -53
- data/RELEASE.md +14 -1
- data/lib/commands/schedule_commands.rb +84 -0
- data/lib/generators/templates/common/git_ignore.tt +1 -0
- data/lib/ruby_raider/runtime/retry_reset.rb +32 -0
- data/lib/ruby_raider/runtime/rspec.rb +1 -0
- data/lib/ruby_raider/runtime/show_browser.rb +53 -0
- data/lib/ruby_raider/runtime.rb +2 -0
- data/lib/ruby_raider.rb +22 -7
- data/lib/utilities/schedules/adapter.rb +22 -0
- data/lib/utilities/schedules/base.rb +27 -0
- data/lib/utilities/schedules/kind.rb +74 -0
- data/lib/utilities/schedules/legacy.rb +196 -0
- data/lib/utilities/schedules/legacy_stub.rb +62 -0
- data/lib/utilities/{flows → schedules}/next_run.rb +2 -2
- data/lib/utilities/{flows → schedules}/notifier.rb +6 -6
- data/lib/utilities/{flows → schedules}/os/command_runner.rb +1 -1
- data/lib/utilities/{flows → schedules}/os/cron.rb +27 -17
- data/lib/utilities/{flows → schedules}/os/launchd.rb +32 -14
- data/lib/utilities/{flows → schedules}/os/linux.rb +23 -5
- data/lib/utilities/{flows → schedules}/os/systemd.rb +33 -17
- data/lib/utilities/{flows → schedules}/os/task_scheduler.rb +36 -20
- data/lib/utilities/schedules/os_enumerator.rb +30 -0
- data/lib/utilities/schedules/project.rb +70 -0
- data/lib/utilities/schedules/rule.rb +162 -0
- data/lib/utilities/schedules/run_lock.rb +160 -0
- data/lib/utilities/schedules/run_log.rb +122 -0
- data/lib/utilities/schedules/run_report.rb +139 -0
- data/lib/utilities/schedules/run_wrapper.rb +216 -0
- data/lib/utilities/schedules/schedule.rb +89 -0
- data/lib/utilities/schedules/schedule_store.rb +53 -0
- data/lib/utilities/schedules/scheduler.rb +178 -0
- data/lib/utilities/schedules/scheduler_steps.rb +69 -0
- data/lib/utilities/schedules/selection.rb +133 -0
- data/lib/utilities/schedules/spawn.rb +68 -0
- data/lib/utilities/{flows/schedule_store.rb → schedules/store.rb} +17 -13
- data/lib/version +1 -1
- data/ruby_raider.gemspec +1 -0
- data/sig/commands/schedule_commands.rbs +12 -0
- data/sig/ruby_raider/runtime/retry_reset.rbs +7 -0
- data/sig/ruby_raider/runtime/show_browser.rbs +27 -0
- data/sig/ruby_raider.rbs +4 -0
- data/sig/utilities/schedules/adapter.rbs +5 -0
- data/sig/utilities/schedules/base.rbs +15 -0
- data/sig/utilities/schedules/kind.rbs +32 -0
- data/sig/utilities/schedules/legacy.rbs +45 -0
- data/sig/utilities/schedules/legacy_stub.rbs +15 -0
- data/sig/utilities/{flows → schedules}/next_run.rbs +3 -3
- data/sig/utilities/{flows → schedules}/notifier.rbs +1 -1
- data/sig/utilities/{flows → schedules}/os/command_runner.rbs +1 -1
- data/sig/utilities/{flows → schedules}/os/cron.rbs +7 -7
- data/sig/utilities/{flows → schedules}/os/launchd.rbs +7 -6
- data/sig/utilities/{flows → schedules}/os/linux.rbs +10 -4
- data/sig/utilities/{flows → schedules}/os/systemd.rbs +8 -7
- data/sig/utilities/{flows → schedules}/os/task_scheduler.rbs +13 -10
- data/sig/utilities/schedules/os_enumerator.rbs +12 -0
- data/sig/utilities/schedules/project.rbs +22 -0
- data/sig/utilities/{flows/schedule.rbs → schedules/rule.rbs} +23 -12
- data/sig/utilities/schedules/run_lock.rbs +29 -0
- data/sig/utilities/schedules/run_log.rbs +33 -0
- data/sig/utilities/schedules/run_report.rbs +34 -0
- data/sig/utilities/schedules/run_wrapper.rbs +45 -0
- data/sig/utilities/schedules/schedule.rbs +27 -0
- data/sig/utilities/schedules/schedule_store.rbs +21 -0
- data/sig/utilities/{flows → schedules}/scheduler.rbs +22 -15
- data/sig/utilities/schedules/scheduler_steps.rbs +22 -0
- data/sig/utilities/schedules/selection.rbs +36 -0
- data/sig/utilities/schedules/spawn.rbs +10 -0
- data/sig/utilities/{flows/schedule_store.rbs → schedules/store.rbs} +14 -9
- data/spec/commands/schedule_commands_spec.rb +284 -0
- data/spec/integration/content/common_content_spec.rb +8 -2
- data/spec/integration/content/gemfile_content_spec.rb +2 -2
- data/spec/integration/end_to_end_spec.rb +0 -63
- data/spec/runtime/retry_reset_spec.rb +112 -0
- data/spec/runtime/show_browser_project_spec.rb +70 -0
- data/spec/runtime/show_browser_spec.rb +101 -0
- data/spec/utilities/schedules/kind_spec.rb +81 -0
- data/spec/utilities/schedules/legacy_spec.rb +433 -0
- data/spec/utilities/schedules/legacy_stub_spec.rb +144 -0
- data/spec/utilities/{flows → schedules}/next_run_spec.rb +5 -5
- data/spec/utilities/{flows → schedules}/notifier_spec.rb +3 -4
- data/spec/utilities/{flows → schedules}/os/command_runner_spec.rb +2 -3
- data/spec/utilities/{flows → schedules}/os/cron_spec.rb +34 -29
- data/spec/utilities/{flows → schedules}/os/launchd_spec.rb +42 -29
- data/spec/utilities/{flows → schedules}/os/linux_spec.rb +27 -13
- data/spec/utilities/schedules/os/list_ids_spec.rb +202 -0
- data/spec/utilities/{flows → schedules}/os/systemd_spec.rb +35 -31
- data/spec/utilities/{flows → schedules}/os/task_scheduler_spec.rb +40 -34
- data/spec/utilities/schedules/os_entry_spec.rb +54 -0
- data/spec/utilities/schedules/os_enumerator_spec.rb +57 -0
- data/spec/utilities/schedules/project_spec.rb +125 -0
- data/spec/utilities/schedules/run_lock_spec.rb +143 -0
- data/spec/utilities/schedules/run_log_spec.rb +83 -0
- data/spec/utilities/schedules/run_report_spec.rb +150 -0
- data/spec/utilities/schedules/run_wrapper_integration_spec.rb +166 -0
- data/spec/utilities/schedules/run_wrapper_spec.rb +430 -0
- data/spec/utilities/schedules/schedule_spec.rb +120 -0
- data/spec/utilities/schedules/schedule_store_spec.rb +151 -0
- data/spec/utilities/schedules/scheduler_launchd_spec.rb +77 -0
- data/spec/utilities/schedules/scheduler_spec.rb +445 -0
- data/spec/utilities/schedules/selection_spec.rb +176 -0
- data/spec/utilities/schedules/spawn_spec.rb +104 -0
- metadata +106 -53
- data/lib/commands/flow_commands.rb +0 -104
- data/lib/generators/templates/flows/flow_helper.tt +0 -42
- data/lib/generators/templates/flows/run.tt +0 -332
- data/lib/utilities/flows/project.rb +0 -170
- data/lib/utilities/flows/run_log.rb +0 -61
- data/lib/utilities/flows/runner.rb +0 -206
- data/lib/utilities/flows/schedule.rb +0 -221
- data/lib/utilities/flows/scheduler.rb +0 -187
- data/sig/commands/flow_commands.rbs +0 -13
- data/sig/utilities/flows/project.rbs +0 -46
- data/sig/utilities/flows/run_log.rbs +0 -22
- data/sig/utilities/flows/runner.rbs +0 -35
- data/spec/commands/flow_commands_spec.rb +0 -128
- data/spec/generators/flow_helper_spec.rb +0 -40
- data/spec/integration/flows/flow_project.rb +0 -62
- data/spec/integration/flows/run_command_spec.rb +0 -91
- data/spec/integration/flows/run_lifecycle_spec.rb +0 -383
- data/spec/utilities/flows/project_spec.rb +0 -178
- data/spec/utilities/flows/run_log_spec.rb +0 -47
- data/spec/utilities/flows/runner_spec.rb +0 -313
- data/spec/utilities/flows/schedule_spec.rb +0 -233
- data/spec/utilities/flows/schedule_store_spec.rb +0 -137
- data/spec/utilities/flows/scheduler_spec.rb +0 -329
data/ruby_raider.gemspec
CHANGED
|
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.add_development_dependency 'rake', '~> 13.0.6'
|
|
19
19
|
s.add_development_dependency 'reek', '~> 6.5'
|
|
20
20
|
s.add_development_dependency 'rspec', '~> 3.11.0'
|
|
21
|
+
s.add_development_dependency 'rspec-retry', '~> 0.6'
|
|
21
22
|
s.add_development_dependency 'rubocop', '~> 1.27'
|
|
22
23
|
s.add_development_dependency 'rubocop-performance', '~> 1.15.0'
|
|
23
24
|
s.add_development_dependency 'rubocop-rspec', '~> 2.9.0'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Type definitions for ScheduleCommands
|
|
2
|
+
class ScheduleCommands < Thor
|
|
3
|
+
def add: (String name, *String files) -> void
|
|
4
|
+
def list: () -> void
|
|
5
|
+
def remove: (String name) -> void
|
|
6
|
+
def run_schedule: (String name) -> bot
|
|
7
|
+
def new_project: () -> RubyRaider::Schedules::Project
|
|
8
|
+
def cleaned_project: () -> RubyRaider::Schedules::Project
|
|
9
|
+
def cleanup: (RubyRaider::Schedules::Project project) -> String?
|
|
10
|
+
def scheduler: () -> RubyRaider::Schedules::Scheduler
|
|
11
|
+
def stop: (RubyRaider::Schedules::Error error) -> bot
|
|
12
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Raider
|
|
2
|
+
module ShowBrowser
|
|
3
|
+
ENV_KEY: String
|
|
4
|
+
OPTIONS: Array[String]
|
|
5
|
+
SWITCHES: Array[String]
|
|
6
|
+
PREFIX: String
|
|
7
|
+
ARGS_KEYS: Array[Symbol | String]
|
|
8
|
+
|
|
9
|
+
def self.headless?: (untyped arg) -> bool
|
|
10
|
+
def self.without_headless: (untyped args) -> untyped
|
|
11
|
+
def self.install: (?_Env env) -> Array[Module]
|
|
12
|
+
|
|
13
|
+
def headless?: (untyped arg) -> bool
|
|
14
|
+
def without_headless: (untyped args) -> untyped
|
|
15
|
+
def install: (?_Env env) -> Array[Module]
|
|
16
|
+
|
|
17
|
+
interface _Env
|
|
18
|
+
def []: (String) -> String?
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
module Filter
|
|
22
|
+
def initialize: (**untyped opts) -> void
|
|
23
|
+
def add_argument: (untyped arg) -> untyped
|
|
24
|
+
def args=: (untyped value) -> untyped
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
data/sig/ruby_raider.rbs
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# Type definitions for main RubyRaider entry point
|
|
2
2
|
module RubyRaider
|
|
3
3
|
class Raider < Thor
|
|
4
|
+
GUARDED: Array[String]
|
|
5
|
+
LEGACY: Array[String]
|
|
6
|
+
|
|
4
7
|
def self.start: (?Array[String] given_args, ?Hash[Symbol, untyped] config) -> void
|
|
8
|
+
def self.legacy_stub: (Array[String] given_args) -> Integer
|
|
5
9
|
|
|
6
10
|
def current_version: () -> String
|
|
7
11
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module RubyRaider
|
|
2
|
+
module Schedules
|
|
3
|
+
NAME: Regexp
|
|
4
|
+
DAYS: Array[String]
|
|
5
|
+
|
|
6
|
+
def self.valid_name?: (untyped name) -> bool
|
|
7
|
+
def self.printable: (untyped text) -> String
|
|
8
|
+
|
|
9
|
+
class Error < StandardError
|
|
10
|
+
attr_reader exit_code: Integer
|
|
11
|
+
|
|
12
|
+
def initialize: (String message, ?exit_code: Integer) -> void
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module RubyRaider
|
|
2
|
+
module Schedules
|
|
3
|
+
class Kind
|
|
4
|
+
FLOW_LEGACY: Kind
|
|
5
|
+
TESTS: Kind
|
|
6
|
+
|
|
7
|
+
attr_reader command: String
|
|
8
|
+
attr_reader os_id_prefix: String
|
|
9
|
+
attr_reader os_id_pattern: Regexp
|
|
10
|
+
attr_reader dir: String
|
|
11
|
+
attr_reader noun: String
|
|
12
|
+
attr_reader plural: String
|
|
13
|
+
attr_reader remove_command: String
|
|
14
|
+
attr_reader stranded_hint: String?
|
|
15
|
+
attr_reader reserved: Array[String]
|
|
16
|
+
|
|
17
|
+
def initialize: (command: String, dir: String, noun: String, plural: String, remove_command: String, ?stranded_hint: String?, ?reserved: Array[String]) -> void
|
|
18
|
+
def valid_name?: (untyped name) -> bool
|
|
19
|
+
def name_in: (untyped os_id) -> String?
|
|
20
|
+
def listed?: (untyped os_id, String prefix) -> bool
|
|
21
|
+
def cron_tag: () -> String
|
|
22
|
+
def our_command?: (String text, String? name) -> bool
|
|
23
|
+
def task_description: (String name, String rule) -> String
|
|
24
|
+
def task_file_prefix: () -> String
|
|
25
|
+
def service_description: (String name) -> String
|
|
26
|
+
def timer_description: (String name) -> String
|
|
27
|
+
def not_ours: () -> String
|
|
28
|
+
def stranded: (String name) -> String
|
|
29
|
+
def unsupported: (String host_os) -> String
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
module RubyRaider
|
|
2
|
+
module Schedules
|
|
3
|
+
class Legacy
|
|
4
|
+
KIND: Kind
|
|
5
|
+
FILE: String
|
|
6
|
+
MAX_BYTES: Integer
|
|
7
|
+
NOFOLLOW: Integer
|
|
8
|
+
NONBLOCK: Integer
|
|
9
|
+
|
|
10
|
+
class OldRule < Rule
|
|
11
|
+
def self.kind: () -> Kind
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
@project: Project
|
|
15
|
+
@root: String
|
|
16
|
+
@adapter: untyped
|
|
17
|
+
@err: untyped
|
|
18
|
+
@yml_clean: bool
|
|
19
|
+
|
|
20
|
+
def self.folder?: (Project project) -> bool
|
|
21
|
+
|
|
22
|
+
def initialize: (Project project, ?adapter: untyped, ?err: untyped) -> void
|
|
23
|
+
def cleanup: (?last: String?) -> String?
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def adapter: () -> untyped
|
|
28
|
+
def remove_all: (untyped current, Array[String] names) -> [Array[String], Array[[String, String]]]
|
|
29
|
+
def remove_own: (untyped current, String name) -> void
|
|
30
|
+
def notice: (Array[String] removed, Array[[String, String]] failed) -> String?
|
|
31
|
+
def removed_text: (Array[String] names) -> String
|
|
32
|
+
def failed_text: (Array[[String, String]] failed) -> String
|
|
33
|
+
def counted: (Integer count) -> String
|
|
34
|
+
def say: (String text) -> String?
|
|
35
|
+
def dir: () -> String
|
|
36
|
+
def yml: () -> String
|
|
37
|
+
def real_dirs?: () -> bool
|
|
38
|
+
def yml_names: () -> Array[String]
|
|
39
|
+
def entry_name: (untyped entry) -> String?
|
|
40
|
+
def read_entries: () -> Array[untyped]?
|
|
41
|
+
def read_text: () -> String?
|
|
42
|
+
def delete_yml: () -> void
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module RubyRaider
|
|
2
|
+
module Schedules
|
|
3
|
+
module LegacyStub
|
|
4
|
+
EXIT: Integer
|
|
5
|
+
REMOVED: String
|
|
6
|
+
OPTION: String
|
|
7
|
+
|
|
8
|
+
def self.run: (Array[untyped] argv, ?err: untyped) -> Integer
|
|
9
|
+
def self.clean: (String root, String? name, untyped err) -> void
|
|
10
|
+
def self.project_root: (Array[untyped] argv) -> String?
|
|
11
|
+
def self.project_value: (Array[untyped] argv) -> untyped
|
|
12
|
+
def self.own_name: (Array[untyped] argv) -> String?
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
module RubyRaider
|
|
2
|
-
module
|
|
2
|
+
module Schedules
|
|
3
3
|
module NextRun
|
|
4
4
|
WDAYS: Array[String]
|
|
5
5
|
SEARCH_DAYS: Integer
|
|
6
6
|
SEARCH_MINUTES: Integer
|
|
7
7
|
|
|
8
|
-
def self?.after: (
|
|
8
|
+
def self?.after: (_OsEntry schedule, Time now) -> Time
|
|
9
9
|
def self?.next_minute: (Integer minute, Time now) -> Time
|
|
10
|
-
def self?.next_day: (
|
|
10
|
+
def self?.next_day: (_OsEntry schedule, Time now) -> Time
|
|
11
11
|
def self?.local: (Date date, Integer hour, Integer minute) -> Time
|
|
12
12
|
def self?.wall: (Time time) -> Array[Integer]
|
|
13
13
|
end
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
module RubyRaider
|
|
2
|
-
module
|
|
2
|
+
module Schedules
|
|
3
3
|
module Os
|
|
4
4
|
class Cron
|
|
5
5
|
CRONTAB: String
|
|
6
|
-
TAG: String
|
|
7
6
|
MAX_LINE: Integer
|
|
8
|
-
OS_ID: Regexp
|
|
9
7
|
|
|
8
|
+
@kind: Kind
|
|
10
9
|
@runner: CommandRunner
|
|
11
10
|
|
|
12
|
-
def initialize: (?runner: CommandRunner) -> void
|
|
11
|
+
def initialize: (kind: Kind, ?runner: CommandRunner) -> void
|
|
13
12
|
def label: () -> String
|
|
14
13
|
def missed_runs_note: () -> String
|
|
15
|
-
def line: (
|
|
16
|
-
def install: (
|
|
14
|
+
def line: (_OsEntry schedule) -> String
|
|
15
|
+
def install: (_OsEntry schedule) -> true
|
|
17
16
|
def remove: (String os_id) -> bool
|
|
18
17
|
def present?: (String os_id) -> bool
|
|
18
|
+
def list_ids: (String prefix) -> Array[String]
|
|
19
19
|
def usable?: () -> bool
|
|
20
20
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
|
-
def fields: (
|
|
23
|
+
def fields: (_OsEntry schedule) -> String
|
|
24
24
|
def weekday: (String day) -> Integer
|
|
25
25
|
def escape: (String word) -> String
|
|
26
26
|
def without: (String table, String os_id) -> [String, bool]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module RubyRaider
|
|
2
|
-
module
|
|
2
|
+
module Schedules
|
|
3
3
|
module Os
|
|
4
4
|
class Launchd
|
|
5
5
|
LAUNCHCTL: String
|
|
@@ -7,19 +7,20 @@ module RubyRaider
|
|
|
7
7
|
NOFOLLOW: Integer
|
|
8
8
|
ESCAPES: Hash[String, String]
|
|
9
9
|
HEADER: String
|
|
10
|
-
OS_ID: Regexp
|
|
11
10
|
|
|
11
|
+
@kind: Kind
|
|
12
12
|
@runner: CommandRunner
|
|
13
13
|
@home: String
|
|
14
14
|
@uid: Integer
|
|
15
15
|
|
|
16
|
-
def initialize: (?runner: CommandRunner, ?home: String, ?uid: Integer) -> void
|
|
16
|
+
def initialize: (kind: Kind, ?runner: CommandRunner, ?home: String, ?uid: Integer) -> void
|
|
17
17
|
def label: () -> String
|
|
18
|
-
def plist: (
|
|
18
|
+
def plist: (_OsEntry schedule) -> String
|
|
19
19
|
def plist_path: (String os_id) -> String
|
|
20
|
-
def install: (
|
|
20
|
+
def install: (_OsEntry schedule) -> true
|
|
21
21
|
def remove: (String os_id) -> bool
|
|
22
22
|
def present?: (String os_id) -> bool
|
|
23
|
+
def list_ids: (String prefix) -> Array[String]
|
|
23
24
|
|
|
24
25
|
private
|
|
25
26
|
|
|
@@ -35,7 +36,7 @@ module RubyRaider
|
|
|
35
36
|
def array: (Array[Array[String]] items) -> Array[String]
|
|
36
37
|
def dict: (Array[[String, Array[String]]] pairs) -> Array[String]
|
|
37
38
|
def indent: (Array[String] lines) -> Array[String]
|
|
38
|
-
def calendar: (
|
|
39
|
+
def calendar: (_OsEntry schedule) -> Array[String]
|
|
39
40
|
def weekday: (String day) -> Integer
|
|
40
41
|
def discard: (String path) -> String
|
|
41
42
|
def write: (String path, String text) -> void
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
module RubyRaider
|
|
2
|
-
module
|
|
2
|
+
module Schedules
|
|
3
3
|
module Os
|
|
4
4
|
class Linux
|
|
5
|
+
@kind: Kind
|
|
5
6
|
@primary: Systemd | Cron
|
|
6
7
|
@other: Cron?
|
|
7
8
|
@systemd: Systemd
|
|
8
9
|
|
|
9
|
-
def self.pick: (?CommandRunner runner) -> Linux
|
|
10
|
+
def self.pick: (?CommandRunner runner, kind: Kind) -> Linux
|
|
10
11
|
|
|
11
|
-
def initialize: (?runner: CommandRunner, ?systemd: Systemd, ?cron: Cron) -> void
|
|
12
|
+
def initialize: (kind: Kind, ?runner: CommandRunner, ?systemd: Systemd, ?cron: Cron) -> void
|
|
12
13
|
def label: () -> String
|
|
13
14
|
def missed_runs_note: () -> String?
|
|
14
|
-
def install: (
|
|
15
|
+
def install: (_OsEntry schedule) -> true
|
|
15
16
|
def remove: (String os_id) -> bool
|
|
16
17
|
def present?: (String os_id) -> bool
|
|
17
18
|
|
|
19
|
+
def list_ids: (String prefix) -> Array[String]
|
|
20
|
+
|
|
18
21
|
private
|
|
19
22
|
|
|
23
|
+
def other_ids: (String prefix) -> Array[String]
|
|
24
|
+
def quietly: () { () -> Array[String] } -> Array[String]
|
|
25
|
+
|
|
20
26
|
def stranded?: (String os_id) -> bool
|
|
21
27
|
def refuse_stranded: (String os_id) -> void
|
|
22
28
|
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
module RubyRaider
|
|
2
|
-
module
|
|
2
|
+
module Schedules
|
|
3
3
|
module Os
|
|
4
4
|
class Systemd
|
|
5
5
|
SYSTEMCTL: String
|
|
6
6
|
NOFOLLOW: Integer
|
|
7
7
|
QUOTED: Hash[String, String]
|
|
8
8
|
CALENDAR: Hash[String, String]
|
|
9
|
-
OS_ID: Regexp
|
|
10
9
|
UNSAFE_PATH: Regexp
|
|
11
10
|
|
|
11
|
+
@kind: Kind
|
|
12
12
|
@runner: CommandRunner
|
|
13
13
|
@home: String
|
|
14
14
|
@config_home: String?
|
|
15
15
|
|
|
16
|
-
def initialize: (?runner: CommandRunner, ?home: String, ?config_home: String?) -> void
|
|
16
|
+
def initialize: (kind: Kind, ?runner: CommandRunner, ?home: String, ?config_home: String?) -> void
|
|
17
17
|
def label: () -> String
|
|
18
18
|
def missed_runs_note: () -> nil
|
|
19
|
-
def service: (
|
|
20
|
-
def timer: (
|
|
21
|
-
def unit_path: (String os_id, String
|
|
22
|
-
def install: (
|
|
19
|
+
def service: (_OsEntry schedule) -> String
|
|
20
|
+
def timer: (_OsEntry schedule) -> String
|
|
21
|
+
def unit_path: (String os_id, String unit) -> String
|
|
22
|
+
def install: (_OsEntry schedule) -> true
|
|
23
23
|
def remove: (String os_id) -> bool
|
|
24
24
|
def present?: (String os_id) -> bool
|
|
25
25
|
def usable?: () -> bool
|
|
26
|
+
def list_ids: (String prefix) -> Array[String]
|
|
26
27
|
def unit_files?: (String os_id) -> bool
|
|
27
28
|
|
|
28
29
|
private
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module RubyRaider
|
|
2
|
-
module
|
|
2
|
+
module Schedules
|
|
3
3
|
module Os
|
|
4
4
|
class TaskScheduler
|
|
5
5
|
interface _Clock
|
|
@@ -9,12 +9,13 @@ module RubyRaider
|
|
|
9
9
|
FOLDER: String
|
|
10
10
|
ESCAPES: Hash[String, String]
|
|
11
11
|
NAMESPACE: String
|
|
12
|
-
OS_ID: Regexp
|
|
13
12
|
NEEDS_QUOTES: Regexp
|
|
14
13
|
GLOB: Regexp
|
|
15
14
|
EXPANDS: Regexp
|
|
16
15
|
DAY_NAMES: Array[String]
|
|
16
|
+
ROW: Regexp
|
|
17
17
|
|
|
18
|
+
@kind: Kind
|
|
18
19
|
@runner: CommandRunner
|
|
19
20
|
@clock: _Clock
|
|
20
21
|
@schtasks: String
|
|
@@ -24,29 +25,31 @@ module RubyRaider
|
|
|
24
25
|
def self.odd_doubled: (String slashes) -> String
|
|
25
26
|
def self.join: (Array[String] args) -> String
|
|
26
27
|
|
|
27
|
-
def initialize: (?runner: CommandRunner, ?clock: _Clock, ?schtasks: String) -> void
|
|
28
|
+
def initialize: (kind: Kind, ?runner: CommandRunner, ?clock: _Clock, ?schtasks: String) -> void
|
|
28
29
|
def label: () -> String
|
|
29
30
|
def task_name: (untyped os_id) -> String
|
|
30
|
-
def task_xml: (
|
|
31
|
-
def install: (
|
|
31
|
+
def task_xml: (_OsEntry schedule) -> String
|
|
32
|
+
def install: (_OsEntry schedule) -> true
|
|
32
33
|
def remove: (String os_id) -> bool
|
|
33
34
|
def present?: (String os_id) -> bool
|
|
35
|
+
def list_ids: (String prefix) -> Array[String]
|
|
34
36
|
|
|
35
37
|
private
|
|
36
38
|
|
|
37
39
|
def schtasks: (*String args) -> CommandRunner::Result
|
|
38
40
|
def list: () -> CommandRunner::Result
|
|
39
|
-
def
|
|
40
|
-
def
|
|
41
|
+
def tasks: () -> String
|
|
42
|
+
def listed?: (String text, String name) -> bool
|
|
43
|
+
def refuse_expansion: (_OsEntry schedule) -> void
|
|
41
44
|
def checked_os_id: (untyped os_id) -> String
|
|
42
45
|
def escape: (untyped value) -> String
|
|
43
46
|
def text: (String name, untyped value) -> Array[String]
|
|
44
47
|
def element: (String tag, Array[untyped] children) -> Array[String]
|
|
45
48
|
def indent: (Array[String] lines) -> Array[String]
|
|
46
|
-
def trigger: (
|
|
47
|
-
def calendar: (
|
|
49
|
+
def trigger: (_OsEntry schedule) -> Array[untyped]
|
|
50
|
+
def calendar: (_OsEntry schedule, String every) -> Array[String]
|
|
48
51
|
def settings: () -> Array[Array[String]]
|
|
49
|
-
def action: (
|
|
52
|
+
def action: (_OsEntry schedule) -> Array[Array[String]]
|
|
50
53
|
end
|
|
51
54
|
end
|
|
52
55
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module RubyRaider
|
|
2
|
+
module Schedules
|
|
3
|
+
class Project
|
|
4
|
+
DRIVER_HELPER: String
|
|
5
|
+
REQUIRES_RUNTIME: Regexp
|
|
6
|
+
MAX_HELPER_BYTES: Integer
|
|
7
|
+
NO_RUNTIME: String
|
|
8
|
+
OWN_VERSION: String
|
|
9
|
+
LOCKED_RAIDER: Regexp
|
|
10
|
+
MAX_LOCK_BYTES: Integer
|
|
11
|
+
|
|
12
|
+
attr_reader root: String
|
|
13
|
+
|
|
14
|
+
def initialize: (String path) -> void
|
|
15
|
+
def path: (String relative) -> String
|
|
16
|
+
def check_show_browser!: () -> void
|
|
17
|
+
def check_raider_version!: (?String own) -> void
|
|
18
|
+
def locked_raider_version: () -> (String | :no_lock | nil)
|
|
19
|
+
def runtime_driver?: () -> bool
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
module RubyRaider
|
|
2
|
-
module
|
|
3
|
-
|
|
2
|
+
module Schedules
|
|
3
|
+
# What an OS scheduler adapter and NextRun read from a schedule, tests or 4.1
|
|
4
|
+
interface _OsEntry
|
|
5
|
+
def name: () -> String
|
|
6
|
+
def every: () -> String
|
|
7
|
+
def on: () -> String?
|
|
8
|
+
def os_id: () -> String
|
|
9
|
+
def ruby: () -> String
|
|
10
|
+
def hour: () -> Integer
|
|
11
|
+
def minute: () -> Integer
|
|
12
|
+
def days: () -> Array[String]
|
|
13
|
+
def argv: () -> Array[String]
|
|
14
|
+
def env: () -> Hash[String, String]
|
|
15
|
+
def working_directory: () -> String
|
|
16
|
+
def log_path: () -> String
|
|
17
|
+
def rule_text: () -> String
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class Rule
|
|
4
21
|
EVERY: Array[String]
|
|
5
22
|
DAYS: Array[String]
|
|
6
23
|
DAYS_RULE: String
|
|
@@ -8,15 +25,12 @@ module RubyRaider
|
|
|
8
25
|
MINUTE: Regexp
|
|
9
26
|
GEM_ENV: Array[String]
|
|
10
27
|
SYSTEM_PATH: Array[String]
|
|
11
|
-
OS_ID_PREFIX: String
|
|
12
|
-
KEYS: Array[String]
|
|
13
28
|
|
|
14
29
|
attr_reader name: String
|
|
15
30
|
attr_reader every: String
|
|
16
31
|
attr_reader at: String
|
|
17
32
|
attr_reader on: String?
|
|
18
33
|
attr_reader retries: Integer
|
|
19
|
-
attr_reader inputs: Array[String]
|
|
20
34
|
attr_reader notify: bool
|
|
21
35
|
attr_reader os_id: String
|
|
22
36
|
attr_reader ruby: String
|
|
@@ -25,13 +39,13 @@ module RubyRaider
|
|
|
25
39
|
attr_reader project_root: String
|
|
26
40
|
attr_reader created_at: String
|
|
27
41
|
|
|
28
|
-
def self.
|
|
29
|
-
def self.from_h: (untyped hash, String project_root) -> Schedule
|
|
42
|
+
def self.kind: () -> Kind
|
|
30
43
|
def self.os_id_for: (String project_root, String name) -> String
|
|
44
|
+
def self.os_id_prefix_for: (String project_root) -> String
|
|
31
45
|
def self.bundle_path: () -> String
|
|
32
46
|
def self.captured_gem_env: () -> Hash[String, String]
|
|
33
47
|
|
|
34
|
-
def
|
|
48
|
+
def kind: () -> Kind
|
|
35
49
|
def hour: () -> Integer
|
|
36
50
|
def minute: () -> Integer
|
|
37
51
|
def days: () -> Array[String]
|
|
@@ -40,18 +54,15 @@ module RubyRaider
|
|
|
40
54
|
def working_directory: () -> String
|
|
41
55
|
def log_path: () -> String
|
|
42
56
|
def rule_text: () -> String
|
|
43
|
-
def to_h: () -> Hash[String, untyped]
|
|
44
57
|
|
|
45
58
|
private
|
|
46
59
|
|
|
47
|
-
def checked_name: (untyped name) -> String
|
|
48
60
|
def checked_every: (untyped every) -> String
|
|
49
61
|
def checked_at: (untyped at) -> String
|
|
50
62
|
def clock: (untyped at) -> String
|
|
51
63
|
def checked_on: (untyped on) -> String?
|
|
52
64
|
def checked_retries: (untyped retries) -> Integer
|
|
53
|
-
def
|
|
54
|
-
def checked_notify: (untyped notify) -> bool
|
|
65
|
+
def checked_flag: (String label, untyped flag) -> bool
|
|
55
66
|
def checked_os_id: (untyped os_id) -> String
|
|
56
67
|
def checked_path: (String label, untyped path) -> String
|
|
57
68
|
def checked_gem_env: (untyped gem_env) -> Hash[String, String]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module RubyRaider
|
|
2
|
+
module Schedules
|
|
3
|
+
class RunLock
|
|
4
|
+
LOCK: String
|
|
5
|
+
RUNNING: String
|
|
6
|
+
MAX_RUNNING_BYTES: Integer
|
|
7
|
+
|
|
8
|
+
@project: Project
|
|
9
|
+
@lock: File?
|
|
10
|
+
@run_id: String?
|
|
11
|
+
|
|
12
|
+
def initialize: (Project project) -> void
|
|
13
|
+
def acquire: (name: String, run_id: String, started_at: String) -> bool
|
|
14
|
+
def release: () -> void
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def lock: (String path) -> bool
|
|
19
|
+
def busy: () -> false
|
|
20
|
+
def inspect_running: (String running) -> Hash[Symbol, untyped]?
|
|
21
|
+
def remove_stale: (String running, Array[Integer]? id) -> bool
|
|
22
|
+
def restore: (String aside, String running) -> void
|
|
23
|
+
def live?: (Hash[String, untyped]? data) -> bool
|
|
24
|
+
def read_running: (String running) -> Hash[String, untyped]?
|
|
25
|
+
def parse_running: (File file) -> Hash[String, untyped]?
|
|
26
|
+
def write_running: (String running, String name, String run_id, String started_at) -> bool
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module RubyRaider
|
|
2
|
+
module Schedules
|
|
3
|
+
class RunLog
|
|
4
|
+
MAX_BYTES: Integer
|
|
5
|
+
MAX_LINES: Integer
|
|
6
|
+
FILE: String
|
|
7
|
+
LOCK: String
|
|
8
|
+
NOFOLLOW: Integer
|
|
9
|
+
NONBLOCK: Integer
|
|
10
|
+
|
|
11
|
+
@project: Project
|
|
12
|
+
@parts: Array[String]
|
|
13
|
+
@file: String
|
|
14
|
+
@lock: String
|
|
15
|
+
|
|
16
|
+
def self.private_dir: (Project project, *String parts) -> String
|
|
17
|
+
|
|
18
|
+
def initialize: (Project project, String name, ?dir: String) -> void
|
|
19
|
+
def lines: () -> Array[Hash[String, untyped]]
|
|
20
|
+
def last: () -> Hash[String, untyped]?
|
|
21
|
+
def last_result: () -> Hash[String, untyped]?
|
|
22
|
+
def find: (String run_id) -> Hash[String, untyped]?
|
|
23
|
+
def append: (Hash[String, untyped] line) -> void
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def locked: [T] () { () -> T } -> T
|
|
28
|
+
def add: (String text) -> void
|
|
29
|
+
def replace: (String text) -> void
|
|
30
|
+
def tail: () -> String
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module RubyRaider
|
|
2
|
+
module Schedules
|
|
3
|
+
class RunReport
|
|
4
|
+
DIR: String
|
|
5
|
+
RUN: String
|
|
6
|
+
INDEX: String
|
|
7
|
+
ATTACHMENTS: String
|
|
8
|
+
SLACK: Integer
|
|
9
|
+
MAX_RUN_BYTES: Integer
|
|
10
|
+
MAX_ATTACHMENT_BYTES: Integer
|
|
11
|
+
MAX_ATTACHMENT_DEPTH: Integer
|
|
12
|
+
MAX_ATTACHMENT_FILES: Integer
|
|
13
|
+
|
|
14
|
+
@dir: String
|
|
15
|
+
@run_json: String
|
|
16
|
+
|
|
17
|
+
attr_reader counts: Hash[String, Integer]
|
|
18
|
+
|
|
19
|
+
def self.load: (Project project, since: Time) -> RunReport?
|
|
20
|
+
def self.read_file: (String path, Integer max) -> [String, Time]?
|
|
21
|
+
def self.fresh?: (untyped run, Time? mtime, Time since) -> bool
|
|
22
|
+
|
|
23
|
+
def initialize: (String dir, String run_json, Array[untyped] results) -> void
|
|
24
|
+
def copy_to: (String target) -> bool
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
def copy_attachments: (String temp) -> void
|
|
29
|
+
def copy_file: (String source, String target, Integer size) -> void
|
|
30
|
+
def regular_files: (String dir, ?String? prefix, ?Hash[String, Integer] found, ?Integer depth) -> Hash[String, Integer]?
|
|
31
|
+
def swap: (String temp, String target) -> void
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|