lib/legion/extensions.rb in legionio-0.3.0 vs lib/legion/extensions.rb in legionio-0.3.1

- old
+ new

@@ -146,19 +146,79 @@ false end def find_extensions @extensions ||= {} + # puts Gem.install('lex-esphome') + # puts Gem::Installer.new('lex-esphome') + # test = Gem::Installer.new('lex-esphome') + # puts test.install + # puts Gem::Dependency.new('lex-esphome') + # $LOAD_PATH << "#{ENV['GEM_HOME']}/gems/lex-esphome-0.1.0/lib" + # require 'legion/extensions/esphome' + # $LOAD_PATH << "#{ENV['GEM_HOME']}/gems/lex-esphome-0.1.0/lib" + # ENV['MY_RUBY_HOME'] #/Users/miverso2/.rvm/rubies/ruby-2.7.0 + # ENV['GEM_HOME'] # /Users/miverso2/.rvm/gems/ruby-2.7.0 + # require 'rubygems/dependency_installer.rb' + # puts Gem::DependencyInstaller.new.install('lex-esphome') + # puts Gem::Installer.new('lex-esphome').install + # puts Gem::Installer.new('lex-esphome').ensure_loadable_spec + # puts Gem.search('lex-esphome') + # Gem.clear_paths + # require 'legion/extensions/esphome' + + # puts Gem.use_gemdeps + # pp Gem.gemdeps + # puts 'gems things' + # puts Gem.loaded_specs.key? 'lex-esphome' + # pp Gem.loaded_specs.keys + # + # require 'rubygems' + # require 'rubygems/command.rb' + # require 'rubygems/dependency_installer.rb' + # + # Gem::Command.build_args = ARGV + # inst = Gem::DependencyInstaller.new + # puts inst.installed_gems + # puts inst.install 'lex-esphome', install_as_default: true + # puts inst.installed_gems + # puts '....' + # test = Gem::DependencyList.new + # test.add(inst) + # pp test.find_name('lex-esphome') + # pp test.find_name('lex-logger') + # pp test.specs + # pp Gem::DependencyList.from_specs + # pp Gem::DependencyList.from_specs.key? 'lex-logg' + # pp inst + # + # pp Gem.new.all_specs + # load 'legion/extensions/esphome.rb' + # puts Gem.register_default_spec() + # :use_gemdeps, + # :detect_gemdeps, + # :source_date_epoch, + # :gemdeps, + # :register_default_spec, + # :find_unresolved_default_spec, + # :clear_default_specs, + # :loaded_specs, + # :default_path, + Gem::Specification.all_names.each do |gem| next unless gem[0..3] == 'lex-' lex = gem.split('-') @extensions[lex[1]] = { full_gem_name: gem, gem_name: "lex-#{lex[1]}", extension_name: lex[1], version: lex[2], extension_class: "Legion::Extensions::#{lex[1].capitalize}" } end + + # Legion::Settings[:extensions].each do |extension| + # puts extension unless @extensions.key? extension + # end end end end end