Class: ArcadiaGemsWizard

Inherits:
Object
  • Object
show all
Defined in:
lib/a-core.rb

Instance Method Summary collapse

Constructor Details

#initialize(_arcadia) ⇒ ArcadiaGemsWizard

Returns a new instance of ArcadiaGemsWizard.


2886
2887
2888
2889
# File 'lib/a-core.rb', line 2886

def initialize(_arcadia)
  @arcadia = _arcadia
  Arcadia.attach_listener(self, NeedRubyGemWizardEvent)
end

Instance Method Details

#on_need_ruby_gem_wizard(_event) ⇒ Object


2891
2892
2893
2894
# File 'lib/a-core.rb', line 2891

def on_need_ruby_gem_wizard(_event)
  msg = Arcadia.text("main.e.gem_missing.msg", [_event.gem_name, _event.extension_name])
  ArcadiaProblemEvent.new(self, "type"=>ArcadiaProblemEvent::DEPENDENCE_MISSING_TYPE,"title"=>Arcadia.text("main.e.gem_missing.title", [_event.gem_name]), "detail"=>msg).go!
end

#try_to_install_gem(name, repository = nil, version = '>0') ⇒ Object


2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
# File 'lib/a-core.rb', line 2896

def try_to_install_gem(name, repository=nil, version = '>0')
  ret = false
  sh=ArcadiaSh.new
  cmd = "gem install --remote --include-dependencies #{name}"
  cmd="sudo #{cmd}" if !Arcadia.is_windows?
  cmd+=" --source=#{repository}" if repository
  sh.prepare_exec(cmd)
  while sh.wait
    Tk.update
    #sleep(1)
  end
  ret=sh.result
  sh.destroy
  Gem.clear_paths
  ret
end