Class: MFXcode::Plugins::Generateproj

Inherits:
Object
  • Object
show all
Defined in:
lib/mfxcode/plugins/generateproj.rb

Overview

Adds files to a group in the Xcode project

Instance Method Summary collapse

Instance Method Details

#helpObject



27
28
29
30
31
32
33
34
# File 'lib/mfxcode/plugins/generateproj.rb', line 27

def help
  {:short => 'Generate a new default empty Xcode project',
   :long => "Usage: generateproj project_name\n\nGenerate a new empty Xcode project\n" }
end

#run(args) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/mfxcode/plugins/generateproj.rb', line 36

def run(args)
 
  if args.count == 1

    project_name = args.shift

    if project_name.end_with? ".xcodeproj"
      project_name.chomp! ".xcodeproj"
    end
  
    project_basedir = project_name
    project_path = project_basedir + "/" + project_name + ".xcodeproj"      

    project = Xcodeproj::Project.new


    project.save(project_path) 
  
  else
     puts "Wrong number of arguments"
     puts help[:long]
  end
end