Class: Objc_Obfuscator::CLI
- Inherits:
-
Thor
- Object
- Thor
- Objc_Obfuscator::CLI
- Includes:
- Integrator, Obfuscator, Thor::Actions
- Defined in:
- lib/objc-obfuscator/cli.rb
Instance Method Summary collapse
Methods included from Integrator
Methods included from Obfuscator
Instance Method Details
#integrate(encryption_key, project_path) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/objc-obfuscator/cli.rb', line 51 def integrate(encryption_key, project_path) raise Thor::Error, 'A valid project file should be specified' unless File.exist?(project_path) podfile_path = File.join File.dirname(project_path), './Podfile' unless [:podfile].empty? podfile_path = [:podfile] end raise Thor::Error, 'The project must be using cocoapods' unless File.exist?(podfile_path) integrate_xcode encryption_key, project_path, podfile_path, [:target] end |
#obfuscate(key, *file_paths) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/objc-obfuscator/cli.rb', line 24 def obfuscate(key, *file_paths) raise Thor::Error, 'A valid key and file must be provided' if key.empty? || file_paths.empty? file_paths.each do |file_path| unless File.exist? file_path say_status :warning, "File #{file_path} not found!", :yellow else Dir.mktmpdir { |tmp_dir| obfuscate_file file_path, tmp_dir, key, [:backup] } end end end |