Module: Rwm::GemfileDsl

Defined in:
lib/rwm/gemfile.rb

Instance Method Summary collapse

Instance Method Details

#rwm_lib(name, **opts) ⇒ Object



24
25
26
27
# File 'lib/rwm/gemfile.rb', line 24

def rwm_lib(name, **opts)
  path = File.join(rwm_workspace_root, "libs", name.to_s)
  gem(name.to_s, **opts, path: path)
end

#rwm_workspace_rootObject



18
19
20
21
22
# File 'lib/rwm/gemfile.rb', line 18

def rwm_workspace_root
  @rwm_workspace_root ||= `git rev-parse --show-toplevel 2>/dev/null`.strip.tap do |root|
    raise "rwm: not inside a git repository" if root.empty?
  end
end