Class: Pod::Command::Bin::Init::Push

Inherits:
Pod::Command::Bin::Init show all
Defined in:
lib/cocoapods-lhj-bin/command/bin/config/push.rb

Instance Method Summary collapse

Methods inherited from Pod::Command::Bin::Init

options

Methods inherited from Pod::Command::Bin

#validate!

Methods included from CBin::SpecFilesHelper

#binary_spec, #binary_spec_files, #binary_template_spec, #binary_template_spec_file, #binary_template_spec_files, #clear_binary_spec_file_if_needed, #code_spec, #code_spec_files, #create_binary_spec_file, #find_spec_file, #spec_files

Methods included from CBin::SourcesHelper

#binary_source, #code_source, #sources_manager, #sources_option, #valid_sources

Constructor Details

#initialize(argv) ⇒ Push

Returns a new instance of Push.



12
13
14
# File 'lib/cocoapods-lhj-bin/command/bin/config/push.rb', line 12

def initialize(argv)
  super
end

Instance Method Details

#pushObject



25
26
27
28
# File 'lib/cocoapods-lhj-bin/command/bin/config/push.rb', line 25

def push
  file = File.expand_path("#{Pod::Config.instance.home_dir}/bin_dev.yml")
  CBin::OSS::Helper.instance.upload('bin_dev.yml', file)
end

#push_cn_hkObject



20
21
22
23
# File 'lib/cocoapods-lhj-bin/command/bin/config/push.rb', line 20

def push_cn_hk
  file = File.expand_path("#{Pod::Config.instance.home_dir}/localizable_config.yml")
  CBin::OSS::Helper.instance.upload('localizable_config.yml', file)
end

#runObject



16
17
18
# File 'lib/cocoapods-lhj-bin/command/bin/config/push.rb', line 16

def run
  push
end

#transObject



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/cocoapods-lhj-bin/command/bin/config/push.rb', line 30

def trans
  key_map = {}
  path = '/Users/lihaijian/workspace/cocoa/cocoapods-lhj-bin-build-temp/zh2Hant.properties'
  File.open(path, 'r+') do |f|
    f.each_line do |line|
      arr = line.split('=')
      key = [arr[0][2, 4].hex].pack("U")
      val = arr[1].strip!
      key_map[key] = [val[2, 4].hex].pack("U")
    end
  end
  File.open('/Users/lihaijian/workspace/cocoa/cocoapods-lhj-bin-build-temp/zh2hant.yml', 'w') { |f| f.write key_map.to_yaml }
end