jpeg 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/ext/jpeg.c CHANGED
@@ -1,6 +1,8 @@
1
1
  #include "jpeg.h"
2
2
  #include "jpeg_jpeg.h"
3
+ #include "jpeg_error.h"
3
4
 
4
5
  void Init_jpeg() {
5
6
  Init_jpeg_jpeg();
7
+ Init_jpeg_error();
6
8
  }
data/ext/jpeg_error.c ADDED
@@ -0,0 +1,10 @@
1
+ #include "jpeg.h"
2
+ #include "jpeg_error.h"
3
+ #include "ruby.h"
4
+
5
+ extern VALUE Jpeg;
6
+ VALUE Error;
7
+
8
+ void Init_jpeg_error() {
9
+ Error = rb_define_class_under(Jpeg, "Error", rb_eStandardError);
10
+ }
data/ext/jpeg_error.h ADDED
@@ -0,0 +1,6 @@
1
+ #ifndef __JPEG_ERROR_H__
2
+ #define __JPEG_ERROR_H__
3
+
4
+ void Init_jpeg_error();
5
+
6
+ #endif
data/ext/jpeg_jpeg.c CHANGED
@@ -1,6 +1,7 @@
1
1
  #include <stdio.h>
2
2
  #include <jpeglib.h>
3
3
  #include "jpeg_jpeg.h"
4
+ #inlcude "jpeg_error.h"
4
5
 
5
6
  VALUE Jpeg;
6
7
 
@@ -12,6 +13,8 @@ static VALUE jpeg_jpeg_width(VALUE self);
12
13
  static VALUE jpeg_jpeg_height(VALUE self);
13
14
  static VALUE jpeg_jpeg_size(VALUE self);
14
15
 
16
+ extern VALUE Error;
17
+
15
18
  void Init_jpeg_jpeg() {
16
19
  Jpeg = rb_define_class("Jpeg", rb_cObject);
17
20
  rb_define_alloc_func(Jpeg, jpeg_jpeg_alloc);
@@ -23,7 +26,7 @@ void Init_jpeg_jpeg() {
23
26
  void jpeg_jpeg_exit(j_common_ptr jpeg) {
24
27
  char buffer[JMSG_LENGTH_MAX];
25
28
  jpeg->err->format_message(jpeg, buffer);
26
- rb_raise(rb_eRuntimeError, buffer);
29
+ rb_raise(Error, buffer);
27
30
  }
28
31
 
29
32
  static VALUE jpeg_jpeg_alloc(VALUE klass) {
data/jpeg.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "jpeg"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["masarakki"]
@@ -29,6 +29,8 @@ Gem::Specification.new do |s|
29
29
  "ext/extconf.rb",
30
30
  "ext/jpeg.c",
31
31
  "ext/jpeg.h",
32
+ "ext/jpeg_error.c",
33
+ "ext/jpeg_error.h",
32
34
  "ext/jpeg_jpeg.c",
33
35
  "ext/jpeg_jpeg.h",
34
36
  "jpeg.gemspec",
@@ -41,7 +43,7 @@ Gem::Specification.new do |s|
41
43
  s.homepage = "http://github.com/masarakki/jpeg"
42
44
  s.licenses = ["MIT"]
43
45
  s.require_paths = ["lib"]
44
- s.rubygems_version = "1.8.10"
46
+ s.rubygems_version = "1.8.21"
45
47
  s.summary = "libjpeg wrapper for ruby"
46
48
 
47
49
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jpeg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &85056890 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *85056890
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rdoc
27
- requirement: &85055720 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *85055720
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: bundler
38
- requirement: &85316710 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *85316710
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: jeweler
49
- requirement: &85315860 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,7 +69,12 @@ dependencies:
54
69
  version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *85315860
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  description: libjpeg wrapper for ruby
59
79
  email: masaki@hisme.net
60
80
  executables: []
@@ -75,6 +95,8 @@ files:
75
95
  - ext/extconf.rb
76
96
  - ext/jpeg.c
77
97
  - ext/jpeg.h
98
+ - ext/jpeg_error.c
99
+ - ext/jpeg_error.h
78
100
  - ext/jpeg_jpeg.c
79
101
  - ext/jpeg_jpeg.h
80
102
  - jpeg.gemspec
@@ -98,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
120
  version: '0'
99
121
  segments:
100
122
  - 0
101
- hash: -706570573
123
+ hash: -2228495824855443174
102
124
  required_rubygems_version: !ruby/object:Gem::Requirement
103
125
  none: false
104
126
  requirements:
@@ -107,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
129
  version: '0'
108
130
  requirements: []
109
131
  rubyforge_project:
110
- rubygems_version: 1.8.10
132
+ rubygems_version: 1.8.21
111
133
  signing_key:
112
134
  specification_version: 3
113
135
  summary: libjpeg wrapper for ruby