Class: Spandx::Cli::Commands::Pull

Inherits:
Object
  • Object
show all
Defined in:
lib/spandx/cli/commands/pull.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Pull

Returns a new instance of Pull.



9
10
11
12
13
# File 'lib/spandx/cli/commands/pull.rb', line 9

def initialize(options)
  @options = options
  @cache_dir = Spandx.git[:cache].root.join('.index')
  @rubygems_cache_dir = Spandx.git[:rubygems].root.join('.index')
end

Instance Attribute Details

#cache_dirObject (readonly)

Returns the value of attribute cache_dir.



7
8
9
# File 'lib/spandx/cli/commands/pull.rb', line 7

def cache_dir
  @cache_dir
end

#rubygems_cache_dirObject (readonly)

Returns the value of attribute rubygems_cache_dir.



7
8
9
# File 'lib/spandx/cli/commands/pull.rb', line 7

def rubygems_cache_dir
  @rubygems_cache_dir
end

Instance Method Details

#execute(output: $stderr) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/spandx/cli/commands/pull.rb', line 15

def execute(output: $stderr)
  sync(output)
  build(output, ::Spandx::Core::Dependency::PACKAGE_MANAGERS.values.uniq)
  index_files_in(cache_dir, rubygems_cache_dir).each do |item|
    output.puts item.to_s.gsub(Dir.home, '~')
  end
  output.puts 'OK'
end