class Yoda::Store::Actions::BuildCoreIndex

@todo Build index without using shell script

Public Class Methods

exists?() click to toggle source
# File lib/yoda/store/actions/build_core_index.rb, line 12
def exists?
  [
    "~/.yoda/sources/ruby-#{RUBY_VERSION}/.yardoc",
    "~/.yoda/sources/ruby-#{RUBY_VERSION}/.yardoc-stdlib",
  ].all? { |path| File.exists?(File.expand_path(path)) }
end
run() click to toggle source

@return [true, false]

# File lib/yoda/store/actions/build_core_index.rb, line 8
def run
  new.run
end

Public Instance Methods

run() click to toggle source

@return [true, false]

# File lib/yoda/store/actions/build_core_index.rb, line 21
def run
  build_core_index
end

Private Instance Methods

build_core_index() click to toggle source
# File lib/yoda/store/actions/build_core_index.rb, line 32
def build_core_index
  o, e = Open3.capture2e(script_path)
  Logger.debug o unless o.empty?
  if e.success?
    Logger.info "Success to build yard index"
  else
    Logger.warn "Failed to build core index"
  end
end
script_path() click to toggle source

@return [String]

# File lib/yoda/store/actions/build_core_index.rb, line 28
def script_path
  File.expand_path('../../../../scripts/build_core_index.sh', __dir__)
end