swf_ruby 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -2,14 +2,18 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  swf_ruby (0.0.1)
5
+ bundler (>= 1.0.0.rc.5)
6
+ rmagick (>= 2.13.0)
5
7
 
6
8
  GEM
7
9
  remote: http://rubygems.org/
8
10
  specs:
11
+ rmagick (2.13.1)
9
12
 
10
13
  PLATFORMS
11
14
  ruby
12
15
 
13
16
  DEPENDENCIES
14
17
  bundler (>= 1.0.0.rc.5)
18
+ rmagick (>= 2.13.0)
15
19
  swf_ruby!
data/README.md CHANGED
@@ -12,9 +12,18 @@ SwfRuby is a utilities to dump or manipulate a SWF with Ruby.
12
12
  * Used from 'swf_jpeg_replace' command.
13
13
  * compatible on ruby-1.8.7 and ruby-1.9.2.
14
14
 
15
+ Dependencies
16
+ ============
17
+
18
+ * RMagick >= 2.13.0 (ImageMagick >= 6.5.7)
19
+
15
20
  Installation
16
21
  ============
17
22
 
23
+ $ gem install swf_ruby
24
+
25
+ or
26
+
18
27
  $ git clone git://github.com/tmtysk/swf_ruby.git
19
28
  $ cd swf_ruby
20
29
  $ rake install
@@ -40,7 +49,7 @@ Replacing Jpeg in SWF
40
49
  ---------------------
41
50
 
42
51
  $ swf_jpeg_replace samples/sample.swf 623 samples/bg.jpg > samples/sample2.swf
43
- # <623> is offset to Jpeg resource getting by 'swf_dump'.
52
+ # <623> is offset to DefineBitsJPEG2 resource getting by 'swf_dump'.
44
53
 
45
54
  Thanks
46
55
  ======
data/bin/swf_dump CHANGED
@@ -4,7 +4,11 @@
4
4
 
5
5
  require 'swf_ruby'
6
6
 
7
- print "Specify swf file path to dump for argument." if ARGV.size != 1
7
+ if ARGV.size != 1
8
+ print "Specify swf file path to dump for argument.\n"
9
+ exit
10
+ end
11
+
8
12
  swf = SwfRuby::SwfDumper.new
9
13
  swf.open(ARGV[0])
10
14
  swf.tags.each_with_index do |tag, i|
data/bin/swf_jpeg_replace CHANGED
@@ -3,7 +3,10 @@
3
3
  # SWF中のJpeg(DefineBitsJpeg2)イメージを差し替える.
4
4
  require 'swf_ruby'
5
5
 
6
- print "Specify target swf path, offset to jpeg, new jpeg path for arguments." if ARGV.size != 3
6
+ if ARGV.size != 3
7
+ print "Specify target swf path, offset to jpeg, new jpeg path for arguments.\n"
8
+ exit
9
+ end
7
10
 
8
11
  swf = File.open(ARGV[0], "rb").read
9
12
  st = SwfRuby::SwfTamperer.new
@@ -14,6 +14,15 @@ module SwfRuby
14
14
  end
15
15
  end
16
16
 
17
+ class Lossless2ReplaceTarget < ReplaceTarget
18
+ attr_accessor :image
19
+
20
+ def initialize(offset, image)
21
+ @offset = offset
22
+ @image = SwfRuby::Swf::BitsLossless2.new(image)
23
+ end
24
+ end
25
+
17
26
  class AsVarReplaceTarget < ReplaceTarget
18
27
  attr_accessor :do_action_offset
19
28
  attr_accessor :str
@@ -2,7 +2,6 @@
2
2
  module SwfRuby
3
3
  # Swfに含まれるリソースを置換するクラス.
4
4
  class SwfTamperer
5
-
6
5
  # 対象Swf(バイナリ)のリソースを置換.
7
6
  # 置換対象はReplaceTargetオブジェクトの配列で渡す.
8
7
  def replace(swf, replace_targets)
@@ -1,3 +1,3 @@
1
1
  module SwfRuby
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/samples/icon.gif ADDED
Binary file
data/swf_ruby.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.required_rubygems_version = ">= 1.3.6"
16
16
  s.rubyforge_project = "swf_ruby"
17
17
 
18
- s.add_development_dependency "bundler", ">= 1.0.0.rc.5"
18
+ s.add_dependency "bundler", ">= 1.0.0.rc.5"
19
19
 
20
20
  s.bindir = 'bin'
21
21
  s.executables = ['swf_dump', 'swf_jpeg_replace']
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors: []
12
12
 
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-12 00:00:00 +09:00
17
+ date: 2011-02-01 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  - rc
33
33
  - 5
34
34
  version: 1.0.0.rc.5
35
- type: :development
35
+ type: :runtime
36
36
  version_requirements: *id001
37
37
  description: SwfRuby is utilities to dump or manipulate Swf binary file.
38
38
  email: []
@@ -68,6 +68,7 @@ files:
68
68
  - lib/swf_ruby/swf_tamperer.rb
69
69
  - lib/swf_ruby/version.rb
70
70
  - samples/bg.jpg
71
+ - samples/icon.gif
71
72
  - samples/sample.swf
72
73
  - swf_ruby.gemspec
73
74
  has_rdoc: true