dragonfly 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of dragonfly might be problematic. Click here for more details.
- data/History.md +6 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/dragonfly.gemspec +2 -2
- data/extra_docs/Rails2.md +1 -1
- data/extra_docs/Rails3.md +1 -1
- data/irbrc.rb +5 -11
- data/lib/dragonfly/active_model_extensions/attachment.rb +10 -0
- data/spec/dragonfly/active_model_extensions/model_spec.rb +29 -0
- metadata +4 -4
data/History.md
CHANGED
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.4
|
data/dragonfly.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dragonfly}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mark Evans"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-28}
|
13
13
|
s.email = %q{mark@new-bamboo.co.uk}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
data/extra_docs/Rails2.md
CHANGED
data/extra_docs/Rails3.md
CHANGED
data/irbrc.rb
CHANGED
@@ -1,21 +1,15 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/lib/dragonfly'
|
2
2
|
APP = Dragonfly[:images].configure_with(:rmagick)
|
3
3
|
|
4
|
-
available_uids = `find #{APP.datastore.root_path} ! -type d`.split("\n").map do |file|
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
def new_image
|
9
|
-
APP.create_object(File.new(Dir['samples/*'].first))
|
10
|
-
end
|
4
|
+
# available_uids = `find #{APP.datastore.root_path} ! -type d`.split("\n").map do |file|
|
5
|
+
# file.sub("#{APP.datastore.root_path}/", '')
|
6
|
+
# end
|
11
7
|
|
12
8
|
puts "Loaded stuff from dragonfly irbrc"
|
13
|
-
puts "\nAvailable uids:\n"
|
14
|
-
puts available_uids
|
9
|
+
# puts "\nAvailable uids:\n"
|
10
|
+
# puts available_uids
|
15
11
|
puts "\nAvailable sample images:\n"
|
16
12
|
puts Dir['samples/*']
|
17
|
-
puts "\nAvailable methods:\n"
|
18
|
-
puts "new_image"
|
19
13
|
puts "\nAvailable constants:\n"
|
20
14
|
puts "APP"
|
21
15
|
puts
|
@@ -299,6 +299,35 @@ describe Item do
|
|
299
299
|
@item.other_image.data.should == 'eggheads'
|
300
300
|
end
|
301
301
|
end
|
302
|
+
|
303
|
+
describe "assigning by means of a bang method" do
|
304
|
+
before(:each) do
|
305
|
+
@app.processor.add :double do |temp_object|
|
306
|
+
temp_object.data * 2
|
307
|
+
end
|
308
|
+
@app.encoder.add do |temp_object, format|
|
309
|
+
temp_object.data.downcase + format.to_s
|
310
|
+
end
|
311
|
+
@item.preview_image = "HELLO"
|
312
|
+
end
|
313
|
+
it "should modify as if being assigned again" do
|
314
|
+
@item.preview_image.process!(:double)
|
315
|
+
@item.preview_image.data.should == 'HELLOHELLO'
|
316
|
+
end
|
317
|
+
it "should update the magic attributes" do
|
318
|
+
@item.preview_image.process!(:double)
|
319
|
+
@item.preview_image_size.should == 10
|
320
|
+
end
|
321
|
+
it "should work for encode" do
|
322
|
+
@item.preview_image.encode!(:egg)
|
323
|
+
@item.preview_image.data.should == 'helloegg'
|
324
|
+
end
|
325
|
+
it "should work repeatedly" do
|
326
|
+
@item.preview_image.process!(:double).encode!(:egg)
|
327
|
+
@item.preview_image.data.should == 'hellohelloegg'
|
328
|
+
@item.preview_image_size.should == 13
|
329
|
+
end
|
330
|
+
end
|
302
331
|
end
|
303
332
|
|
304
333
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dragonfly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 4
|
10
|
+
version: 0.7.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mark Evans
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-28 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|