Class: Afterlife::Clickup::Cli
- Inherits:
-
Thor
- Object
- Thor
- Afterlife::Clickup::Cli
show all
- Includes:
- BaseCli
- Defined in:
- lib/afterlife/clickup/cli.rb
Constant Summary
collapse
- CLICKUP_STATUS_OPTIONS =
StatusPrecedenceChecker::STATUS_PRECEDENCE.map { |s| "'#{s}'" }.join(', ')
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from BaseCli
#fatal!, #log_error, #log_info, #log_interrupted, #log_success, #sure?
Class Method Details
.exit_on_failure? ⇒ Boolean
10
11
12
|
# File 'lib/afterlife/clickup/cli.rb', line 10
def self.exit_on_failure?
true
end
|
Instance Method Details
17
18
19
20
21
|
# File 'lib/afterlife/clickup/cli.rb', line 17
def (text = nil)
text ||= $stdin.read
ids = GetIdsFromText.call(text, options[:link])
ids.each { |id| puts id }
end
|
#get_commits(from_revision, to_revision = 'HEAD') ⇒ Object
27
28
29
30
31
32
|
# File 'lib/afterlife/clickup/cli.rb', line 27
def get_commits(from_revision, to_revision = 'HEAD')
messages = GetRangeCommits.call(from_revision, to_revision, short: options[:short])
puts messages
rescue StandardError => e
fatal!(e.message)
end
|
#update_status(target_status, *task_ids) ⇒ Object
40
41
42
43
44
45
46
|
# File 'lib/afterlife/clickup/cli.rb', line 40
def update_status(target_status, *task_ids)
task_ids = $stdin.read.strip.split("\n") if task_ids.empty?
UpdateTaskStatus.call(task_ids, target_status, force: options[:force], dry_run: options[:dry_run])
rescue StandardError => e
fatal!(e.message)
end
|