fcshd 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,7 +9,7 @@ prefer to compile code from the terminal or their favorite editor:
9
9
  * It abstracts away the crazy command-line interface of `mxmlc` and
10
10
  gives you a simpler and more `gcc`-like interface to work with.
11
11
 
12
- * It postprocesses all compiler output, simplifies most of the
12
+ * It post-processes all compiler output, simplifies most of the
13
13
  verbose (sometimes bordering on rambling) error messages, and
14
14
  converts the stack traces into a more conventional GNU-style
15
15
  format (so that tools like Emacs can understand them).
@@ -18,11 +18,10 @@ prefer to compile code from the terminal or their favorite editor:
18
18
  reference any source directory or SWC you link into `~/.fcshd-lib`
19
19
  (or `$FCSHD_LIBRARY_PATH`, if set) through the `-l` option.
20
20
 
21
-
22
21
  It makes the easy easy:
23
22
 
24
23
  ```
25
- $ fcshc src/foo.mxml
24
+ $ fcshc src/foo.mxml -o foo.swf
26
25
  ```
27
26
 
28
27
  And the hard possible:
@@ -46,7 +45,7 @@ directories, SWC directories, and SWC files can be named in this way.
46
45
  To pass extra arguments, use e.g. `-X -include-file -X NAME -X FILE`.
47
46
 
48
47
  ```
49
- -o, --output OUTPUT.[swf|swc] Name of the resulting binary
48
+ -o, --output OUTPUT.{swf,swc} Name of the resulting binary
50
49
  -l, --library LIBRARY Search LIBRARY when compiling
51
50
 
52
51
  -p, --production Leave out debugging metadata
data/bin/fcshc CHANGED
@@ -28,22 +28,49 @@ $restart_compiler = false
28
28
  $run_compilation = nil
29
29
  $dry_run = false
30
30
 
31
+ def run_command(command)
32
+ begin
33
+ host, port = "localhost", FCSHD::Server::PORT
34
+ socket = TCPSocket.new(host, port)
35
+ rescue Errno::ECONNREFUSED
36
+ die "could not connect to fcshd at #{host}:#{port}"
37
+ end
38
+
39
+ socket.puts command
40
+
41
+ compiler_output = ""
42
+ socket.each_line do |line|
43
+ case line
44
+ when /^fcshd: /
45
+ warn line.chomp
46
+ else
47
+ compiler_output << line
48
+ end
49
+ end
50
+
51
+ if $verbose
52
+ STDOUT.write compiler_output
53
+ end
54
+
55
+ compiler_output
56
+ end
57
+
31
58
  OptionParser.new do |parser|
32
59
  parser.banner = <<EOF
33
- Usage: fcshc MAIN.[as|mxml] [-l LIB] [SRCDIR|SWCDIR|SWC]... [-o OUT.swf]
34
- fcshc -o OUT.swc SRCDIR... [-l LIB]... [SWCDIR|SWC]...
60
+ Usage: fcshc MAIN.{as,mxml} [SRCDIR|SWCDIR|SWC]... [-o OUT.swf]
61
+ fcshc SRCDIR... [SWCDIR|SWC]... -o OUT.swc
35
62
 
36
63
  To compile an SWF, name the main application source file, then any
37
64
  additional source directories, SWC directories, or SWC files.
38
65
 
39
- To compile an SWC using `compc', you must provide the `-o' option, and
66
+ To compile an SWC using `compc`, you must provide the `-o` option, and
40
67
  then at least one source directory, SWC directory, or SWC file.
41
68
 
42
- Dependencies can also be specified by name using the `-l LIB' option,
43
- which will search for LIB or LIB.swc in `~/.fcshd-lib'. Both source
69
+ Dependencies can also be specified by name using the `-l LIB` option,
70
+ which will search for LIB or LIB.swc in `~/.fcshd-lib`. Both source
44
71
  directories, SWC directories, and SWC files can be named in this way.
45
72
 
46
- To pass extra arguments, use e.g. `-X -include-file -X NAME -X FILE'.
73
+ To pass extra arguments, use e.g. `-X -include-file -X NAME -X FILE`.
47
74
 
48
75
  EOF
49
76
 
@@ -57,10 +84,7 @@ EOF
57
84
  $libraries << value
58
85
  end
59
86
 
60
- parser.on("-X", "--extra-argument ARGUMENT", "Pass ARGUMENT to the compiler") do |value|
61
- $run_compilation = true
62
- $extra_arguments << value
63
- end
87
+ parser.separator ""
64
88
 
65
89
  parser.on("-p", "--production", "Leave out debugging metadata") do
66
90
  $run_compilation = true
@@ -95,6 +119,13 @@ EOF
95
119
 
96
120
  parser.separator ""
97
121
 
122
+ parser.on("-X", "--extra-argument ARGUMENT", "Pass ARGUMENT to the compiler") do |value|
123
+ $run_compilation = true
124
+ $extra_arguments << value
125
+ end
126
+
127
+ parser.separator ""
128
+
98
129
  parser.on("-R", "--restart", "Restart the compiler first") do
99
130
  $run_compilation = false if $run_compilation == nil
100
131
  $restart_compiler = true
@@ -110,18 +141,25 @@ EOF
110
141
  $verbose = true
111
142
  end
112
143
 
113
- parser.on("-v", "--version", "Show `fcshc #{FCSHD::VERSION}'") do
144
+ parser.separator ""
145
+
146
+ parser.on("-v", "--version", "Show the fcshd version`") do
114
147
  puts "fcshc #{FCSHD::VERSION}"
