Sha256: 89ef32fd66e94ecfa1f569edf79bce200e8516c6fc043d4e7459ce498e1cff5e

Contents?: true

Size: 828 Bytes

Versions: 22

Compression:

Stored size: 828 Bytes

Contents

module CommonHelpers
  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(options = {})
    target_path = options[:target_path] || options[:target_file] || options[:target] || 'Rakefile'
    in_project_folder do
      contents = File.read(target_path)
      File.open(target_path, "w+") do |f|
        f << "$:.unshift('#{@lib_path}')\n"
        f << contents
      end
    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

22 entries across 22 versions & 5 rubygems

Version Path
drnic-culerity-0.2.1 features/support/common.rb
drnic-culerity-0.2.2 features/support/common.rb
langalex-culerity-0.2.2 features/support/common.rb
langalex-culerity-0.2.3 features/support/common.rb
culerity-0.2.15 features/support/common.rb
culerity-0.2.14 features/support/common.rb
culerity-0.2.13 features/support/common.rb
culerity-0.2.12 features/support/common.rb
bobby-0.0.4 features/support/common.rb
culerity-0.2.10 features/support/common.rb
fletcherm-culerity-0.2.9 features/support/common.rb
culerity-0.2.9 features/support/common.rb
fletcherm-culerity-0.2.8 features/support/common.rb
culerity-0.2.8 features/support/common.rb
fletcherm-culerity-0.2.7 features/support/common.rb
culerity-0.2.7 features/support/common.rb
fletcherm-culerity-0.2.6 features/support/common.rb
culerity-0.2.6 features/support/common.rb
fletcherm-culerity-0.2.5 features/support/common.rb
culerity-0.2.5 features/support/common.rb