textmate_fcsh 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/fcsh/fcsh.rb +29 -2
  3. data/textmate_fcsh.gemspec +1 -1
  4. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
data/lib/fcsh/fcsh.rb CHANGED
@@ -9,14 +9,27 @@ class Fcsh
9
9
 
10
10
 
11
11
  def compile(command)
12
- compile_first_time!(command) if !@targets.include?(command)
12
+ if !@targets.include?(command)
13
+ errors = compile_first_time!(command)
14
+ if !errors.nil?
15
+ puts errors
16
+ exit
17
+ end
18
+
19
+ end
13
20
  puts "Compiling..."
14
21
  @error_output_last_run = ''
15
22
  @stdin.puts "compile %d" % [@targets.index(command) + 1]
16
23
 
24
+ outfile = "bin/"
25
+
17
26
  # watch std out till files changed
18
27
  @stdout.each_line do |line|
19
- #puts line.inspect
28
+ if /.+\.swf/.match(line)
29
+ puts ""
30
+ break
31
+ end
32
+
20
33
  if /Files changed/.match(line)
21
34
  capture_error_output
22
35
  break
@@ -30,8 +43,22 @@ class Fcsh
30
43
  def compile_first_time!(command)
31
44
  puts "Assigning target..."
32
45
  @stdin.puts command
46
+
47
+ @mxmlc_errors = nil
48
+ a = Thread.new do
49
+ @stderr.each_line do |line|
50
+
51
+ if /Error: /.match(line) || !@mxmlc_errors.nil?
52
+ @mxmlc_errors ||= "Errors while compiling, please check your .textmate_fcsh. Mxml output:\n"
53
+ @mxmlc_errors << line
54
+ end
55
+ end
56
+ end
57
+
58
+
33
59
  @targets << command
34
60
  sleep 3
61
+ return @mxmlc_errors
35
62
  end
36
63
 
37
64
  # Currently there is no way of knowing when error output has finished,
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{textmate_fcsh}
8
- s.version = "0.3.0"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jaap van der Meer"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textmate_fcsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaap van der Meer