Class: Maven::Tools::PomGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/maven/tools/pom_generator.rb

Instance Method Summary collapse

Instance Method Details

#read_gemfile(filename, plugin_version = nil, dummy = nil) ⇒ Object

the dummy allows to have all three methods the same argument list



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/maven/tools/pom_generator.rb', line 35

def read_gemfile(filename, plugin_version = nil, dummy = nil)
  dir = File.dirname(filename)
  proj = 
    if File.exists? File.join( dir, 'config', 'application.rb' )
      Maven::Tools::RailsProject.new
    else
      Maven::Tools::GemProject.new
    end
  proj.load_gemfile(filename.to_s)
  proj.load_jarfile(File.join(File.dirname(filename.to_s), 'Jarfile'))
  proj.load_mavenfile(File.join(File.dirname(filename.to_s), 'Mavenfile'))
  proj.add_defaults(versions(plugin_version, nil))
  proj.to_xml
end

#read_gemspec(filename, plugin_version = nil, dummy = nil) ⇒ Object

the dummy allows to have all three methods the same argument list



51
52
53
54
55
56
57
58
# File 'lib/maven/tools/pom_generator.rb', line 51

def read_gemspec(filename, plugin_version = nil, dummy = nil)
  proj = Maven::Tools::GemProject.new
  proj.load_gemspec(filename.to_s)
  proj.load_jarfile(File.join(File.dirname(filename.to_s), 'Jarfile'))
  proj.load_mavenfile(File.join(File.dirname(filename.to_s), 'Mavenfile'))
  proj.add_defaults(versions(plugin_version, nil))
  proj.to_xml
end

#read_rails(filename, plugin_version = nil, jruby_version = nil) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/maven/tools/pom_generator.rb', line 25

def read_rails(filename, plugin_version = nil, jruby_version = nil)
  proj = Maven::Tools::RailsProject.new
  proj.load_gemfile(filename.to_s)
  proj.load_jarfile(File.join(File.dirname(filename.to_s), 'Jarfile'))
  proj.load_mavenfile(File.join(File.dirname(filename.to_s), 'Mavenfile'))
  proj.add_defaults(versions(plugin_version, jruby_version))
  proj.to_xml
end