Sha256: 15f557d45f3653448bab931de6eccce5478267dd27af92d1bea448242d76850a

Contents?: true

Size: 719 Bytes

Versions: 12

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true

require 'active_support/core_ext/object/blank'
require 'colorize'
require 'pathname'

module Branch
  module Name
    module Locatable
      module_function

      def home_folder
        Dir.home
      end
      alias global_folder home_folder
      singleton_class.alias_method :global_folder, :home_folder

      def local_folder
        Dir.pwd
      end

      # Is the current folder we're in the same as the global folder?
      def global_folder?
        global_folder == local_folder
      end

      def project_folder(options: {})
        return home_folder if options.blank?

        home_folder
      end

      def temp_folder
        Dir.tmpdir
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
branch-name-4.0.3 lib/branch/name/locatable.rb
branch-name-4.0.2 lib/branch/name/locatable.rb
branch-name-4.0.1 lib/branch/name/locatable.rb
branch-name-4.0.0 lib/branch/name/locatable.rb
branch-name-3.10.10 lib/branch/name/locatable.rb
branch-name-3.10.9 lib/branch/name/locatable.rb
branch-name-3.10.8 lib/branch/name/locatable.rb
branch-name-3.10.7 lib/branch/name/locatable.rb
branch-name-3.10.6 lib/branch/name/locatable.rb
branch-name-3.10.5 lib/branch/name/locatable.rb
branch-name-3.10.4 lib/branch/name/locatable.rb
branch-name-3.10.3 lib/branch/name/locatable.rb