class Spandx::Rubygems::Backup

Constants

LOAD_SCRIPT
SQL

Attributes

uri[R]

Public Class Methods

new(uri, db_connection) click to toggle source
# File lib/spandx/rubygems/backup.rb, line 18
def initialize(uri, db_connection)
  @uri = uri
  @db_connection = db_connection
end

Public Instance Methods

each() { |row| ... } click to toggle source
# File lib/spandx/rubygems/backup.rb, line 23
def each
  execute(SQL) do |row|
    yield row
  end
end
execute(sql) { |row| ... } click to toggle source
# File lib/spandx/rubygems/backup.rb, line 29
def execute(sql)
  download do
    @db_connection.exec(sql) do |result|
      result.each do |row|
        yield row
      end
    end
  end
end
to_s() click to toggle source
# File lib/spandx/rubygems/backup.rb, line 39
def to_s
  @uri.to_s
end

Private Instance Methods

download() { || ... } click to toggle source
# File lib/spandx/rubygems/backup.rb, line 45
def download
  yield if system(LOAD_SCRIPT, to_s)
end