Class: Degem::Gemfile

Inherits:
Object
  • Object
show all
Defined in:
lib/degem/gemfile.rb

Instance Method Summary collapse

Constructor Details

#initialize(dsl:, gem_specification:) ⇒ Gemfile

Returns a new instance of Gemfile.



5
6
7
8
# File 'lib/degem/gemfile.rb', line 5

def initialize(dsl:, gem_specification:)
  @dsl = dsl
  @gem_specification = gem_specification
end

Instance Method Details

#rails?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/degem/gemfile.rb', line 17

def rails?
  !!rubygems.find(&:rails?)
end

#rubygemsObject



10
11
12
13
14
15
# File 'lib/degem/gemfile.rb', line 10

def rubygems
  @rubygems ||=
    (gemfile_dependencies + gemspec_dependencies)
    .map { Rubygem.new(rubygem: _1, gem_specification: @gem_specification) }
    .uniq
end