class SmartlingXcode::Project

Attributes

projectPath[RW]
sandbox[RW]
version[RW]

Public Instance Methods

extract() click to toggle source
# File lib/smartling_xcode.rb, line 14
def extract
    project = Xcodeproj::Project.find(@projectPath)
    files = project.extract
    puts "\nOutput:"
    puts files
end
getversion() click to toggle source
# File lib/smartling_xcode.rb, line 33
def getversion
    project = Xcodeproj::Project.find(@projectPath)
    @version = project.getVersion
    puts "Version #{@version} will be used."
end
init() click to toggle source
# File lib/smartling_xcode.rb, line 9
def init
    api = API.new({:sandbox => @sandbox})
    api.requestCredentials
end
push() click to toggle source
# File lib/smartling_xcode.rb, line 21
def push
    api = API.new({:sandbox => @sandbox})
    api.loadCredentials()
    project = Xcodeproj::Project.find(@projectPath)
    files = project.extract
    if @version.nil?
        @version = project.getVersion
    end
    api.pushStringsFromFiles(files, @version)
    puts "\nYour files are now available in the Files section of your Smartling project."
end