Sha256: 10609ee303eb5224da92f2e01b911e661e923bf178ecbf500388be562558ae8b

Contents?: true

Size: 640 Bytes

Versions: 1

Compression:

Stored size: 640 Bytes

Contents

class MVCLI::Plugins::InstallationModel
  requires :config

  def initialize(form)
    @form = form
  end

  def name
    gemspec.name
  end

  def version
    gemspec.version
  end

  def location
    @form.path
  end

  def gemspec
    gemspec = Gem::Specification.load Dir[@form.path.join('*.gemspec')].first
    config.directory "plugins" do |dir|
      target = dir.join(gemspec.name)
      FileUtils.rm_rf target
      target.make_symlink location
      Gem.paths.path.unshift dir.to_s
      request = Gem::RequestSet.new *gemspec.dependencies
      request.resolve
      request.install_into dir
    end
    return gemspec
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mvcli-0.1.0 lib/mvcli/plugins/models/plugins/installation_model.rb