Module: Pod::DirUtil
- Included in:
- Frameworker
- Defined in:
- lib/cocoapods-framework/util/dir_util.rb
Instance Method Summary collapse
- #create_target_directory_path_by_spec(spec, force) ⇒ Object
- #create_working_directory_by_spec(spec, force) ⇒ Object
Instance Method Details
#create_target_directory_path_by_spec(spec, force) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cocoapods-framework/util/dir_util.rb', line 3 def create_target_directory_path_by_spec spec,force target_dir = "#{Dir.pwd}/#{spec.name}-#{spec.version}" if File.exist? target_dir if @force Pathname.new(target_dir).rmtree else UI.warn "Target directory '#{target_dir}' already exists." end end target_dir end |
#create_working_directory_by_spec(spec, force) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/cocoapods-framework/util/dir_util.rb', line 16 def create_working_directory_by_spec spec,force target_dir = create_target_directory_path_by_spec spec,force # Pathname.new(target_dir).mkdir work_dir = Dir.tmpdir + '/frameworks-' + Array.new(8) { rand(36).to_s(36) }.join Pathname.new(work_dir).mkdir [target_dir, work_dir] end |