Module: RepoManager::ViewHelper
- Included in:
- Generate
- Defined in:
- lib/repo_manager/views/view_helper.rb
Instance Method Summary collapse
-
#path_to(*args) ⇒ String
path_to returns absolute installed path to various folders packaged with the RepoManager gem.
Instance Method Details
#path_to(*args) ⇒ String
path_to returns absolute installed path to various folders packaged with the RepoManager gem
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/repo_manager/views/view_helper.rb', line 30 def path_to(*args) case when args.length == 1 base_path = :repo_manager asset = args when args.length == 2 base_path, asset = *args when args.length > 2 raise ArgumentError, "Too many arguments" else raise ArgumentError, "Specify at least the file asset" end case base_path when :repo_manager root = File.('../../../../', __FILE__) else raise "unknown base_path" end File.join(root, asset) end |