Class: Gemat::InDsl

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gemfile = nil) ⇒ InDsl

rubocop:disable Metrics/MethodLength



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/in_dsl.rb', line 8

def initialize(gemfile = nil)
  gemfile ||= Bundler.default_gemfile.to_s
  dsl = Bundler::Dsl.new
  dsl.eval_gemfile(gemfile)

  class << dsl
    attr_accessor :sources, :git_sources, :groups, :gemfiles
  end

  @dependencies = dsl.dependencies
  @sources = dsl.sources
  @git_sources = dsl.git_sources
  @groups = dsl.groups
  @gemfiles = dsl.gemfiles
end

Instance Attribute Details

#dependenciesObject

Returns the value of attribute dependencies.



5
6
7
# File 'lib/in_dsl.rb', line 5

def dependencies
  @dependencies
end

#gemfilesObject

Returns the value of attribute gemfiles.



5
6
7
# File 'lib/in_dsl.rb', line 5

def gemfiles
  @gemfiles
end

#git_sourcesObject

Returns the value of attribute git_sources.



5
6
7
# File 'lib/in_dsl.rb', line 5

def git_sources
  @git_sources
end

#groupsObject

Returns the value of attribute groups.



5
6
7
# File 'lib/in_dsl.rb', line 5

def groups
  @groups
end

#sourcesObject

Returns the value of attribute sources.



5
6
7
# File 'lib/in_dsl.rb', line 5

def sources
  @sources
end