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.



39
40
41
# File 'lib/circleci/parallel/environment.rb', line 39

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.



14
15
16
# File 'lib/circleci/parallel/environment.rb', line 14

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:



18
19
20
# File 'lib/circleci/parallel/environment.rb', line 18

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.



22
23
24
# File 'lib/circleci/parallel/environment.rb', line 22

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.



26
27
28
# File 'lib/circleci/parallel/environment.rb', line 26

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.



30
31
32
33
# File 'lib/circleci/parallel/environment.rb', line 30

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.



35
36
37
# File 'lib/circleci/parallel/environment.rb', line 35

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