Sha256: 336ca8d32405612aa0107de3d1935342653661bfc4947903dd59ffb1b2247404

Contents?: true

Size: 363 Bytes

Versions: 6

Compression:

Stored size: 363 Bytes

Contents

require 'pathname'

module PathHelper

  def repo_path=(repo_path)
    @repo_path = repo_path
  end

  def repo_path
    @repo_path
  end

  def repo_relative(path)
    ensure_path(path).relative_path_from(repo_path)
  end

  def in_repo(path)
    repo_path.join(path)
  end

  def ensure_path(path)
    path.is_a?(Pathname) ? path : Pathname.new(path)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
soywiki-0.9.8.3 lib/path_helper.rb
soywiki-0.9.8.2 lib/path_helper.rb
soywiki-0.9.8.2.pre.2 lib/path_helper.rb
soywiki-0.9.8.2.pre.1 lib/path_helper.rb
soywiki-0.9.8.2.pre lib/path_helper.rb
soywiki-0.9.8.1 lib/path_helper.rb