module Ubb

Constants

VERSION

Public Class Methods

check_config(config) click to toggle source
# File lib/ubb.rb, line 34
def self.check_config(config)
  cand = [ 'development', 'release', 'distribution' ]
  cand.select! { |c| c =~ /^#{config}/i }
  return cand[0] if cand.size == 1
  return nil
end
check_target(target) click to toggle source
# File lib/ubb.rb, line 28
def self.check_target(target)
  cand = [ 'ios', 'android' ]
  cand.select! { |c| c =~ /^#{target}/i }
  return cand[0] if cand.size == 1
  return nil
end
editor_path() click to toggle source
# File lib/ubb.rb, line 12
def self.editor_path
  "#{$project_path}/Assets/Editor"
end
find_project() click to toggle source
# File lib/ubb.rb, line 18
def self.find_project
  return unless $project_path.nil?
  dirs = Dir.glob("**/Assets")
  dirs.each do |d|
    d = d.sub(/(\/)?Assets$/, '')
    if Dir.exist?("#{d}/ProjectSettings")
      $project_path = File.expand_path(d)
    end
  end
end
has_editor?() click to toggle source
# File lib/ubb.rb, line 15
def self.has_editor?
  Dir.exist?(self.editor_path)
end
sh(cmd) click to toggle source
# File lib/ubb.rb, line 5
def self.sh(cmd)
  print "exec: #{cmd}\n"
  system cmd
  if $? != 0
    raise "ERROR: #{$?.to_i}"
  end
end