Module: PathHelper
- Included in:
- Soywiki::Expander, Soywiki::Renamer
- Defined in:
- lib/path_helper.rb
Instance Method Summary collapse
- #ensure_path(path) ⇒ Object
- #in_repo(path) ⇒ Object
- #repo_path ⇒ Object
- #repo_path=(repo_path) ⇒ Object
- #repo_relative(path) ⇒ Object
Instance Method Details
#ensure_path(path) ⇒ Object
21 22 23 |
# File 'lib/path_helper.rb', line 21 def ensure_path(path) path.is_a?(Pathname) ? path : Pathname.new(path) end |
#in_repo(path) ⇒ Object
17 18 19 |
# File 'lib/path_helper.rb', line 17 def in_repo(path) repo_path.join(path) end |
#repo_path ⇒ Object
9 10 11 |
# File 'lib/path_helper.rb', line 9 def repo_path @repo_path end |
#repo_path=(repo_path) ⇒ Object
5 6 7 |
# File 'lib/path_helper.rb', line 5 def repo_path=(repo_path) @repo_path = repo_path end |
#repo_relative(path) ⇒ Object
13 14 15 |
# File 'lib/path_helper.rb', line 13 def repo_relative(path) ensure_path(path).relative_path_from(repo_path) end |