Permalink
Browse files

Tooling: new lib/fireworks library to clean up Rakefile

  • Loading branch information...
1 parent f88c574 commit 4855e653941b54b99bdb73b41dd5fc9a04880cdc @bomberstudios committed Mar 29, 2012
Showing with 21 additions and 6 deletions.
  1. +7 −2 Rakefile
  2. +10 −0 lib/fireworks.rb
  3. +4 −4 lib/library.rb
View
@@ -5,9 +5,11 @@ require "rake"
require "rdiscount"
require "erb"
require 'fileutils'
-require 'lib/library'
require 'colored'
+require 'lib/library'
+require 'lib/fireworks'
+
ORANGE_COMMANDS_VERSION = "1.7"
DOWNLOAD_SERVER = "http://orangecommands.com/dl/"
@fw_versions = ["CS3","CS4","CS5"]
@@ -56,7 +58,10 @@ end
desc "Build XML for keyboard shortcuts"
task :shortcuts do
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_target_dirs = @fw_versions.map { |v| "en/Keyboard\ Shortcuts/#{v}" }
xml_target_dirs << "en/Keyboard\ Shortcuts/Orange"
View
@@ -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
View
@@ -21,10 +21,10 @@ def initialize filename
end
def modifiers
{
- :CTRL => 8,
- :COMMAND => 4,
- :SHIFT => 2,
- :ALT => 1
+ :CTRL => 8,
+ :COMMAND => 4,
+ :SHIFT => 2,
+ :ALT => 1
}
end
def keycodes

0 comments on commit 4855e65

Please sign in to comment.