imagery 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/imagery.gemspec +2 -2
- data/lib/imagery.rb +4 -3
- data/test/test_imagery.rb +8 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/imagery.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{imagery}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Cyril David"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-30}
|
13
13
|
s.description = %q{Uses ImageMagick directly underneath. Nuff said.}
|
14
14
|
s.email = %q{cyx.ucron@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/imagery.rb
CHANGED
@@ -2,7 +2,7 @@ require 'escape'
|
|
2
2
|
require 'fileutils'
|
3
3
|
|
4
4
|
module Imagery
|
5
|
-
VERSION = "0.0.
|
5
|
+
VERSION = "0.0.5"
|
6
6
|
|
7
7
|
autoload :Model, "imagery/model"
|
8
8
|
autoload :Faking, "imagery/faking"
|
@@ -11,9 +11,10 @@ module Imagery
|
|
11
11
|
autoload :Test, "imagery/test"
|
12
12
|
|
13
13
|
# Syntactic sugar for Imagery::Model::new
|
14
|
+
# @yield Imagery::Model
|
14
15
|
# @see Imagery::Model#initialize for details
|
15
|
-
def new(*args
|
16
|
-
Model.new(*args
|
16
|
+
def new(*args)
|
17
|
+
Model.new(*args).tap { |model| yield model if block_given? }
|
17
18
|
end
|
18
19
|
module_function :new
|
19
20
|
end
|
data/test/test_imagery.rb
CHANGED
@@ -7,6 +7,14 @@ end
|
|
7
7
|
|
8
8
|
class TestImagery < Test::Unit::TestCase
|
9
9
|
Photo = Class.new(Struct.new(:id))
|
10
|
+
|
11
|
+
test "optionally yields" do
|
12
|
+
imagery = Imagery.new(Photo.new(1001)) do |i|
|
13
|
+
i.sizes = { medium: ["50x50"] }
|
14
|
+
end
|
15
|
+
|
16
|
+
assert_equal({ medium: ["50x50"], original: ["1920x1200>"] }, imagery.sizes)
|
17
|
+
end
|
10
18
|
|
11
19
|
test "namespace" do
|
12
20
|
assert_equal 'photo', Imagery.new(Photo.new(1001)).namespace
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Cyril David
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-30 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|