Class: Omnibus::CLI

Inherits:
Omnibus::Command::Base show all
Defined in:
lib/omnibus/cli.rb

Defined Under Namespace

Classes: Runner

Instance Method Summary collapse

Methods inherited from Omnibus::Command::Base

dispatch, #help, #initialize

Methods included from Logging

included

Constructor Details

This class inherits a constructor from Omnibus::Command::Base

Instance Method Details

#build(name) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/omnibus/cli.rb', line 73

def build(name)
  manifest = if @options[:use_manifest]
               Omnibus::Manifest.from_file(@options[:use_manifest])
             else
               nil
             end

  project = Project.load(name, manifest)
  say("Building #{project.name} #{project.build_version}...")
  project.download
  project.build

  if @options[:output_manifest]
    FileUtils.mkdir_p('pkg')
    File.open(::File.join('pkg', 'version-manifest.json'), 'w') do |f|
      f.write(project.built_manifest.to_json)
    end
  end
end

#listObject



137
138
139
140
141
142
143
144
145
146
# File 'lib/omnibus/cli.rb', line 137

def list
  if Omnibus.projects.empty?
    say('There are no Omnibus projects!')
  else
    say('Omnibus projects:')
    Omnibus.projects.sort.each do |project|
      say("  * #{project.name} (#{project.build_version})")
    end
  end
end

#manifest(name) ⇒ Object



103
104
105
# File 'lib/omnibus/cli.rb', line 103

def manifest(name)
  puts JSON.pretty_generate(Project.load(name).built_manifest.to_hash)
end

#versionObject



162
163
164
# File 'lib/omnibus/cli.rb', line 162

def version
  say("Omnibus v#{Omnibus::VERSION}")
end