textmate_fcsh 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Jaap van der Meer
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,48 @@
1
+ = TextmateFcsh
2
+
3
+ Compiles flex in textmate with FCSH. Provides clickable error reports, so errors can be
4
+ fast and easily fixed.
5
+
6
+
7
+ === Installation
8
+
9
+ # install textmate_fcsh
10
+ gem install textmate_fcsh
11
+
12
+ # install textmate bundle
13
+ textmate_fcsh -i
14
+
15
+
16
+ === Setup of new project
17
+
18
+ # go into your project dir
19
+ cd as3_project_dir
20
+
21
+ # Creates compiler instruction file: .textmate_fcsh
22
+ textmate_fcsh -c
23
+
24
+ === Run
25
+
26
+ In project dir type:
27
+
28
+ # This will launch continuous compiler, that watches tmp/restart.txt in your project dir.
29
+ textmate_fcsh
30
+
31
+ This will launch a new browser window with an error report. Now you can open the project in
32
+ Textmate and type SHIFT-CMD-R, this will recompile your project and refresh the error report also.
33
+
34
+
35
+
36
+ == Note on Patches/Pull Requests
37
+
38
+ * Fork the project.
39
+ * Make your feature addition or bug fix.
40
+ * Add tests for it. This is important so I don't break it in a
41
+ future version unintentionally.
42
+ * Commit, do not mess with rakefile, version, or history.
43
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
44
+ * Send me a pull request. Bonus points for topic branches.
45
+
46
+ == Copyright
47
+
48
+ Copyright (c) 2010 Jaap van der Meer. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,47 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "textmate_fcsh"
8
+ gem.summary = "Compile Flex in Textmate using FCSH. Advanced error reporting."
9
+ gem.description = "Compile Flex in Textmate using FCSH. Advanced error reporting."
10
+ gem.email = "jaapvandermeer@gmail.com"
11
+ gem.homepage = "http://github.com/japetheape/textmate_fcsh"
12
+ gem.authors = ["Jaap van der Meer"]
13
+ gem.add_development_dependency "rspec", ">= 1.2.9"
14
+ gem.bindir = 'bin'
15
+ gem.executables = ["textmate_fcsh"]
16
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
+ end
18
+ Jeweler::GemcutterTasks.new
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
+ end
22
+
23
+ require 'spec/rake/spectask'
24
+ Spec::Rake::SpecTask.new(:spec) do |spec|
25
+ spec.libs << 'lib' << 'spec'
26
+ spec.spec_files = FileList['spec/**/*_spec.rb']
27
+ end
28
+
29
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
30
+ spec.libs << 'lib' << 'spec'
31
+ spec.pattern = 'spec/**/*_spec.rb'
32
+ spec.rcov = true
33
+ end
34
+
35
+ task :spec => :check_dependencies
36
+
37
+ task :default => :spec
38
+
39
+ require 'rake/rdoctask'
40
+ Rake::RDocTask.new do |rdoc|
41
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
42
+
43
+ rdoc.rdoc_dir = 'rdoc'
44
+ rdoc.title = "textmate_fcsh #{version}"
45
+ rdoc.rdoc_files.include('README*')
46
+ rdoc.rdoc_files.include('lib/**/*.rb')
47
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.0
data/bin/textmate_fcsh ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+
3
+
4
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'textmate_fcsh')
5
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'fcsh', 'fcsh')
6
+ require "open3"
7
+
8
+ #a = TextmateFcsh.new
9
+
10
+
11
+ require 'optparse'
12
+
13
+ options = {}
14
+ OptionParser.new do |opts|
15
+ opts.banner = "Usage: textmate_fcsh [options]"
16
+ opts.on("-v", "--verbose", "Run verbosely") do |v|
17
+ options[:verbose] = v
18
+ end
19
+ opts.on("-s", "--setup", "Setup project") do |v|
20
+ TextmateFcsh.create_config!
21
+ options[:run] = false
22
+ end
23
+
24
+ opts.on("-i", "--install", "Install textmate fcsh") do |v|
25
+ TextmateFcsh.create_textmate_bundle!
26
+ options[:run] = false
27
+ end
28
+
29
+ end.parse!
30
+
31
+
32
+ if options[:run] != false
33
+ TextmateFcsh.new
34
+ end
35
+
36
+
data/lib/fcsh/fcsh.rb ADDED
@@ -0,0 +1,63 @@
1
+ class Fcsh
2
+ attr_reader :stdout, :stderr, :error_output_last_run
3
+
4
+ def initialize(location)
5
+ @targets = []
6
+ @stdin, @stdout, @stderr = Open3.popen3(location)
7
+ @error_output_last_run = ''
8
+ end
9
+
10
+
11
+ def compile(command)
12
+ compile_first_time!(command) if !@targets.include?(command)
13
+ puts "Compiling..."
14
+ @error_output_last_run = ''
15
+ @stdin.puts "compile %d" % [@targets.index(command) + 1]
16
+
17
+ # watch std out till files changed
18
+ @stdout.each_line do |line|
19
+ #puts line.inspect
20
+ if /Files changed/.match(line)
21
+ capture_error_output
22
+ break
23
+ end
24
+ end
25
+ #puts @error_output_last_run
26
+ puts "Compiled."
27
+ end
28
+
29
+ # Create a target if this is the first time.
30
+ def compile_first_time!(command)
31
+ puts "Assigning target..."
32
+ @stdin.puts command
33
+ @targets << command
34
+ sleep 3
35
+ end
36
+
37
+ # Currently there is no way of knowing when error output has finished,
38
+ # so now we capture errors from start of receiving first line is 1 second
39
+ # ago or we started capturing error output is 4 seconds ago. Hope this
40
+ # will be enough.
41
+ def capture_error_output
42
+ puts "Capturing error output"
43
+ first_line_captured = nil
44
+ started = Time.now
45
+ a = Thread.new do
46
+ @stderr.each_line do |line|
47
+ first_line_captured = Time.now if first_line_captured.nil?
48
+ @error_output_last_run << line
49
+ end
50
+ end
51
+
52
+ loop do
53
+ if (!first_line_captured.nil? && Time.now - first_line_captured > 1) || Time.now - started > 4
54
+ break
55
+ end
56
+ end
57
+
58
+ end
59
+
60
+
61
+
62
+
63
+ end
@@ -0,0 +1,27 @@
1
+ class FileWatcher
2
+ def initialize(file)
3
+ @file = file
4
+ create!
5
+ end
6
+
7
+ # Creates file if not exists
8
+ def create!
9
+ if(!File.exist?(@file))
10
+ FileUtils.mkdir_p(@file)
11
+ FileUtils.touch(@file)
12
+ end
13
+ end
14
+
15
+ def each_change(&block)
16
+ last_stat = nil
17
+ loop do
18
+ out = `stat #{@file}`
19
+ if out != last_stat
20
+ last_stat = out
21
+ yield block
22
+ end
23
+ sleep 0.5
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,21 @@
1
+ require 'erb'
2
+
3
+
4
+ class HtmlMxmlcErrorFormatter
5
+
6
+ attr_reader :out, :errors
7
+
8
+ def initialize(errors, template = nil)
9
+ @errors = errors
10
+ @template_file = template || File.join(File.dirname(__FILE__), '..', '..', 'templates', 'standard.html.erb')
11
+ @out = format!
12
+ end
13
+
14
+ def format!
15
+ template = ''
16
+ File.open(@template_file).each_line { |l| template << l }
17
+ formatted = ERB.new(template, 0, '%<>')
18
+ formatted.result(binding)
19
+ end
20
+
21
+ end
@@ -0,0 +1,21 @@
1
+ class MxmlcError
2
+ attr_reader :filename, :line, :column, :level, :message, :content
3
+
4
+ LEVEL_WARN = :warn
5
+ LEVEL_ERROR = :error
6
+
7
+
8
+
9
+ def initialize(filename, line, col, level, message)
10
+ @filename = filename
11
+ @line = line
12
+ @column = column
13
+ @level = level
14
+ @message = message
15
+ @content = ''
16
+ end
17
+
18
+
19
+
20
+
21
+ end
@@ -0,0 +1,27 @@
1
+ require File.join(File.dirname(__FILE__), 'mxmlc_error')
2
+
3
+
4
+ # Formats the mxmlc to errors
5
+ class MxmlcOutputReader
6
+ attr_reader :errors
7
+
8
+ def initialize(output)
9
+ @output = output
10
+ @errors = []
11
+ parse!
12
+ end
13
+
14
+
15
+ # example: /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/view/Controls.as(43): col: 32 Warning: return value for function 'setPositions' has no type declaration.
16
+ def parse!
17
+ @output.each_line do |l|
18
+ matches = /^((\/([\w\.]+))+)\((\d+)\): col: (\d+) (\w+): (.+)$/.match(l)
19
+ if !matches.nil?
20
+ @errors << MxmlcError.new(matches[1], matches[4], matches[5], matches[6], matches[7])
21
+ elsif !@errors.empty?
22
+ @errors.last.content << l
23
+ end
24
+ end
25
+ end
26
+
27
+ end
@@ -0,0 +1,115 @@
1
+ require 'tempfile'
2
+ require File.join(File.dirname(__FILE__), 'mxmlc_output', 'mxmlc_output_reader')
3
+ require File.join(File.dirname(__FILE__), 'formatters', 'html_mxmlc_error_formatter')
4
+ require File.join(File.dirname(__FILE__), 'file_watcher')
5
+ require 'yaml'
6
+
7
+ class TextmateFcsh
8
+ CONFIG_FILE = '.textmate_fcsh'
9
+ TEXTMATE_BUNDLE_LOCATION = "git@github.com:japetheape/textmate_fcsh_bundle.git"
10
+
11
+ def initialize
12
+ check_preconditions
13
+ read_config!
14
+ write_to_tempfile("Waiting for run...")
15
+ fcsh_bin = 'fcsh'
16
+ @fcsh = Fcsh.new(fcsh_bin)
17
+ @file_watcher = FileWatcher.new('tmp/restart.txt')
18
+ @file_watcher.each_change do |f|
19
+ run
20
+ end
21
+ end
22
+
23
+
24
+ # Write report to file
25
+ def write_to_tempfile(txt)
26
+ @report_file = File.new('/tmp/mxmlc_error_report.html', 'w+')
27
+ @report_file.write(txt)
28
+ @report_file.close
29
+ end
30
+
31
+ # Open the report in the browser
32
+ def open_browser
33
+ `open #{@report_file.path}`
34
+ end
35
+
36
+ # Compile the mxmlc, extract errors, create a report.
37
+ def run
38
+ output = run_mxmlc
39
+ @mxml_output_reader = MxmlcOutputReader.new(output)
40
+ @report = HtmlMxmlcErrorFormatter.new(@mxml_output_reader.errors)
41
+ write_report!
42
+ open_browser
43
+ end
44
+
45
+
46
+ # Runs the mxmlc in the fcsh compiler
47
+ def run_mxmlc
48
+ mxmlc_command = "mxmlc"
49
+ #" -default-background-color=#FFFFFF -default-frame-rate=24 -default-size 970 550 -output=bin/editor-debug.swf -source-path+=src -source-path+=assets -source-path+=lib/mvc -source-path+=lib/editor_core -verbose-stacktraces=true -warnings=true src/editor.mxml"
50
+ @config[:mxmlc_options].each do |k,v|
51
+ #next if v
52
+ splitted = v.to_s.split(",")
53
+ splitted.each do |vsplitted|
54
+ splitter = splitted.length > 1 ? '+=' : '='
55
+ if k == :default_size
56
+ splitter = ' '
57
+ end
58
+ mxmlc_command << " -%s%s%s" % [k.to_s.gsub(/\_/, '-'),splitter,vsplitted]
59
+ end
60
+ end
61
+ mxmlc_command << " %s" % @config[:main_file]
62
+ puts mxmlc_command.inspect
63
+ @fcsh.compile(mxmlc_command)
64
+ @fcsh.error_output_last_run
65
+ end
66
+
67
+ # Run a bogus mxmlc command, not used anymore.
68
+ def run_bogus_mxmlc
69
+ out = ''
70
+ mxmlc_output_file = File.join(File.dirname(__FILE__), '..', 'spec', 'fixtures', 'mxmlc_output.txt')
71
+ File.open(mxmlc_output_file).each_line {|l| out << l}
72
+ out
73
+ end
74
+
75
+
76
+ def write_report!
77
+ write_to_tempfile(@report.out)
78
+ end
79
+
80
+
81
+ def check_preconditions
82
+ raise "Configuration file does not exist, first run textmate_fcsh --setup" if !File.exist?(CONFIG_FILE)
83
+ end
84
+
85
+
86
+ # Read configurion file, stored in .textmate_fcsh
87
+ def read_config!
88
+ @config = YAML.load_file(CONFIG_FILE)
89
+ end
90
+
91
+
92
+ # Create the config file
93
+ def self.create_config!
94
+ if File.exist?(CONFIG_FILE)
95
+ raise "Before recreating, first remove %s" % CONFIG_FILE
96
+ end
97
+ example_config = {:mxmlc_options => {:default_background_color => '#FFFFFF', :default_frame_rate => 24, :default_size => "970 550", :output => "bin/project-debug.swf", :source_path => "src,assets,lib/mvc,lib/editor_core", :verbose_stacktraces => true, :warnings => true}}
98
+ example_config[:main_file] = 'src/editor.mxml'
99
+
100
+ File.open('.textmate_fcsh', 'w+') do |f|
101
+ f.write(YAML::dump(example_config))
102
+ end
103
+ end
104
+
105
+ # Clones the textmate bundle
106
+ def self.create_textmate_bundle!
107
+ puts "Installing textmate bundle."
108
+ `mkdir -p ~/Library/Application\\ Support/TextMate/Bundles`
109
+ `cd ~/Library/Application\\ Support/TextMate/Bundles/ && git clone #{TEXTMATE_BUNDLE_LOCATION} "textmate_fcsh.tmbundle"`
110
+ `osascript -e 'tell app "TextMate" to reload bundles'`
111
+ puts "Textmate bundle installed."
112
+ end
113
+
114
+
115
+ end
@@ -0,0 +1,258 @@
1
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/view/SaveView.as(12): col: 24 Warning: return value for function 'init' has no type declaration.
2
+
3
+ public function init() {
4
+ ^
5
+
6
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/view/Controls.as(43): col: 32 Warning: return value for function 'setPositions' has no type declaration.
7
+
8
+ public function setPositions() {
9
+ ^
10
+
11
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/view/Controls.as(44): col: 8 Warning: variable 'x' has no type declaration.
12
+
13
+ var x = 0;
14
+ ^
15
+
16
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(35): col: 15 Error: Type was not found or was not a compile-time constant: SoundProjectSaver.
17
+
18
+ var lSaver:SoundProjectSaver = new SoundProjectSaver(this.fSoundProject);
19
+ ^
20
+
21
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(35): col: 39 Error: Call to a possibly undefined method SoundProjectSaver.
22
+
23
+ var lSaver:SoundProjectSaver = new SoundProjectSaver(this.fSoundProject);
24
+ ^
25
+
26
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(35): col: 62 Error: Access of possibly undefined property fSoundProject through a reference with static type com.tunedustry.editor.controller:IOController.
27
+
28
+ var lSaver:SoundProjectSaver = new SoundProjectSaver(this.fSoundProject);
29
+ ^
30
+
31
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(36): col: 9 Error: Access of possibly undefined property mainView through a reference with static type com.tunedustry.editor.controller:IOController.
32
+
33
+ this.mainView.getProgressBar().setProgress(0,0);
34
+ ^
35
+
36
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(51): col: 4 Error: Access of undefined property mainView.
37
+
38
+ mainView.getProgressBar().indeterminate = true;
39
+ ^
40
+
41
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(38): col: 5 Error: Access of undefined property mainView.
42
+
43
+ mainView.getProgressBar().visible = false;
44
+ ^
45
+
46
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(39): col: 5 Error: Access of undefined property mainView.
47
+
48
+ mainView.getProgressBar().indeterminate = false;
49
+ ^
50
+
51
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(43): col: 5 Error: Access of undefined property mainView.
52
+
53
+ mainView.getProgressBar().visible = false;
54
+ ^
55
+
56
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(44): col: 5 Error: Call to a possibly undefined method alert.
57
+
58
+ alert(e.text);
59
+ ^
60
+
61
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(48): col: 5 Error: Access of undefined property mainView.
62
+
63
+ mainView.getProgressBar().label = "Saving project...";
64
+ ^
65
+
66
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(49): col: 5 Error: Access of undefined property mainView.
67
+
68
+ mainView.getProgressBar().setProgress(pEvent.bytesLoaded, pEvent.bytesTotal);
69
+ ^
70
+
71
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(57): col: 4 Error: Access of undefined property fSoundProject.
72
+
73
+ fSoundProject = new SoundProject();
74
+ ^
75
+
76
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(58): col: 4 Error: Access of undefined property fSoundProject.
77
+
78
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 1"));
79
+ ^
80
+
81
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(58): col: 34 Error: Call to a possibly undefined method SoundTrack.
82
+
83
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 1"));
84
+ ^
85
+
86
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(58): col: 45 Error: Access of undefined property fSoundProject.
87
+
88
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 1"));
89
+ ^
90
+
91
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(59): col: 4 Error: Access of undefined property fSoundProject.
92
+
93
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 2"));
94
+ ^
95
+
96
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(59): col: 34 Error: Call to a possibly undefined method SoundTrack.
97
+
98
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 2"));
99
+ ^
100
+
101
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(59): col: 45 Error: Access of undefined property fSoundProject.
102
+
103
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 2"));
104
+ ^
105
+
106
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(60): col: 4 Error: Access of undefined property fSoundProject.
107
+
108
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 3"));
109
+ ^
110
+
111
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(60): col: 34 Error: Call to a possibly undefined method SoundTrack.
112
+
113
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 3"));
114
+ ^
115
+
116
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(60): col: 45 Error: Access of undefined property fSoundProject.
117
+
118
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 3"));
119
+ ^
120
+
121
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(61): col: 4 Error: Access of undefined property fSoundProject.
122
+
123
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 4"));
124
+ ^
125
+
126
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(61): col: 34 Error: Call to a possibly undefined method SoundTrack.
127
+
128
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 4"));
129
+ ^
130
+
131
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(61): col: 45 Error: Access of undefined property fSoundProject.
132
+
133
+ fSoundProject.tracks.push(new SoundTrack(fSoundProject, "Track 4"));
134
+ ^
135
+
136
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(62): col: 4 Error: Access of undefined property fSoundProject.
137
+
138
+ fSoundProject.updateTrackOrder();
139
+ ^
140
+
141
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(64): col: 30 Error: Access of undefined property lSoundProject.
142
+
143
+ fMainController.project = lSoundProject;
144
+ ^
145
+
146
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(67): col: 9 Error: Access of possibly undefined property mainView through a reference with static type com.tunedustry.editor.controller:IOController.
147
+
148
+ this.mainView.addEventListener(FlexEvent.CREATION_COMPLETE, function():void {
149
+ ^
150
+
151
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(67): col: 35 Error: Access of undefined property FlexEvent.
152
+
153
+ this.mainView.addEventListener(FlexEvent.CREATION_COMPLETE, function():void {
154
+ ^
155
+
156
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(68): col: 5 Error: Access of undefined property mainView.
157
+
158
+ mainView.getProgressBar().visible = false;
159
+ ^
160
+
161
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(69): col: 5 Error: Incorrect number of arguments. Expected 1.
162
+
163
+ loadProject();
164
+ ^
165
+
166
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(76): col: 28 Error: Type was not found or was not a compile-time constant: SoundProjectLoader.
167
+
168
+ var lSoundProjectLoader:SoundProjectLoader = new SoundProjectLoader(pProject);
169
+ ^
170
+
171
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(76): col: 53 Error: Call to a possibly undefined method SoundProjectLoader.
172
+
173
+ var lSoundProjectLoader:SoundProjectLoader = new SoundProjectLoader(pProject);
174
+ ^
175
+
176
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(81): col: 48 Error: Access of undefined property FlexEvent.
177
+
178
+ fMainController.mainView.addEventListener(FlexEvent.CREATION_COMPLETE, function(e:Event):void {
179
+ ^
180
+
181
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(90): col: 40 Error: Call to a possibly undefined method setProgress through a reference with static type com.tunedustry.editor.controller:ProgressController.
182
+
183
+ fMainController.progressController.setProgress(e.bytesLoaded, e.bytesTotal);
184
+ ^
185
+
186
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/IOController.as(13): col: 40 Error: Definition tunedustry.general.model.loader:SoundProjectSaver could not be found.
187
+
188
+ import tunedustry.general.model.loader.SoundProjectSaver;
189
+ ^
190
+
191
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(26): col: 30 Error: Access of possibly undefined property fSoundProject through a reference with static type com.tunedustry.editor.controller:PlayRecordController.
192
+
193
+ fPlayer = new Player(this.fSoundProject);
194
+ ^
195
+
196
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(28): col: 45 Error: Access of undefined property handlePlayerStopped.
197
+
198
+ fPlayer.addEventListener(PlayEvent.STOP, handlePlayerStopped);
199
+ ^
200
+
201
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(36): col: 14 Error: Access of possibly undefined property recButton through a reference with static type com.tunedustry.editor.view:Controls.
202
+
203
+ fControls.recButton.addEventListener(MouseEvent.CLICK, record);
204
+ ^
205
+
206
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(57): col: 12 Error: Access of possibly undefined property fSoundProject through a reference with static type com.tunedustry.editor.controller:PlayRecordController.
207
+
208
+ if(this.fSoundProject.selectedTrack == null) {
209
+ ^
210
+
211
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(58): col: 5 Error: Call to a possibly undefined method alert.
212
+
213
+ alert("Please select a track first");
214
+ ^
215
+
216
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(71): col: 20 Error: Type was not found or was not a compile-time constant: SoundEvent.
217
+
218
+ var lSoundEvent:SoundEvent = new SoundEvent(fSoundProject.selectedTrack);
219
+ ^
220
+
221
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(71): col: 37 Error: Call to a possibly undefined method SoundEvent.
222
+
223
+ var lSoundEvent:SoundEvent = new SoundEvent(fSoundProject.selectedTrack);
224
+ ^
225
+
226
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(71): col: 48 Error: Access of undefined property fSoundProject.
227
+
228
+ var lSoundEvent:SoundEvent = new SoundEvent(fSoundProject.selectedTrack);
229
+ ^
230
+
231
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(74): col: 4 Error: Access of undefined property fSoundProject.
232
+
233
+ fSoundProject.selectedTrack.addSoundEvent(lSoundEvent);
234
+ ^
235
+
236
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(75): col: 4 Error: Access of undefined property fSoundProject.
237
+
238
+ fSoundProject.prepareAudio();
239
+ ^
240
+
241
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/PlayRecordController.as(87): col: 14 Error: Call to a possibly undefined method setPosition through a reference with static type com.tunedustry.editor.view:Controls.
242
+
243
+ fControls.setPosition(pEvent.position);
244
+ ^
245
+
246
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/ProgressController.as(4): col: 49 Error: Definition editor_core.com.tunedustry.general.model:SoundProject could not be found.
247
+
248
+ import editor_core.com.tunedustry.general.model.SoundProject;
249
+ ^
250
+
251
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/controller/ProgressController.as(13): col: 56 Error: Definition editor_core.com.tunedustry.general.model.loader:SoundProjectSaver could not be found.
252
+
253
+ import editor_core.com.tunedustry.general.model.loader.SoundProjectSaver;
254
+ ^
255
+
256
+ /Users/japetheape/Projects/tunedustry/editor/src/com/tunedustry/editor/view/MainView.mxml(40): Error: Access of undefined property fControls.
257
+
258
+ this.controlHolder.addChild(fControls);
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "HtmlMxmlcErrorFormatter" do
4
+ before(:each) do
5
+ @html_formatter = HtmlMxmlcErrorFormatter.new([MxmlcError.new('test.as', 1, 2, 'warning', 'Not initialized.')])
6
+ end
7
+
8
+
9
+ it "should have generated something" do
10
+ @html_formatter.out.empty?.should_not be true
11
+ #puts @html_formatter.out
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "MxmlcOutputReader" do
4
+ before(:each) do
5
+ mxmlc_output_file = File.join(File.dirname(__FILE__), 'fixtures', 'mxmlc_output.txt')
6
+ @output = ''
7
+ File.open(mxmlc_output_file).each_line { |l| @output << l }
8
+ @mxmlc_output_reader = MxmlcOutputReader.new(@output)
9
+ end
10
+
11
+
12
+ it "should contain errors" do
13
+ @mxmlc_output_reader.errors.length.should be 51
14
+ end
15
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,14 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'textmate_fcsh'
4
+ require 'mxmlc_output/mxmlc_output_reader'
5
+ require 'formatters/html_mxmlc_error_formatter'
6
+
7
+
8
+
9
+ require 'spec'
10
+ require 'spec/autorun'
11
+
12
+ Spec::Runner.configure do |config|
13
+
14
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "TextmateFcsh" do
4
+ it "ad" do
5
+ #fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,60 @@
1
+ <html>
2
+ <head>
3
+ <title>Errors</title>
4
+ <style>
5
+ * {font-family:arial; }
6
+ h1 {}
7
+ html {margin:0px;padding:0px;}
8
+ body {padding:0px;margin:0px;font-size:12px;}
9
+ .header {font-size:10px;border-bottom:1px solid #999;width:100%;text-align:right;background-color:black; color:white;}
10
+ .header .content {padding:10px;}
11
+ .header a {color:white;}
12
+ .container {padding:20px;}
13
+
14
+ table {width:100%;}
15
+ table, tr, td,th {border-spacing:0px;font-size:12px;}
16
+ th, td {padding-left:10px;}
17
+ th {text-align:left;border-bottom:1px solid #999;}
18
+ th.file {width:300px;}
19
+ th.level {width:50px;}
20
+ tr {height:30px;border:1px solid black;}
21
+ tr.warning { background-color:yellow;}
22
+ tr.warning a {color:black;}
23
+
24
+ tr.error { background-color:#FF3000;}
25
+ tr.error a {color:white;}
26
+
27
+ tr.error td {color:white;}
28
+ td {border-bottom:1px dotted #ccc;}
29
+ </style>
30
+ </head>
31
+ <body>
32
+ <div class='header'>
33
+ <div class='content'>
34
+ Generated <strong><%=Time.now.to_s %></strong> by Textmate Fcsh, written by <a href="http://www.jaapvandermeer.com">Jaap van der Meer</a>
35
+ </div>
36
+ </div>
37
+
38
+ <div class='container'>
39
+
40
+ <% if @errors.empty? %>
41
+ <h1>No errors</h1>
42
+ <% else %>
43
+ <h1><%=@errors.select {|e| e.level == "Error" }.size %> errors, <%=@errors.select {|e| e.level == "Warning" }.size %> warnings </h1>
44
+ <table>
45
+ <tr>
46
+ <th class='level'>Level</th><th class='file'>File</th><th class='Notice'>Notice</th>
47
+ </tr>
48
+
49
+ <% @errors.each do |error| %>
50
+ <tr class="<%=error.level %>">
51
+ <td><%=error.level %></td><td><a href="txmt://open/?url=file://<%=error.filename %>&line=<%=error.line %>&column=<%=error.column %>"><%=error.filename %>:<%=error.line %></a></td><td><%=error.message %></td>
52
+ </tr>
53
+ <% end %>
54
+ </table>
55
+ <% end %>
56
+
57
+ </div>
58
+
59
+ </body>
60
+ </html>
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: textmate_fcsh
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Jaap van der Meer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-03-02 00:00:00 +01:00
13
+ default_executable: textmate_fcsh
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.2.9
24
+ version:
25
+ description: Compile Flex in Textmate using FCSH. Advanced error reporting.
26
+ email: jaapvandermeer@gmail.com
27
+ executables:
28
+ - textmate_fcsh
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.rdoc
34
+ files:
35
+ - .document
36
+ - .gitignore
37
+ - LICENSE
38
+ - README.rdoc
39
+ - Rakefile
40
+ - VERSION
41
+ - bin/textmate_fcsh
42
+ - lib/fcsh/fcsh.rb
43
+ - lib/file_watcher.rb
44
+ - lib/formatters/html_mxmlc_error_formatter.rb
45
+ - lib/mxmlc_output/mxmlc_error.rb
46
+ - lib/mxmlc_output/mxmlc_output_reader.rb
47
+ - lib/textmate_fcsh.rb
48
+ - spec/fixtures/mxmlc_output.txt
49
+ - spec/html_mxmlc_error_formatter_spec.rb
50
+ - spec/mxmlc_output_reader_spec.rb
51
+ - spec/spec.opts
52
+ - spec/spec_helper.rb
53
+ - spec/textmate_fcsh_spec.rb
54
+ - templates/standard.html.erb
55
+ has_rdoc: true
56
+ homepage: http://github.com/japetheape/textmate_fcsh
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options:
61
+ - --charset=UTF-8
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ version:
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: "0"
75
+ version:
76
+ requirements: []
77
+
78
+ rubyforge_project:
79
+ rubygems_version: 1.3.5
80
+ signing_key:
81
+ specification_version: 3
82
+ summary: Compile Flex in Textmate using FCSH. Advanced error reporting.
83
+ test_files:
84
+ - spec/html_mxmlc_error_formatter_spec.rb
85
+ - spec/mxmlc_output_reader_spec.rb
86
+ - spec/spec_helper.rb
87
+ - spec/textmate_fcsh_spec.rb