oily_png 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,21 +1,31 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oily_png (0.1.0)
5
- chunky_png (~> 0.10.2)
4
+ oily_png (0.1.1)
5
+ chunky_png (~> 0.10.4)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- chunky_png (0.10.2)
10
+ chunky_png (0.10.4)
11
+ diff-lcs (1.1.2)
11
12
  rake (0.8.7)
12
- rspec (1.3.0)
13
+ rspec (2.0.0)
14
+ rspec-core (= 2.0.0)
15
+ rspec-expectations (= 2.0.0)
16
+ rspec-mocks (= 2.0.0)
17
+ rspec-core (2.0.0)
18
+ rspec-expectations (2.0.0)
19
+ diff-lcs (>= 1.1.2)
20
+ rspec-mocks (2.0.0)
21
+ rspec-core (= 2.0.0)
22
+ rspec-expectations (= 2.0.0)
13
23
 
14
24
  PLATFORMS
15
25
  ruby
16
26
 
17
27
  DEPENDENCIES
18
- chunky_png (~> 0.10.2)
28
+ chunky_png (~> 0.10.4)
19
29
  oily_png!
20
30
  rake
21
- rspec (>= 1.3)
31
+ rspec (~> 2.0)
data/lib/oily_png.rb CHANGED
@@ -2,7 +2,7 @@ require 'chunky_png'
2
2
 
3
3
  module OilyPNG
4
4
 
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
 
7
7
  def self.included(base)
8
8
  base::Canvas.send(:extend, OilyPNG::PNGDecoding)
data/oily_png.gemspec CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
 
5
5
  # Do not change the version and date fields by hand. This will be done
6
6
  # automatically by the gem release script.
7
- s.version = "0.1.0"
8
- s.date = "2010-10-08"
7
+ s.version = "0.1.1"
8
+ s.date = "2010-10-18"
9
9
 
10
10
  s.summary = "Native mixin to speed up ChunkyPNG"
11
11
  s.description = <<-EOT
@@ -19,10 +19,10 @@ Gem::Specification.new do |s|
19
19
  s.extensions = ["ext/oily_png/extconf.rb"]
20
20
  s.require_paths = ["lib", "ext"]
21
21
 
22
- s.add_runtime_dependency('chunky_png', '~> 0.10.2')
22
+ s.add_runtime_dependency('chunky_png', '~> 0.10.4')
23
23
 
24
24
  s.add_development_dependency('rake')
25
- s.add_development_dependency('rspec', '>= 1.3')
25
+ s.add_development_dependency('rspec', '~> 2.0')
26
26
 
27
27
  s.rdoc_options << '--title' << s.name << '--main' << 'README.rdoc' << '--line-numbers' << '--inline-source'
28
28
  s.extra_rdoc_files = ['README.rdoc']
@@ -9,26 +9,26 @@ describe OilyPNG::PNGEncoding do
9
9
  end
10
10
 
11
11
  it "should encode an image using grayscale correctly" do
12
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_GRAYSCALE, ChunkyPNG::FILTER_NONE)
13
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_GRAYSCALE, ChunkyPNG::FILTER_NONE)
12
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_GRAYSCALE, ChunkyPNG::FILTER_NONE)
13
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_GRAYSCALE, ChunkyPNG::FILTER_NONE)
14
14
  stream1.should == stream2
15
15
  end
16
16
 
17
17
  it "should encode an image using grayscale alpha correctly" do
18
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_GRAYSCALE_ALPHA, ChunkyPNG::FILTER_NONE)
19
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_GRAYSCALE_ALPHA, ChunkyPNG::FILTER_NONE)
18
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_GRAYSCALE_ALPHA, ChunkyPNG::FILTER_NONE)
19
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_GRAYSCALE_ALPHA, ChunkyPNG::FILTER_NONE)
20
20
  stream1.should == stream2
21
21
  end
22
22
 
23
23
  it "should encode an image using truecolor correctly" do
24
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_NONE)
25
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_NONE)
24
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_NONE)
25
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_NONE)
26
26
  stream1.should == stream2
27
27
  end
28
28
 
29
29
  it "should encode an image using truecolor alpha correctly" do
30
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_TRUECOLOR_ALPHA, ChunkyPNG::FILTER_NONE)
31
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_TRUECOLOR_ALPHA, ChunkyPNG::FILTER_NONE)
30
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR_ALPHA, ChunkyPNG::FILTER_NONE)
31
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR_ALPHA, ChunkyPNG::FILTER_NONE)
32
32
  stream1.should == stream2
33
33
  end
34
34
 
@@ -38,8 +38,8 @@ describe OilyPNG::PNGEncoding do
38
38
  @canvas.stub(:encoding_palette).and_return(mock_palette)
39
39
  @oily_canvas.stub(:encoding_palette).and_return(mock_palette)
40
40
 
41
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_INDEXED, ChunkyPNG::FILTER_NONE)
42
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_INDEXED, ChunkyPNG::FILTER_NONE)
41
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_INDEXED, ChunkyPNG::FILTER_NONE)
42
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_INDEXED, ChunkyPNG::FILTER_NONE)
43
43
  stream1.should == stream2
44
44
  end
45
45
  end
@@ -51,32 +51,32 @@ describe OilyPNG::PNGEncoding do
51
51
  end
52
52
 
53
53
  it "should encode correctly with no filtering" do
