Class: Pod::Command::HMapReader

Inherits:
Pod::Command show all
Defined in:
lib/cocoapods-hmap/command/hmap_reader.rb

Overview

hmap file reader cmd

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ HMapReader

Returns a new instance of HMapReader.



16
17
18
19
20
# File 'lib/cocoapods-hmap/command/hmap_reader.rb', line 16

def initialize(argv)
  super
  mapfile_path = argv.option('hmap-path')
  @mapfile_path = Pathname.new(mapfile_path).expand_path unless mapfile_path.nil?
end

Class Method Details

.optionsObject



28
29
30
31
32
# File 'lib/cocoapods-hmap/command/hmap_reader.rb', line 28

def self.options
  [
    ['--hmap-path=/hmap/dir/file', 'The path of the hmap file']
  ].concat(super)
end

Instance Method Details

#runObject



34
35
36
37
38
39
# File 'lib/cocoapods-hmap/command/hmap_reader.rb', line 34

def run
  UI.section "\n[hmap-reader] start..............\n".yellow do
    HMap::MapFileReader.new(@mapfile_path)
  end
  UI.puts("\n[hmap-reader] finish..............\n".yellow)
end

#validate!Object



22
23
24
25
26
# File 'lib/cocoapods-hmap/command/hmap_reader.rb', line 22

def validate!
  super
  banner! if help?
  raise '[ERROR]: --hmap-path no set'.red unless File.exist?(@mapfile_path)
end