Class: Ora::Cli::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/ora/cli/task.rb

Constant Summary collapse

MAIN_BRANCHES =
%w{master develop staging uat}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, inputs: [], print: Print.new) ⇒ Task

Returns a new instance of Task.



11
12
13
14
15
16
17
# File 'lib/ora/cli/task.rb', line 11

def initialize(from, inputs: [], print: Print.new)
  @from   = from
  @bash   = Bash.new(self, from: @from, print: print)
  @branch = current_branch
  @stdin  = Stdin.new(bash: @bash, print: print, inputs: inputs)
  @print  = print
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



7
8
9
# File 'lib/ora/cli/task.rb', line 7

def branch
  @branch
end

Returns the value of attribute print.



7
8
9
# File 'lib/ora/cli/task.rb', line 7

def print
  @print
end

#stdinObject (readonly)

Returns the value of attribute stdin.



7
8
9
# File 'lib/ora/cli/task.rb', line 7

def stdin
  @stdin
end

Instance Method Details

#commandsObject



23
24
25
# File 'lib/ora/cli/task.rb', line 23

def commands
  raise "Override this method in subclass"
end

#runObject



19
20
21
# File 'lib/ora/cli/task.rb', line 19

def run
  @bash.run commands
end

#success?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/ora/cli/task.rb', line 27

def success?
  @bash.success?
end