Class: Andrake::Manifest

Inherits:
Object
  • Object
show all
Includes:
Version
Defined in:
lib/andrake/manifest.rb

Defined Under Namespace

Modules: Version

Constant Summary collapse

ManifestFile =
'AndroidManifest.xml'

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Version

#bump_major, #bump_minor, #bump_patch, #update_version, #version

Constructor Details

#initialize(xml) ⇒ Manifest

Returns a new instance of Manifest.



11
12
13
# File 'lib/andrake/manifest.rb', line 11

def initialize(xml)
  @document = ::Nokogiri::XML(xml)
end

Class Method Details

.loadObject



8
# File 'lib/andrake/manifest.rb', line 8

def load ; new File.read(manifest_file) ; end

.manifest_fileObject



7
# File 'lib/andrake/manifest.rb', line 7

def manifest_file ; ManifestFile ; end

Instance Method Details

#saveObject



15
16
17
18
19
# File 'lib/andrake/manifest.rb', line 15

def save
  File.open(self.class.manifest_file, 'w') do |f|
    @document.write_xml_to f
  end
end