Class: Pod::Command::Bdtransform::ToSource

Inherits:
Pod::Command::Bdtransform show all
Defined in:
lib/cocoapods-BDTransform/command/BDTransform/ToSource.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ ToSource

Returns a new instance of ToSource.



53
54
55
56
57
# File 'lib/cocoapods-BDTransform/command/BDTransform/ToSource.rb', line 53

def initialize(argv)
  
  @bd_transform_pod = argv.arguments
  
end

Instance Method Details

#runObject



64
65
66
67
68
69
70
71
72
# File 'lib/cocoapods-BDTransform/command/BDTransform/ToSource.rb', line 64

def run
  cdir = $WORK_DIR_Source
  File::chmod(0777,"#{cdir}/AweToSource") if $WORK_DIR_Source == Dir.home() + '/.cocoapods-BDTransform'
  if !@bd_transform_pod.empty?
    string = @bd_transform_pod.to_s
    string = string.gsub("\"","").gsub("[","").gsub("]","").gsub(","," ")
    system("#{cdir}/AweToSource #{string}")
  end
end

#validate!Object



59
60
61
62
# File 'lib/cocoapods-BDTransform/command/BDTransform/ToSource.rb', line 59

def validate!

  help! 'A Pod name is required.' unless @bd_transform_pod.count > 0
end