Sha256: d9e8991d3e63fd157dd383919e9f735d701a07c54a83b34cad3dba58de850962
Contents?: true
Size: 1.31 KB
Versions: 42
Compression:
Stored size: 1.31 KB
Contents
require 'yaml' require 'tmpdir' require 'fileutils' class ProjectGenerator PRJFILE_MINIMAL_CONFIG = { :project_name => "MyProject", :class_prefix => "XYZ" } PRJFILE_STANDARD_CONFIG = { :binary_name => "myproject", :target_name => "MyProjectTg", :tests_target_name => "MyProjectTgTests" }.merge(PRJFILE_MINIMAL_CONFIG) PRJFILE_COMPLETE_CONFIG = { :xcode_workspace => "MyProject.xcworkspace", :xcode_project => "MyProject/MyProject.xcodeproj", :xcode_scheme => "MyProject", :source_root => "MyProject/MyProjectTg", :tests_source_root => "MyProject/MyProjectTgTests", :frank_root => "MyProject/MyProjectTg/Frank", :frankified_app => "MyProject/MyProjectTg/Frank/frankified_build/Frankified.app" }.merge(PRJFILE_STANDARD_CONFIG) attr_accessor :config def project_folder @project_folder ||= Dir.mktmpdir raise "Can't create temp folder" unless @project_folder @project_folder end def create_test_project(project_file_config) @config = project_file_config File.open(File.join(project_folder, 'FWProjectfile'), 'w') {|f| f.write project_file_config.to_yaml } File.open(File.join(project_folder, 'Gemfile'), 'w') { |f| f.write 'gem "Bundler"'} end def delete_project FileUtils.rm_rf @project_folder if File.exists? @project_folder end end
Version data entries
42 entries across 42 versions & 1 rubygems