Class: Gemlist
- Inherits:
-
Object
- Object
- Gemlist
- Defined in:
- lib/gemlist.rb,
lib/gemlist/version.rb,
lib/gemlist/spec_node.rb,
lib/gemlist/spec_tree.rb,
lib/gemlist/group_conflict.rb
Defined Under Namespace
Classes: GroupConflict, SpecNode, SpecTree
Constant Summary collapse
- VERSION =
"0.4.1"
Instance Method Summary collapse
- #gems ⇒ Object
-
#initialize(path, options = {}) ⇒ Gemlist
constructor
A new instance of Gemlist.
- #sources ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ Gemlist
Returns a new instance of Gemlist.
7 8 9 10 |
# File 'lib/gemlist.rb', line 7 def initialize(path, = {}) @path = Pathname.new(path) @options = end |
Instance Method Details
#gems ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/gemlist.rb', line 19 def gems cached_specs = specs cached_specs.each.with_index.with_object([]) do |(spec, index), uniquified_specs| last_occurrence_of_spec = cached_specs.rindex(spec) == index uniquified_specs << spec if last_occurrence_of_spec end end |
#sources ⇒ Object
12 13 14 15 16 17 |
# File 'lib/gemlist.rb', line 12 def sources lockfile_parser.sources .select { |source| source.is_a?(Bundler::Source::Rubygems) } .flat_map(&:remotes) .map(&:to_s) end |