Sha256: e795a93948e7e4b5974eb9ea680dd53fdbe7108e3b57f588df4d5b23b76e4a33

Contents?: true

Size: 868 Bytes

Versions: 7

Compression:

Stored size: 868 Bytes

Contents

# frozen_string_literal: true

require 'eac_git/rspec/stubbed_git_local_repo/fs_object'
require 'fileutils'

module EacGit
  module Rspec
    module StubbedGitLocalRepo
      class Directory < ::EacGit::Rspec::StubbedGitLocalRepo::FsObject
        # @return [self]
        def create
          ::FileUtils.mkdir_p(path)
          self
        end

        # @return [self]
        def delete
          ::FileUtils.rm_rf(path)
          self
        end

        # @param subpath [Array<String>]
        # @return [EacGit::Rspec::StubbedGitLocalRepo::Directory]
        def directory(*subpath)
          git.directory(*self.subpath, *subpath)
        end

        # @param subpath [Array<String>]
        # @return [EacGit::Rspec::StubbedGitLocalRepo::File]
        def file(*subpath)
          git.file(*self.subpath, *subpath)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
eac_tools-0.86.5 sub/eac_git/lib/eac_git/rspec/stubbed_git_local_repo/directory.rb
eac_tools-0.86.4 sub/eac_git/lib/eac_git/rspec/stubbed_git_local_repo/directory.rb
eac_tools-0.86.3 sub/eac_git/lib/eac_git/rspec/stubbed_git_local_repo/directory.rb
eac_git-0.16.0 lib/eac_git/rspec/stubbed_git_local_repo/directory.rb
eac_tools-0.86.2 sub/eac_git/lib/eac_git/rspec/stubbed_git_local_repo/directory.rb
eac_git-0.15.0 lib/eac_git/rspec/stubbed_git_local_repo/directory.rb
eac_tools-0.84.2 sub/eac_git/lib/eac_git/rspec/stubbed_git_local_repo/directory.rb