Ruby 获取从源代码绑定的所有gem的列表
有没有办法通过路径选项检测您环境中哪些gem是从源代码加载的 即: 使用,执行以下操作:Ruby 获取从源代码绑定的所有gem的列表,ruby,rubygems,bundler,Ruby,Rubygems,Bundler,有没有办法通过路径选项检测您环境中哪些gem是从源代码加载的 即: 使用,执行以下操作: require 'rubygems' ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) Gem.loaded_specs.values.map { |g| puts "#{g.name
require 'rubygems'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
Gem.loaded_specs.values.map { |g| puts "#{g.name} from #{g.source}. Not safe to push to origin." if g.source.instance_of? Bundler::Source::Path }
使用,执行以下操作:
require 'rubygems'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
Gem.loaded_specs.values.map { |g| puts "#{g.name} from #{g.source}. Not safe to push to origin." if g.source.instance_of? Bundler::Source::Path }
正是我需要的。谢谢正是我需要的。谢谢
require 'rubygems'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
Gem.loaded_specs.values.map { |g| puts "#{g.name} from #{g.source}. Not safe to push to origin." if g.source.instance_of? Bundler::Source::Path }