Class: CircleCI::Parallel::Environment Private

Inherits:
Object
  • Object
show all
Defined in:
lib/circleci/parallel/environment.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#cleanObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
# File 'lib/circleci/parallel/environment.rb', line 37

def clean
  FileUtils.rmtree(WORK_DIR) if Dir.exist?(WORK_DIR)
end

#configurationObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
# File 'lib/circleci/parallel/environment.rb', line 12

def configuration
  @configuration ||= Configuration.new
end

#configure {|configuration| ... } ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Yields:



16
17
18
# File 'lib/circleci/parallel/environment.rb', line 16

def configure
  yield configuration
end

#current_buildObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/circleci/parallel/environment.rb', line 20

def current_build
  @current_build ||= Build.new(ENV['CIRCLE_BUILD_NUM'].to_i, ENV['CIRCLE_NODE_TOTAL'].to_i)
end

#current_nodeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/circleci/parallel/environment.rb', line 24

def current_node
  @current_node ||= Node.new(current_build, ENV['CIRCLE_NODE_INDEX'].to_i)
end

#joinObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
31
# File 'lib/circleci/parallel/environment.rb', line 28

def join
  validate!
  task.run
end

#puts(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
# File 'lib/circleci/parallel/environment.rb', line 33

def puts(*args)
  Kernel.puts(*args) unless configuration.silent
end