115
148
  exit
116
149
  end
117
150
 
151
+ parser.on("--sdk-version", "Show the Flex SDK version") do
152
+ puts run_command("sdk-version")
153
+ exit
154
+ end
155
+
118
156
  parser.on("-h", "--help", "Show this message") do
119
157
  puts parser
120
158
  exit
121
159
  end
122
160
 
123
161
  parser.separator ""
124
- parser.separator "TL;DR: $ fcshc src/my_app.mxml"
162
+ parser.separator "Report bugs to <https://github.com/dbrock/fcshd>."
125
163
  end.parse!
126
164
 
127
165
  $extra_arguments << "-debug" unless $production
@@ -232,33 +270,6 @@ if $run_compilation
232
270
  $compilation_command.concat($extra_arguments)
233
271
  end
234
272
 
235
- def run_command(command)
236
- begin
237
- host, port = "localhost", FCSHD::Server::PORT
238
- socket = TCPSocket.new(host, port)
239
- rescue Errno::ECONNREFUSED
240
- die "could not connect to fcshd at #{host}:#{port}"
241
- end
242
-
243
- socket.puts command
244
-
245
- compiler_output = ""
246
- socket.each_line do |line|
247
- case line
248
- when /^fcshd: /
249
- warn line.chomp
250
- else
251
- compiler_output << line
252
- end
253
- end
254
-
255
- if $verbose
256
- STDOUT.write compiler_output
257
- end
258
-
259
- compiler_output
260
- end
261
-
262
273
  run_command "restart" if $restart_compiler
263
274
 
264
275
  if $run_compilation
@@ -1,6 +1,8 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module FCSHD
3
3
  class Compiler
4
+ attr_reader :sdk_version
5
+
4
6
  def initialize(logger)
5
7
  @logger = logger
6
8
  @output_buffer = ""
@@ -37,6 +39,12 @@ module FCSHD
37
39
  @logger.log "starting #{FlexHome.fcsh}"
38
40
  @fcsh_process = IO.popen("#{FlexHome.fcsh} 2>&1", "r+")
39
41
  read_until_prompt!
42
+ case @output
43
+ when /^Version (\S+)/
44
+ @sdk_version = $1
45
+ else
46
+ @logger.die "could not find Flex SDK version"
47
+ end
40
48
  end
41
49
 
42
50
  def stop_fcsh_process!
data/lib/fcshd/server.rb CHANGED
@@ -26,6 +26,8 @@ module FCSHD
26
26
  when "restart"
27
27
  compiler.restart!
28
28
  socket.puts "fcshd: compiler restarted"
29
+ when "sdk-version"
30
+ socket.puts compiler.sdk_version
29
31
  else
30
32
  socket.puts "fcshd: unrecognized command: #{command}"
31
33
  end
data/lib/fcshd/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  unless defined? FCSHD::VERSION
2
2
  module FCSHD
3
- VERSION = "0.7.1"
3
+ VERSION = "0.7.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fcshd
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 7
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 7
8
- - 1
9
- version: 0.7.1
9
+ - 2
10
+ version: 0.7.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Daniel Brockman
@@ -14,8 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2012-04-13 00:00:00 +02:00
18
- default_executable:
18
+ date: 2012-04-20 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: |
@@ -55,7 +55,6 @@ files:
55
55
  - lib/fcshd/transcript-parser.rb
56
56
  - lib/fcshd/transcript.rb
57
57
  - lib/fcshd/version.rb
58
- has_rdoc: true
59
58
  homepage: http://github.com/dbrock/fcshd
60
59
  licenses: []
61
60
 
@@ -65,23 +64,27 @@ rdoc_options: []
65
64
  require_paths:
66
65
  - lib
67
66
  required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
68
68
  requirements:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
+ hash: 3
71
72
  segments:
72
73
  - 0
73
74
  version: "0"
74
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
+ none: false
75
77
  requirements:
76
78
  - - ">="
77
79
  - !ruby/object:Gem::Version
80
+ hash: 3
78
81
  segments:
79
82
  - 0
80
83
  version: "0"
81
84
  requirements: []
82
85
 
83
86
  rubyforge_project:
84
- rubygems_version: 1.3.6
87
+ rubygems_version: 1.8.22
85
88
  signing_key:
86
89
  specification_version: 3
87
90
  summary: Usable CLI for the Adobe Flex compiler shell (fcsh)