Class: MVCLI::Plugins::InstallationModel
- Inherits:
-
Object
- Object
- MVCLI::Plugins::InstallationModel
- Defined in:
- lib/mvcli/plugins/models/plugins/installation_model.rb
Instance Method Summary collapse
- #gemspec ⇒ Object
-
#initialize(form) ⇒ InstallationModel
constructor
A new instance of InstallationModel.
- #location ⇒ Object
- #name ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(form) ⇒ InstallationModel
Returns a new instance of InstallationModel.
4 5 6 |
# File 'lib/mvcli/plugins/models/plugins/installation_model.rb', line 4 def initialize(form) @form = form end |
Instance Method Details
#gemspec ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mvcli/plugins/models/plugins/installation_model.rb', line 20 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 |
#location ⇒ Object
16 17 18 |
# File 'lib/mvcli/plugins/models/plugins/installation_model.rb', line 16 def location @form.path end |
#name ⇒ Object
8 9 10 |
# File 'lib/mvcli/plugins/models/plugins/installation_model.rb', line 8 def name gemspec.name end |
#version ⇒ Object
12 13 14 |
# File 'lib/mvcli/plugins/models/plugins/installation_model.rb', line 12 def version gemspec.version end |