Giter Site home page Giter Site logo

ti's Introduction

A rapid development framework for titanium.

Requirements

  • ruby 1.9.2

  • Titanium Developer Mobile SDK

  • CoffeeScript

  • libffi ‘brew install libffi`

Sample App

Set an alias for titanium’s command line interface to your /.bash_profile

OS X

alias titanium="$HOME/Library/Application\ Support/Titanium/mobilesdk/osx/<VERSION>/titanium.py"

Linux

alias titanium=$HOME/.titanium/mobilesdk/linux/<VERSION>/titanium.py

Install the gem

gem install ti

Create a new Project

ti new HelloTi com.yourdomain.helloti iphone

Create your views

ti s window Sample main
ti s window Settings main

Update your ‘app/app.coffee` to define the newly created Views

HelloTi =
  Views:
    Sample: {}
    Settings: {}

Update your ‘app/hello_ti/stylesheets/app.sass` to include the generated sass

@import 'sample'
@import 'settings'

Run it using ‘rake`

rake

Or run it using ‘ti`

ti compile all && ti build iphone

You can now start adding components. Enjoy!

Contributing to Ti

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Contributions

  • Julius Francisco (tons of code, ideas, patterns, tests, time, and all around good guy)

  • Wynn Netherland (sass, initial patterns & and help with preliminary architectural design)

  • Rupak Ganguly (initial cli, removal of jeweler, tests)

Copyright © 2011 Code Wranglers Inc, Robert R Evans. See LICENSE.txt for further details.

ti's People

Contributors

baldrailers avatar bitmole avatar cbrunnkvist avatar gdagley avatar jwarzech avatar pengwynn avatar revans avatar rupakg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ti's Issues

Compile CoffeeScript (by sorted order)

Should work similar to how SASS and Sprockets work where you have a file and you specify the order in which files are compiled. The following scenarios should work:

app/::app_name::/models/*
app/::app_name::/controllers/login.coffee
app/::app_name::/controllers/dashboard.coffee

Whitespace Issue

When generating new views just like in #16 this will insert a line of code containing the context[:domain] parameter. Initially it's using \t for the alignment of the newly inserted line, this causes an issue during coffeescript compilation.

Rakefile dups

In the Rakefile we have:

PROJECT_NAME = "DailyFocus"
PROJECT_ROOT = File.dirname(FILE)

IPHONE_SDK_VERSION = "4.3"
TI_SDK_VERSION = "1.6.2"
TI_DIR = '/Library/Application\ Support/Titanium'
TI_ASSET_DIR = "#{TI_DIR}/mobilesdk/osx/#{TI_SDK_VERSION}"
TI_IPHONE_DIR = "#{TI_ASSET_DIR}/iphone"
TI_BUILD = "#{TI_IPHONE_DIR}/builder.py"
APP_DEVICE = "iphone"

Which needs to be removed as it is in config/config.rb.

missing dependency on 1.9.2@osx-snowleopard

legolas:~ cowboyd$ rvm use 1.9.2
Using /Users/cowboyd/.rvm/gems/ruby-1.9.2-p180
legolas:~ cowboyd$ gem install ti
Fetching: guard-0.3.4.gem (100%)
Fetching: haml-3.0.25.gem (100%)
Fetching: guard-sass-0.0.6.gem (100%)
Fetching: guard-coffeescript-0.2.4.gem (100%)
Fetching: em-websocket-0.2.1.gem (100%)
Fetching: guard-livereload-0.1.11.gem (100%)
Fetching: rubyzip-0.9.4.gem (100%)
Fetching: childprocess-0.2.1.gem (100%)
Fetching: selenium-webdriver-2.4.0.gem (100%)
Fetching: jasmine-1.0.2.1.gem (100%)
Fetching: colored-1.2.gem (100%)
Fetching: ti-0.1.9.gem (100%)
Successfully installed guard-0.3.4
Successfully installed haml-3.0.25
Successfully installed guard-sass-0.0.6
Successfully installed guard-coffeescript-0.2.4
Successfully installed em-websocket-0.2.1
Successfully installed guard-livereload-0.1.11
Successfully installed rubyzip-0.9.4
Successfully installed childprocess-0.2.1
Successfully installed selenium-webdriver-2.4.0
Successfully installed jasmine-1.0.2.1
Successfully installed colored-1.2
Successfully installed ti-0.1.9
12 gems installed
Installing ri documentation for guard-0.3.4...
Building YARD (yri) index for guard-0.3.4...
Installing ri documentation for haml-3.0.25...
Building YARD (yri) index for haml-3.0.25...
Installing ri documentation for guard-sass-0.0.6...
Building YARD (yri) index for guard-sass-0.0.6...
Installing ri documentation for guard-coffeescript-0.2.4...
Building YARD (yri) index for guard-coffeescript-0.2.4...
Installing ri documentation for em-websocket-0.2.1...
Building YARD (yri) index for em-websocket-0.2.1...
Building YARD (yri) index for guard-livereload-0.1.11...
Building YARD (yri) index for childprocess-0.2.1...
Installing ri documentation for selenium-webdriver-2.4.0...
Building YARD (yri) index for selenium-webdriver-2.4.0...
Installing ri documentation for jasmine-1.0.2.1...
Building YARD (yri) index for jasmine-1.0.2.1...
Installing ri documentation for colored-1.2...
Building YARD (yri) index for colored-1.2...
Building YARD (yri) index for ti-0.1.9...
Installing RDoc documentation for guard-0.3.4...
Installing RDoc documentation for haml-3.0.25...
Installing RDoc documentation for guard-sass-0.0.6...
Installing RDoc documentation for guard-coffeescript-0.2.4...
Installing RDoc documentation for em-websocket-0.2.1...
Installing RDoc documentation for selenium-webdriver-2.4.0...
Installing RDoc documentation for jasmine-1.0.2.1...
Installing RDoc documentation for colored-1.2...
legolas:~ cowboyd$ ti -h
/Users/cowboyd/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require': no such file to load -- rocco (LoadError)
    from /Users/cowboyd/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
    from /Users/cowboyd/.rvm/gems/ruby-1.9.2-p180/gems/ti-0.1.9/lib/ti.rb:8:in `<top (required)>'
    from /Users/cowboyd/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
    from /Users/cowboyd/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
    from /Users/cowboyd/.rvm/gems/ruby-1.9.2-p180/gems/ti-0.1.9/bin/ti:3:in `<top (required)>'
    from /Users/cowboyd/.rvm/gems/ruby-1.9.2-p180/bin/ti:19:in `load'
    from /Users/cowboyd/.rvm/gems/ruby-1.9.2-p180/bin/ti:19:in `<main>'

Generating an ipad app

When generating an ipad app, the APP_DEVICE in config/config.rb should be set as 'ipad'.

Config Parser

Need to be able to load config/config.rb this will be used for the builders and compilers

Generator/CLI Cleanup

There are some actions in the CLI that we need to cleanup to optimize the generators.

JSS ios build

I know this is slightly off track; but I reakon if anyone would know you guys would;

is there a way to use JSS without wiping the build to reflect changes for IOS

as this makes for a slow development process

Cheers

Testing Framework

Instead of Jasmine for testing in Ti apps, would it be worth looking at using JSUnity instead? Others in the past have used JSUnity successfully with Titanium apps (http://developer.appcelerator.com/question/741/unit-testing-support)

I am working on integrating it right now into an application I am building with the Ti gem and I could add it to the gem's generators on a pull request if you'd be interested in using JSUnity in the gem.

moar documentation nitpicks

It should be noted in the documentation that when you run rake, if it immediately fails to compile the coffee-script, you may need to install coffee-script. I was shocked that I needed to do this as I have rails 3.2.x installed and nodejs through npm.

Anyway you may need to run npm install -g coffee-script.

this might also be useful as merely an error message add on.

SASS Compiler

SASS Compiler should be implemented just like CoffeeCompiler. I think the idea is to have sprocket in place right?

Nokogiri in config.rb

The nokogiri stuff needs to be pulled out of the generated application and that should be core to Ti itself.

push out 0.2.1

How about pushing out a 0.2.1 version containing the latest fixes so that building from source isn't necessary?

Cannot run rake or ti compile/build

When trying to rake the sample project this is what I receive:

Mike-Rs-MacBook-Pro:HelloTi mikemac$ rake
Compiling CoffeeScript
Successfully compiled CoffeeScript
Compiling stylesheets
Building with Titanium... (DEVICE_TYPE: iphone)
bash -c "~/Library/Application\ Support/Titanium/mobilesdk/osx/1.8.2/iphone/builder.py run /Users/mikemac/Documents/Titanium Studio Workspace/HelloTi/ 5.0 com.yourdomain.helloti HelloTi iphone " | perl -pe 's/^[DEBUG].$/\e[35m$&\e[0m/g;s/^[INFO].$/\e[36m$&amp;\e[0m/g;s/^[WARN].$/\e[33m$&\e[0m/g;s/^[ERROR].$/\e[31m$&amp;\e[0m/g;'
[INFO] One moment, building ...
Traceback (most recent call last):
File "/Users/mikemac/Library/Application Support/Titanium/mobilesdk/osx/1.8.2/iphone/builder.py", line 1545, in
main(sys.argv)
File "/Users/mikemac/Library/Application Support/Titanium/mobilesdk/osx/1.8.2/iphone/builder.py", line 632, in main
ti = TiAppXML(tiapp_xml)
File "/Users/mikemac/Library/Application Support/Titanium/mobilesdk/osx/1.8.2/iphone/../tiapp.py", line 52, in init
data = codecs.open(self.file,'r','utf-8','replace')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 881, in open
file = builtin.open(filename, mode, buffering)
IOError: [Errno 2] No such file or directory: u'/Users/mikemac/Documents/Titanium/tiapp.xml'

Ti destroy command

Since we have all these generate new file commands, we need to start adding destroy commands.

New project generator needs android argument to point to SDK path

Usage: titanium.py create [--platform=p] [--type=t] [--dir=d] [--name=n] [--id=i] [--ver=v]

  --platform=p1,p2      platform: iphone, ipad, android, blackberry, etc.
  --type=t              type of project: project, module, plugin
  --dir=d               directory to create the new project
  --name=n              project name
  --id=i                project id (ie com.companyName.project
  --ver=i               platform version
  --android=sdk_folder  For android module - the Android SDK folder

duplicate filter for app.coffee declarations

When generating new views as follow:

ti s window Settings main

Initially this will insert a line in the app/app.coffee
Views:
Settings: {}

When you generate another child view under settings it will duplicate the line of Settings: {}

Extra brackets after view generation

When you follow the README to create a new project, after editing the the app/app.coffee file there is an extra set of brackets, presumably the ones that were saying that views was an empty object.

Views:
    Sample: {}
    Settings: {} {}

Ti Build

The building of the iphone app should all be part of Ti core.

zsh support ?

Hi im trying to install Ti , its a very cool project!

i use zsh an i put this line in .zshprofile

alias titanium=$HOME/Library/Application\ Support/Titanium/mobilesdk/osx/1.8.1/titanium.py

in console when i try to load a project it dont work as spected

zsh: permission denied: /Users/me/Library/Application

when i try to use the Ti command it fails with the tmp file not found files,

but i harcoded the path in the generate_titanium_project method project generator rb
.....
titanium_path = '$HOME/Library/Application\ Support/Titanium/mobilesdk/osx/1.8.1/titanium.py'
cmd = "#{titanium_path} create --name=#{@project_name} --platform=#{@device_platform} --id=#{@app_id}"
# We need to use the session gem so that we can access the user's aliases
#bash = Session::Bash::new 'program' => 'bash --login -i'
#bash.execute(cmd) { |out, err| puts out }
exec cmd

and it works.

any hints about that ? maybe its because i have activated zsh and the Ti comand executes a bash session comand ?

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.