Sha256: 935589b17f132122eecf713cb6eb46b62f712e8abba7f0a5b255d327910b4fa9

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env ruby
require 'fileutils'

$:.push File.expand_path("../../lib", __FILE__)

require 'ambient'

def print_help
  print_version
  puts ""
  puts "usage: "
  puts "$ ambient COMMAND"
  puts ""
  puts "Commands:"
  puts "+ [no arguments]\tApplies the settings from the Ambientfile"
  puts "+ init\t\t\tCreates an Ambientfile in the current directory"
  puts "+ new NAME\t\tCreates a new iOS Xcode project with given name"
  puts "+ [anything else]\tApplies the settings from the file name supplied"
end

def print_version
  path = File.expand_path("../../", __FILE__)
  gem_contents = File.read("#{path}/ambient-xcode.gemspec")
  match = gem_contents.match /^\s*gem.version\s*= ('|")(.*)('|")/
  puts "ambient-xcode #{match[2]}"
end

if ARGV[0] == "init"
  Ambient::Init.new.create_ambientfile
elsif ARGV[0] == "new"
  Ambient::ProjectCreation.new(Dir.pwd, ARGV[1]).create_ios_project
elsif ARGV[0] == "help" || ARGV[0] == "--help"
  print_help
elsif ARGV[0] == "version" || ARGV[0] == "--version" || ARGV[0] == "-v"
  print_version
else
  Ambient::Application.new.run_ambientfile(ARGV[0])
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ambient-xcode-0.8.1 bin/ambient
ambient-xcode-0.8.0 bin/ambient
ambient-xcode-0.7.1 bin/ambient
ambient-xcode-0.7.0 bin/ambient