Module: Debci

Defined in:
lib/debci.rb,
lib/debci/db.rb,
lib/debci/api.rb,
lib/debci/app.rb,
lib/debci/job.rb,
lib/debci/key.rb,
lib/debci/log.rb,
lib/debci/amqp.rb,
lib/debci/data.rb,
lib/debci/feed.rb,
lib/debci/home.rb,
lib/debci/html.rb,
lib/debci/user.rb,
lib/debci/admin.rb,
lib/debci/feeds.rb,
lib/debci/graph.rb,
lib/debci/config.rb,
lib/debci/status.rb,
lib/debci/worker.rb,
lib/debci/backend.rb,
lib/debci/package.rb,
lib/debci/auth_app.rb,
lib/debci/frontend.rb,
lib/debci/html/cli.rb,
lib/debci/collector.rb,
lib/debci/expiration.rb,
lib/debci/test/paths.rb,
lib/debci/validators.rb,
lib/debci/reject_list.rb,
lib/debci/html_helpers.rb,
lib/debci/self_service.rb,
lib/debci/test_handler.rb,
lib/debci/storage_limit.rb,
lib/debci/test/duration.rb,
lib/debci/package_status.rb,
lib/debci/extra_apt_source.rb,
lib/debci/extra_apt_sources_list.rb

Defined Under Namespace

Modules: AMQP, DB, Data, HTMLHelpers, Test, TestHandler, Validators Classes: API, Admin, App, AuthApp, Backend, Collector, CommandFailed, Config, Expiration, ExtraAptSource, ExtraAptSourcesList, Feed, Feeds, Frontend, Graph, HTML, Home, Job, Key, Log, Package, PackageStatus, RejectList, SelfService, Status, StorageLimit, User, Worker

Class Method Summary collapse

Class Method Details

.configObject



14
15
16
# File 'lib/debci.rb', line 14

def config
  @config ||= Debci::Config.new
end

.config!(data) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/debci.rb', line 26

def config!(data)
  data.each do |k, v|
    ENV["debci_#{k}"] = v
  end
  @config = nil
  @reject_list = nil
  @extra_apt_sources_list = nil
end

.extra_apt_sources_listObject



22
23
24
# File 'lib/debci.rb', line 22

def extra_apt_sources_list
  @extra_apt_sources_list ||= Debci::ExtraAptSourcesList.new(File.join(Debci.config.config_dir, 'extra_apt_sources_list.yaml'))
end

.log(*str) ⇒ Object



35
36
37
38
39
40
# File 'lib/debci.rb', line 35

def log(*str)
  return if config.quiet

  puts(*str)
  $stdout.flush
end

.reject_listObject



18
19
20
# File 'lib/debci.rb', line 18

def reject_list
  @reject_list ||= Debci::RejectList.new
end

.run(*argv) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/debci.rb', line 46

def run(*argv)
  system(*argv)
  return if $?.exitstatus == 0

  cmdline = argv.map { |s| Shellwords.shellescape(s) }.join(' ')
  raise Debci::CommandFailed.new(cmdline)
end

.warn(*str) ⇒ Object



42
43
44
# File 'lib/debci.rb', line 42

def warn(*str)
  $stderr.puts(*str)
end