54
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_NONE)
55
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_NONE)
54
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_NONE)
55
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_NONE)
56
56
  stream1.should == stream2
57
57
  end
58
58
 
59
59
  it "should encode correctly with sub filtering" do
60
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_SUB)
61
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_SUB)
60
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_SUB)
61
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_SUB)
62
62
  stream1.should == stream2
63
63
  end
64
64
 
65
65
  it "should encode correctly with up filtering" do
66
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_UP)
67
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_UP)
66
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_UP)
67
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_UP)
68
68
  stream1.should == stream2
69
69
  end
70
70
 
71
71
  it "should encode correctly with average filtering" do
72
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_AVERAGE)
73
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_AVERAGE)
72
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_AVERAGE)
73
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_AVERAGE)
74
74
  stream1.should == stream2
75
75
  end
76
76
 
77
77
  it "should encode correctly with paeth filtering" do
78
- @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_PAETH)
79
- @canvas.send(:encode_png_image_pass_to_stream, stream2 = "", ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_PAETH)
78
+ @oily_canvas.send(:encode_png_image_pass_to_stream, stream1 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_PAETH)
79
+ @canvas.send(:encode_png_image_pass_to_stream, stream2 = ChunkyPNG::Datastream.empty_bytearray, ChunkyPNG::COLOR_TRUECOLOR, ChunkyPNG::FILTER_PAETH)
80
80
  stream1.should == stream2
81
81
  end
82
82
  end
data/spec/spec_helper.rb CHANGED
@@ -3,7 +3,7 @@ require 'bundler'
3
3
 
4
4
  Bundler.setup
5
5
 
6
- require 'spec'
6
+ require 'rspec'
7
7
  require 'chunky_png'
8
8
  require 'oily_png/oily_png_ext'
9
9
 
@@ -35,7 +35,7 @@ module CanvasHelper
35
35
  end
36
36
  end
37
37
 
38
- Spec::Runner.configure do |config|
38
+ RSpec.configure do |config|
39
39
  config.extend ResourceHelper
40
40
  config.include CanvasHelper
41
41
  end
@@ -71,23 +71,23 @@ module GithubGem
71
71
 
72
72
  # Defines RSpec tasks
73
73
  def define_rspec_tasks!
74
- require 'spec/rake/spectask'
74
+ require 'rspec/core/rake_task'
75
75
 
76
76
  namespace(:spec) do
77
77
  desc "Verify all RSpec examples for #{gemspec.name}"
78
- Spec::Rake::SpecTask.new(:basic) do |t|
79
- t.spec_files = FileList[spec_pattern]
78
+ RSpec::Core::RakeTask.new(:basic) do |t|
79
+ t.pattern = spec_pattern
80
80
  end
81
81
 
82
82
  desc "Verify all RSpec examples for #{gemspec.name} and output specdoc"
83
- Spec::Rake::SpecTask.new(:specdoc) do |t|
84
- t.spec_files = FileList[spec_pattern]
85
- t.spec_opts << '--format' << 'specdoc' << '--color'
83
+ RSpec::Core::RakeTask.new(:specdoc) do |t|
84
+ t.pattern = spec_pattern
85
+ t.rspec_opts = ['--format', 'documentation', '--color']
86
86
  end
87
87
 
88
88
  desc "Run RCov on specs for #{gemspec.name}"
89
- Spec::Rake::SpecTask.new(:rcov) do |t|
90
- t.spec_files = FileList[spec_pattern]
89
+ RSpec::Core::RakeTask.new(:rcov) do |t|
90
+ t.pattern = spec_pattern
91
91
  t.rcov = true
92
92
  t.rcov_opts = ['--exclude', '"spec/*,gems/*"', '--rails']
93
93
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oily_png
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Willem van Bergen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-08 00:00:00 +02:00
18
+ date: 2010-10-18 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,16 +24,16 @@ dependencies:
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- hash: 51
27
+ hash: 63
28
28
  segments:
29
29
  - 0
30
30
  - 10
31
- - 2
32
- version: 0.10.2
31
+ - 4
32
+ version: 0.10.4
33
33
  requirement: *id001
34
+ type: :runtime
34
35
  name: chunky_png
35
36
  prerelease: false
36
- type: :runtime
37
37
  - !ruby/object:Gem::Dependency
38
38
  version_requirements: &id002 !ruby/object:Gem::Requirement
39
39
  none: false
@@ -45,24 +45,24 @@ dependencies:
45
45
  - 0
46
46
  version: "0"
47
47
  requirement: *id002
48
+ type: :development
48
49
  name: rake
49
50
  prerelease: false
50
- type: :development
51
51
  - !ruby/object:Gem::Dependency
52
52
  version_requirements: &id003 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
- - - ">="
55
+ - - ~>
56
56
  - !ruby/object:Gem::Version
57
- hash: 9
57
+ hash: 3
58
58
  segments:
59
- - 1
60
- - 3
61
- version: "1.3"
59
+ - 2
60
+ - 0
61
+ version: "2.0"
62
62
  requirement: *id003
63
+ type: :development
63
64
  name: rspec
64
65
  prerelease: false
65
- type: :development
66
66
  description: " This Ruby C extenstion defines a module that can be included into ChunkyPNG to improve its speed.\n"
67
67
  email:
68
68
  - willem@railsdoctors.com