Class: Pod::Command::HMapReader

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ HMapReader

Returns a new instance of HMapReader.



13
14
15
16
17
# File 'lib/cocoapods-hmap-prebuilt/command/hmap_reader.rb', line 13

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

Class Method Details

.optionsObject



25
26
27
28
29
# File 'lib/cocoapods-hmap-prebuilt/command/hmap_reader.rb', line 25

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

Instance Method Details

#runObject



31
32
33
34
35
36
# File 'lib/cocoapods-hmap-prebuilt/command/hmap_reader.rb', line 31

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

#validate!Object



19
20
21
22
23
# File 'lib/cocoapods-hmap-prebuilt/command/hmap_reader.rb', line 19

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