Class: Doubleshot::CLI::Commands::Pom

Inherits:
Doubleshot::CLI show all
Defined in:
lib/doubleshot/commands/pom.rb

Constant Summary

Constants inherited from Doubleshot::CLI

USAGE

Class Method Summary collapse

Methods inherited from Doubleshot::CLI

commands, detect, inherited, task_name, usage

Class Method Details

.optionsObject



9
10
11
12
13
14
15
16
# File 'lib/doubleshot/commands/pom.rb', line 9

def self.options
  Options.new do |options|
    options.banner = "Usage: doubleshot pom"

    options.separator ""
    options.separator "Summary: #{summary}"
  end
end

.start(args) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/doubleshot/commands/pom.rb', line 18

def self.start(args)
  require "doubleshot/pom"

  pom = Pathname("pom.xml")
  pom.rename("pom.xml.#{Time.now.to_i}") if pom.exist?
  pom.open("w+") do |file|
    file << Doubleshot::Pom.new(Doubleshot::current.config).to_s
  end

  return 0
end

.summaryObject



3
4
5
6
7
# File 'lib/doubleshot/commands/pom.rb', line 3

def self.summary
  <<-EOS.margin
    Generate a pom.xml based on your Doubleshot file.
  EOS
end