furnace-swf 0.0.3 → 0.0.4
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/bin/furnace-swf +24 -9
- data/furnace-swf.gemspec +1 -1
- data/lib/furnace-swf/swf/tag_wrapper.rb +8 -0
- data/lib/furnace-swf/version.rb +1 -1
- metadata +2 -2
data/bin/furnace-swf
CHANGED
@@ -1,9 +1,24 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "rubygems"
|
4
|
-
require "bundler/setup"
|
5
4
|
|
6
|
-
|
5
|
+
root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root_dir,'.git'))
|
7
|
+
Dir.chdir(root_dir) do |path|
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
begin
|
11
|
+
Bundler.setup(:default)
|
12
|
+
rescue Bundler::BundlerError => e
|
13
|
+
warn e.message
|
14
|
+
warn "Run `bundle install` to install missing gems"
|
15
|
+
exit e.status_code
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
lib_dir = File.join(root_dir,'lib')
|
21
|
+
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
|
7
22
|
|
8
23
|
require "trollop"
|
9
24
|
require "furnace-swf"
|
@@ -18,9 +33,9 @@ opts = Trollop::options do
|
|
18
33
|
furnace-swf is a processing tool which operates on Flash SWF files.
|
19
34
|
|
20
35
|
Possible subcommands: #{SUBCOMMANDS.join ' '}
|
21
|
-
Try #{
|
36
|
+
Try #{$0} subcommand --help.
|
22
37
|
|
23
|
-
Usage: #{
|
38
|
+
Usage: #{$0} [options] <subcommand>
|
24
39
|
EOS
|
25
40
|
|
26
41
|
opt :input, "SWF input file", :type => :io
|
@@ -78,8 +93,8 @@ when 'abcextract'
|
|
78
93
|
f.write tag.bytecode
|
79
94
|
end
|
80
95
|
else
|
81
|
-
puts "Tag #{subopts[:name].inspect} was not found"
|
82
|
-
exit 1
|
96
|
+
$stderr.puts "Tag #{subopts[:name].inspect} was not found"
|
97
|
+
exit -1
|
83
98
|
end
|
84
99
|
|
85
100
|
when 'abcreplace'
|
@@ -90,7 +105,7 @@ when 'abcreplace'
|
|
90
105
|
swf.write f
|
91
106
|
end
|
92
107
|
else
|
93
|
-
puts "Tag #{subopts[:name].inspect} was not found"
|
94
|
-
exit 1
|
108
|
+
$stderr.puts "Tag #{subopts[:name].inspect} was not found"
|
109
|
+
exit -1
|
95
110
|
end
|
96
|
-
end
|
111
|
+
end
|
data/furnace-swf.gemspec
CHANGED
@@ -18,6 +18,6 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_runtime_dependency "bindata"
|
21
|
+
s.add_runtime_dependency "bindata"
|
22
22
|
s.add_runtime_dependency "trollop"
|
23
23
|
end
|
data/lib/furnace-swf/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: furnace-swf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-07-
|
13
|
+
date: 2012-07-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bindata
|