Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Users can create new templates or modify existing templates in order to allow easy creation of default content.

...

  1. Open the existing bundle.rb file
  2. Add the following content to the bottom of the file:

    Code Block
    ruby
    ruby
    template "Sample File Template" do |t|
      t.filetype = "*.txt"
      t.location = "templates/sample.txt"
    end
    
  3. Replace the "sample" and "txt" values with values appropriate to your filetype.
  4. Create a templates folder underneath the rublename.ruble folder.
  5. Drop-in file sample.txt (or the specific file you have created).
  6. Save and close bundle.rb.

If you now go to File > New > File... and create a file name of the appropriate extension above, you should see your template in the list.

...

You can create project templates that reference a local .zip file , or retrieve content from the web.

...

Project templates can be added to existing project wizards by the specification of the "type" element:

Type

Project

all

all All project types

ruby

Ruby projects

php

PHP projects

web

Web projects

python

Python projects

titanium_desktop

Titanium Desktop projects

titanium_mobile

Titanium Mobile projects

...

If your content is hosted locally, you can simply reference a .zip file containing the files in question.

...

File > New > Project... and create a project of the appropriate type above, ; you should see your template in the list.

...

File > New > Project... and create a project of the appropriate type above, ; you should see your template in the list.

...

TM_NEW_FILE_BASENAME

The file name, without the file - extension.

TM_NEW_FILE

The absolute path to the current file.

TM_NEW_FILE_DIRECTORY

The directory path for the current file.

TM_PROJECTNAME

The name of the created project.

TIME

The current time (in words).

YEAR

The current year.

Variables should be inserted inside a ${} blocks into your code. For example:

...