Sha256: e737384082c368fee3c26845483043eeff96db6096689870457d5abb1b122f9c

Contents?: true

Size: 585 Bytes

Versions: 2

Compression:

Stored size: 585 Bytes

Contents

module Pessimize
  class FileManager
    def gemfile
      'Gemfile'
    end

    def gemfile_lock
      'Gemfile.lock'
    end

    def gemfile?
      File.exists? gemfile
    end

    def gemfile_contents
      File.read gemfile
    end

    def gemfile_lock?
      File.exists? gemfile_lock
    end

    def backup_gemfile!
      backup_file! gemfile
    end

    def backup_gemfile_lock!
      backup_file! gemfile_lock
    end

  private
    def backup_file!(file)
      cmd = "cp #{file} #{file}.backup"
      puts cmd
      system cmd
      $?.exitstatus == 0
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pessimize-0.0.3 lib/pessimize/file_manager.rb
pessimize-0.0.2 lib/pessimize/file_manager.rb