Sha256: f5bc211b5d5c02efebed30c96a51ef665d1efa99f96034e94183350036b8db91

Contents?: true

Size: 897 Bytes

Versions: 39

Compression:

Stored size: 897 Bytes

Contents

module CommonHelpers
  def get_command_output
    strip_color_codes(File.read(@stdout)).chomp
  end

  def strip_color_codes(text)
    text.gsub(/\e\[\d+m/, '')
  end

  def in_tmp_folder(&block)
    FileUtils.chdir(@tmp_root, &block)
  end

  def in_project_folder(&block)
    project_folder = @active_project_folder || @tmp_root
    FileUtils.chdir(project_folder, &block)
  end

  def in_home_folder(&block)
    FileUtils.chdir(@home_path, &block)
  end

  def force_local_lib_override(project_name = @project_name)
    rakefile = File.read(File.join(project_name, 'Rakefile'))
    File.open(File.join(project_name, 'Rakefile'), "w+") do |f|
      f << "$:.unshift('#{@lib_path}')\n"
      f << rakefile
    end
  end

  def setup_active_project_folder project_name
    @active_project_folder = File.join(@tmp_root, project_name)
    @project_name = project_name
  end
end

World(CommonHelpers)

Version data entries

39 entries across 39 versions & 7 rubygems

Version Path
hudson-0.3.0.beta.17 features/support/common.rb
engineyard-hudson-0.2.1 features/support/common.rb
hudson-0.3.0.beta.16 features/support/common.rb
hudson-0.3.0.beta.15 features/support/common.rb
hudson-0.3.0.beta.14 features/support/common.rb
engineyard-hudson-0.2.0 features/support/common.rb
engineyard-hudson-0.1.0 features/support/common.rb
hudson-0.3.0.beta.13 features/support/common.rb
hudson-0.3.0.beta.12 features/support/common.rb
hudson-0.3.0.beta.11 features/support/common.rb
hudson-0.3.0.beta.10 features/support/common.rb
hudson-0.3.0.beta.9 features/support/common.rb
hudson-0.3.0.beta.8 features/support/common.rb
hudson-0.3.0.beta.7 features/support/common.rb
hudson-0.3.0.beta.6 features/support/common.rb
hudson-0.3.0.beta.5 features/support/common.rb
hudson-0.3.0.beta.4 features/support/common.rb
hudson-0.3.0.beta.3 features/support/common.rb
hudson-0.3.0.beta.2 features/support/common.rb