flashsdk 1.0.26.pre → 1.0.27.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.26.pre
1
+ 1.0.27.pre
@@ -101,7 +101,7 @@ module FlashSDK
101
101
 
102
102
  ##
103
103
  # Specifies a description for a package name.
104
- add_param :package, Path
104
+ add_param :package, Strings, { :delimiter => ' ' }
105
105
 
106
106
  ##
107
107
  # Path for custom templates.
@@ -119,12 +119,22 @@ module FlashSDK
119
119
  # Never use fcsh for asdoc
120
120
  # (overused inheritance smell)
121
121
  self.use_fcsh = false
122
- start = Time.now
123
- super
124
- duration = (Time.now - start).seconds
122
+ duration = Benchmark.measure { super }
125
123
  Sprout.stdout.puts "[ASDOC] Creation complete in #{duration} seconds."
126
124
  end
127
125
 
126
+ protected
127
+
128
+ ##
129
+ # Override the default behavior that creates a file task,
130
+ # and create a 'task' instead. This will force the docs
131
+ # to get recreated with every run, instead of failing to
132
+ # create when the outer folder still exists.
133
+ def create_outer_task *args
134
+ task *args do
135
+ execute
136
+ end
137
+ end
128
138
  end
129
139
  end
130
140
 
@@ -350,17 +350,17 @@ module FlashSDK
350
350
  ##
351
351
  # Defines the font manager. The default is flash.fonts.JREFontManager. You can also use the flash.fonts.BatikFontManager.
352
352
  #
353
- add_param :fonts_managers, Strings
353
+ add_param :fonts_managers, Strings, { :shell_name => "-compiler.fonts.managers" }
354
354
 
355
355
  ##
356
356
  # Sets the maximum number of fonts to keep in the server cache.
357
357
  #
358
- add_param :fonts_max_cached_fonts, Number
358
+ add_param :fonts_max_cached_fonts, Number, { :shell_name => "-compiler.fonts.max.cached.fonts" }
359
359
 
360
360
  ##
361
361
  # Sets the maximum number of character glyph-outlines to keep in the server cache for each font face.
362
362
  #
363
- add_param :fonts_max_glyphs_per_face, Number
363
+ add_param :fonts_max_glyphs_per_face, Number, { :shell_name => "-compiler.fonts.max.glyphs.per.face" }
364
364
 
365
365
  ##
366
366
  # Specifies a SWF file frame label with a sequence of one or more class names that will be linked onto the frame.
@@ -88,37 +88,38 @@ module FlashSDK
88
88
  end
89
89
 
90
90
  def execute command, port=nil
91
- start = Time.now
92
- port = port || @port
93
- begin
94
- #Sprout.stdout.puts "[FCSH] #{command}"
95
- session = TCPSocket.new 'localhost', port
96
- session.puts command
97
- response = session.read
98
- if response.match /Error/
99
- raise Sprout::Errors::UsageError.new "[FCSH] #{response}"
100
- else
101
- Sprout.stdout.puts "[FCSH] #{response}"
102
- end
103
- response
104
- rescue Errno::ECONNREFUSED => e
105
- message = "[ERROR] "
106
- message << e.message
107
- message << ": Could not connect to an FCSH server on port: #{port} at: #{Dir.pwd}.\n\n"
108
- message << "This is probably because one has not been started. To start a new FCSH server, open a new "
109
- message << "terminal and run the following:\n\n"
110
- message << "cd #{Dir.pwd}\n"
111
- message << "rake fcsh:start\n"
112
- raise Sprout::Errors::UsageError.new message
113
- ensure
114
- if !session.nil? && !session.closed?
115
- session.flush
116
- session.close
91
+ duration = Benchmark.measure do
92
+ port = port || @port
93
+ begin
94
+ #Sprout.stdout.puts "[FCSH] #{command}"
95
+ session = TCPSocket.new 'localhost', port
96
+ session.puts command
97
+ response = session.read
98
+ if response.match /Error/
99
+ raise Sprout::Errors::UsageError.new "[FCSH] #{response}"
100
+ else
101
+ Sprout.stdout.puts "[FCSH] #{response}"
102
+ end
103
+ response
104
+ rescue Errno::ECONNREFUSED => e
105
+ message = "[ERROR] "
106
+ message << e.message
107
+ message << ": Could not connect to an FCSH server on port: #{port} at: #{Dir.pwd}.\n\n"
108
+ message << "This is probably because one has not been started. To start a new FCSH server, open a new "
109
+ message << "terminal and run the following:\n\n"
110
+ message << "cd #{Dir.pwd}\n"
111
+ message << "rake fcsh:start\n"
112
+ raise Sprout::Errors::UsageError.new message
113
+ ensure
114
+ if !session.nil? && !session.closed?
115
+ session.flush
116
+ session.close
117
+ end
117
118
  end
118
119
  end
119
120
 
120
121
  if command.match /^mxmlc|^compc/
121
- Sprout.stdout.puts "[FCSH] complete in #{(Time.now - start).seconds} seconds."
122
+ Sprout.stdout.puts "[FCSH] complete in #{duration} seconds."
122
123
  end
123
124
  end
124
125
 
@@ -119,10 +119,8 @@ module FlashSDK
119
119
  set :executable, :mxmlc
120
120
 
121
121
  def execute
122
- start = Time.now
123
- super
124
- duration = (Time.now - start).seconds
125
- Sprout.stdout.puts "[MXMLC] Compilation complete in #{duration} seconds." unless use_fcsh?
122
+ duration = Benchmark.measure { super }
123
+ Sprout.stdout.puts "[MXMLC] Compilation complete in #{duration.real} seconds." unless use_fcsh?
126
124
  end
127
125
 
128
126
  def use_fcsh?
data/lib/flashsdk.rb CHANGED
@@ -3,6 +3,7 @@ require 'sprout'
3
3
  lib = File.expand_path File.dirname(__FILE__)
4
4
  $:.unshift lib unless $:.include?(lib)
5
5
 
6
+ require 'benchmark'
6
7
  require 'flashsdk/module'
7
8
  require 'flashsdk/generators/flash_helper'
8
9
  require 'flashsdk/generators/class_generator'
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 26
8
+ - 27
9
9
  - pre
10
- version: 1.0.26.pre
10
+ version: 1.0.27.pre
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Bayes
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-26 00:00:00 -07:00
18
+ date: 2011-04-29 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency