Skip to content

Commit

Permalink
Tooling: new lib/fireworks library to clean up Rakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bomberstudios committed Mar 29, 2012
1 parent f88c574 commit 4855e65
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
9 changes: 7 additions & 2 deletions Rakefile
Expand Up @@ -5,9 +5,11 @@ require "rake"
require "rdiscount" require "rdiscount"
require "erb" require "erb"
require 'fileutils' require 'fileutils'
require 'lib/library'
require 'colored' require 'colored'


require 'lib/library'
require 'lib/fireworks'

ORANGE_COMMANDS_VERSION = "1.7" ORANGE_COMMANDS_VERSION = "1.7"
DOWNLOAD_SERVER = "http://orangecommands.com/dl/" DOWNLOAD_SERVER = "http://orangecommands.com/dl/"
@fw_versions = ["CS3","CS4","CS5"] @fw_versions = ["CS3","CS4","CS5"]
Expand Down Expand Up @@ -56,7 +58,10 @@ end
desc "Build XML for keyboard shortcuts" desc "Build XML for keyboard shortcuts"
task :shortcuts do task :shortcuts do
running_folder = %x(pwd).chomp running_folder = %x(pwd).chomp
xml_source_dirs = @fw_versions.map { |v| "/Applications/Adobe Fireworks #{v}/Adobe Fireworks #{v}.app/Contents/Resources/en.lproj/Keyboard Shortcuts/" }
xml_source_dirs = @fw_versions.map do |v|
f = Fireworks.new(v).shortcuts_folder
end
xml_source_dirs << 'tpl' xml_source_dirs << 'tpl'
xml_target_dirs = @fw_versions.map { |v| "en/Keyboard\ Shortcuts/#{v}" } xml_target_dirs = @fw_versions.map { |v| "en/Keyboard\ Shortcuts/#{v}" }
xml_target_dirs << "en/Keyboard\ Shortcuts/Orange" xml_target_dirs << "en/Keyboard\ Shortcuts/Orange"
Expand Down
10 changes: 10 additions & 0 deletions lib/fireworks.rb
@@ -0,0 +1,10 @@
class Fireworks
attr_accessor :path, :lang, :shortcuts_folder

def initialize version
@path = "/Applications/Adobe Fireworks #{version}"
@lang = File.basename(Dir["#{path}/**.app/Contents/Resources/**.lproj"][0], '.lproj')
@shortcuts_folder = "#{path}/Adobe Fireworks #{version}.app/Contents/Resources/#{lang}.lproj/Keyboard Shortcuts/"
yield if block_given?
end
end
8 changes: 4 additions & 4 deletions lib/library.rb
Expand Up @@ -21,10 +21,10 @@ def initialize filename
end end
def modifiers def modifiers
{ {
:CTRL => 8, :CTRL => 8,
:COMMAND => 4, :COMMAND => 4,
:SHIFT => 2, :SHIFT => 2,
:ALT => 1 :ALT => 1
} }
end end
def keycodes def keycodes
Expand Down

0 comments on commit 4855e65

Please sign in to comment.