sugar_png 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sugar_png.rb +4 -2
- data/lib/sugar_png/datastream.rb +19 -0
- data/spec/spec_helper.rb +13 -1
- data/sugar_png.gemspec +3 -3
- metadata +4 -4
- data/spec/sugar_png_spec.rb +0 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/lib/sugar_png.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module SugarPNG
|
2
|
+
class Datastream
|
3
|
+
attr_accessor :img
|
4
|
+
|
5
|
+
def initialize h={}
|
6
|
+
@img = h[:img]
|
7
|
+
end
|
8
|
+
|
9
|
+
def metadata
|
10
|
+
{}
|
11
|
+
end
|
12
|
+
|
13
|
+
class << self
|
14
|
+
def from_file fname
|
15
|
+
self.new :img => ZPNG::Image.load(fname)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -7,6 +7,18 @@ require 'sugar_png'
|
|
7
7
|
# in ./support/ and its subdirectories.
|
8
8
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
9
|
|
10
|
+
module ResourceFileHelper
|
11
|
+
def resource_file(name)
|
12
|
+
File.expand_path("./resources/#{name}", File.dirname(__FILE__))
|
13
|
+
end
|
14
|
+
|
15
|
+
def resource_data(name)
|
16
|
+
data = nil
|
17
|
+
File.open(resource_file(name), 'rb') { |f| data = f.read }
|
18
|
+
data
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
10
22
|
RSpec.configure do |config|
|
11
|
-
|
23
|
+
config.include ResourceFileHelper
|
12
24
|
end
|
data/sugar_png.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "sugar_png"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andrey \"Zed\" Zaikin"]
|
12
|
-
s.date = "2012-12-
|
12
|
+
s.date = "2012-12-24"
|
13
13
|
s.email = "zed.0xff@gmail.com"
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE.txt"
|
@@ -23,8 +23,8 @@ Gem::Specification.new do |s|
|
|
23
23
|
"Rakefile",
|
24
24
|
"VERSION",
|
25
25
|
"lib/sugar_png.rb",
|
26
|
+
"lib/sugar_png/datastream.rb",
|
26
27
|
"spec/spec_helper.rb",
|
27
|
-
"spec/sugar_png_spec.rb",
|
28
28
|
"sugar_png.gemspec"
|
29
29
|
]
|
30
30
|
s.homepage = "http://github.com/zed-0xff/sugar_png"
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: sugar_png
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrey "Zed" Zaikin
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
prerelease: false
|
@@ -90,8 +90,8 @@ files:
|
|
90
90
|
- Rakefile
|
91
91
|
- VERSION
|
92
92
|
- lib/sugar_png.rb
|
93
|
+
- lib/sugar_png/datastream.rb
|
93
94
|
- spec/spec_helper.rb
|
94
|
-
- spec/sugar_png_spec.rb
|
95
95
|
- sugar_png.gemspec
|
96
96
|
homepage: http://github.com/zed-0xff/sugar_png
|
97
97
|
licenses:
|
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
segments:
|
109
109
|
- 0
|
110
|
-
hash:
|
110
|
+
hash: 2321017741205927420
|
111
111
|
none: false
|
112
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|