tidyflash 0.9.2 → 0.9.3

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/lib/tidy/compile.rb CHANGED
@@ -64,34 +64,29 @@ module Tidy
64
64
  :output=>"demos/#{args[:output]}/DemoConfig.as")
65
65
  air(args.merge(:paths=>["demos/#{args[:output]}"]))
66
66
  end
67
+
68
+ def self.get_compile_command(args, initial_command)
69
+ command = initial_command + " " + parse_options(args)
70
+ command_result = command
71
+ return command
72
+ end
67
73
 
68
74
  def self.build(args,command)
69
75
  puts "Compiling with TidyFlash #{Tidy::Version.number}"
70
76
  #puts "cd #{FileUtils.pwd} && #{command}"
77
+ =begin
71
78
  command_result = command
72
79
  filtered_result = command_result.to_a.map{|l| l unless l.match(/^Reason|^Recompile/)}.compact
73
80
  puts filtered_result
74
-
75
- unless File.exists?(swf_url args)
76
- puts "Building for first time"
77
- IO.popen(command){ |process| process.each { |line| puts line } }
78
- return
79
- end
80
- begin
81
- result = Sprout::FCSHSocket.execute command
82
- rescue
83
- #if (result =~ /Connection refused/)
84
- puts "*******************"
85
- puts "* Starting FCSH *"
86
- puts "*******************"
87
- Dir.chdir("script/fcsh") do
88
- IO.popen("rake fcsh:start"){ |process| process.each { |line| puts line } }
89
- end
90
- end
81
+ =end
82
+ IO.popen(command){ |process| process.each { |line| puts line } }
91
83
  end
92
84
  DEFAULT_PATHS = %w[src assets ~/.tidy/tidy-as3]
93
85
  def self.parse_options(args)
94
- options = args[:options] ? DEFAULTS.merge(args[:options]) : DEFAULTS
86
+ options = DEFAULTS.dup()
87
+ options.each_pair do |k,v|
88
+ options[k] = args[k] unless args[k].nil?
89
+ end
95
90
  paths = DEFAULT_PATHS
96
91
  paths = args[:paths].concat(DEFAULT_PATHS) unless args[:paths].nil?
97
92
  paths = paths.map{|path| "-source-path+=#{File.expand_path path}" }.join(" ")
data/lib/tidy/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Tidy
2
2
  class Version
3
3
  def self.number
4
- '0.9.2'
4
+ '0.9.3'
5
5
  end
6
6
  end
7
7
  end
@@ -17,6 +17,23 @@ class TestTidyProject < Test::Unit::TestCase
17
17
  end
18
18
  end
19
19
 
20
+ def test_parse_options
21
+ #ENV['SPROUT_FLEX4SDK_TOOL'] = "/Users/christian/Library/Sprouts/cache/0.7/sprout-flex3sdk-tool-3.5.1"
22
+
23
+ args = {:main=>'src/app/views/MainView.as',
24
+ :output=>"multi_touch_window_02",
25
+ :version=> "0.1",
26
+ :width=>640,
27
+ :height=>480,
28
+ :default_background_color=>"#FFFFFF",
29
+ :paths=>["../multi-touch-lib/src", "../as3-lib/src"]}
30
+ command = Tidy::Compile.parse_options(args);
31
+ assert_nil(command =~ /width/, "custom parameters shouldn't be passed to the compiler")
32
+ assert_not_nil(command =~/#FFFFFF/,"default parameters should be overriden");
33
+ assert_not_nil(command =~/\/multi-touch-lib\/src/,"extra path should be added");
34
+ assert_not_nil(command =~/\/as3-lib\/src/,"extra path should be added");
35
+ end
36
+
20
37
  def test_air_main_template
21
38
  in_project_folder do
22
39
  template_path = 'config/templates/air.axml.erb';
@@ -79,7 +96,6 @@ class TestTidyProject < Test::Unit::TestCase
79
96
  i=i+1
80
97
  end
81
98
  end
82
-
83
99
  #def test_add_libs
84
100
  # in_project_folder do
85
101
  # assert File.exists?('script'), "No script folder"
data/tidyflash.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{tidyflash}
5
- s.version = "0.9.2"
5
+ s.version = "0.9.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Michael Forrest"]
9
- s.date = %q{2010-07-29}
9
+ s.date = %q{2010-09-21}
10
10
  s.description = %q{Tidy Flash - an ActionScript framework for people who love Ruby}
11
11
  s.email = %q{mf@grimaceworks.com}
12
12
  s.executables = ["test_project.axml", "tidyflash"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tidyflash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 2
10
- version: 0.9.2
9
+ - 3
10
+ version: 0.9.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Forrest
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-29 00:00:00 +01:00
18
+ date: 2010-09-21 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency