Skip to content

Instantly share code, notes, and snippets.

@kristoferjoseph
Created July 15, 2010 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kristoferjoseph/477575 to your computer and use it in GitHub Desktop.
Save kristoferjoseph/477575 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
# encoding: utf-8
require ENV['TM_SUPPORT_PATH'] + '/lib/ui'
skins_path = ENV['TM_FLEX_PATH'] + '/frameworks/projects/spark/src/spark/skins/spark'
file = TextMate::UI.request_file(:title => "Select Skin Class", :directory => skins_path)
contents = IO.read("#{file}")
File.open(ENV['TM_NEW_FILE'], 'w+') do |f|
f.write contents
end
@kristoferjoseph
Copy link
Author

This is a Flex 4 Skin Template program that creates a new skin based on an existing Spark skin. This is similar to the functionality that Flash Builder supplies, but it actually shows you where the skin classes live via the browse dialog. There is a bug in this code somewhere in lines 8-10. Basically two files are created in the TextMate project drawer, but in reality only one file has actually been created on disk.

@kristoferjoseph
Copy link
Author

Removing the second GENERATED_FILE on line #11 solved the double creation issue.

@simongregory
Copy link

Ah ha. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment