Class: JBundler::PomRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/jbundler/pom_runner.rb

Direct Known Subclasses

JRubyComplete

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ PomRunner

Returns a new instance of PomRunner.



6
7
8
# File 'lib/jbundler/pom_runner.rb', line 6

def initialize( config )
  @config = config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



10
11
12
13
# File 'lib/jbundler/pom_runner.rb', line 10

def method_missing( m, *args )
  result = @config[ m ] || @config[ m.to_s ] 
  result.nil? ? super : result
end

Instance Method Details

#basedirObject



36
37
38
# File 'lib/jbundler/pom_runner.rb', line 36

def basedir
  File.expand_path( '.' )
end

#clean?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/jbundler/pom_runner.rb', line 57

def clean?
   @config[ 'clean' ] || false      
end

#debugObject



49
50
51
# File 'lib/jbundler/pom_runner.rb', line 49

def debug
   @config[ 'debug' ] || false
end

#exec(*args) ⇒ Object



65
66
67
68
69
# File 'lib/jbundler/pom_runner.rb', line 65

def exec( *args )
  maven.options[ '-f' ] ||= pom_file
  args.unshift :clean if clean?
  maven.exec( *args )
end

#mavenObject



32
33
34
# File 'lib/jbundler/pom_runner.rb', line 32

def maven
  @m ||= maven_new
end

#pom_fileObject



61
62
63
# File 'lib/jbundler/pom_runner.rb', line 61

def pom_file
  raise 'overwrite this method'
end

#verboseObject



53
54
55
# File 'lib/jbundler/pom_runner.rb', line 53

def verbose
   @config[ 'verbose' ] || false
end

#work_dirObject



44
45
46
47
# File 'lib/jbundler/pom_runner.rb', line 44

def work_dir
  # needs default here
  workdir || 'pkg'
end

#workdirObject



40
41
42
# File 'lib/jbundler/pom_runner.rb', line 40

def workdir
   @config[ 'workdir' ]
end