Module: GemOf
- Defined in:
- lib/gem_of.rb,
lib/version.rb,
lib/gem_of/rake_tasks.rb
Overview
Namespace for Gem methods
Defined Under Namespace
Modules: Version Classes: DocsTasks, GemTasks, Gems, LintTasks, RakeTasks, TestTasks, YardStickTasks
Class Method Summary collapse
-
.location_for ⇒ String
string for use as parameter to the #gem method reverse compat.
-
.location_of(place, fake_version = nil) ⇒ String
string for use as parameter to the #gem method.
Class Method Details
.location_for ⇒ String
string for use as parameter to the #gem method reverse compat
110 111 112 113 114 115 116 117 118 119 |
# File 'lib/gem_of.rb', line 110 def location_of(place, fake_version = nil) if place =~ /^(git:[^#]*)#(.*)/ [fake_version, { git: Regexp.last_match[1], branch: Regexp.last_match[2] }].compact elsif place =~ %r{^file:\/\/(.*)} [">= 0", { path: File.(Regexp.last_match[1]) }] else [place] end end |
.location_of(place, fake_version = nil) ⇒ String
string for use as parameter to the #gem method
100 101 102 103 104 105 106 107 108 109 |
# File 'lib/gem_of.rb', line 100 def location_of(place, fake_version = nil) if place =~ /^(git:[^#]*)#(.*)/ [fake_version, { git: Regexp.last_match[1], branch: Regexp.last_match[2] }].compact elsif place =~ %r{^file:\/\/(.*)} [">= 0", { path: File.(Regexp.last_match[1]) }] else [place] end end |