dynamic_image 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{README.rdoc → README.md} +36 -36
- data/Rakefile +1 -10
- data/VERSION +1 -1
- data/dynamic_image.gemspec +7 -7
- metadata +9 -9
data/{README.rdoc → README.md}
RENAMED
@@ -1,64 +1,64 @@
|
|
1
|
-
|
1
|
+
# DynamicImage
|
2
2
|
|
3
3
|
DynamicImage is a Rails plugin that simplifies image uploading and processing.
|
4
|
-
No configuration is necessary, as resizing and processing is done on demand and
|
5
|
-
cached rather than on upload.
|
4
|
+
No configuration is necessary, as resizing and processing is done on demand and
|
5
|
+
cached rather than on upload.
|
6
6
|
|
7
|
-
Note: This version is currently Rails 3 specific, although the final 1.0
|
8
|
-
version will also be compatible with 2.x.
|
7
|
+
Note: This version is currently Rails 3 specific, although the final 1.0
|
8
|
+
version will also be compatible with 2.x.
|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
## Installation
|
12
12
|
|
13
13
|
Install the gem:
|
14
14
|
|
15
|
-
|
15
|
+
gem install dynamic_image
|
16
16
|
|
17
17
|
Add the gem to your Gemfile:
|
18
18
|
|
19
|
-
|
19
|
+
gem 'dynamic_image'
|
20
20
|
|
21
21
|
Do the migrations:
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
rails generate dynamic_image migrations
|
24
|
+
rake db:migrate
|
25
25
|
|
26
26
|
|
27
|
-
|
27
|
+
## Getting started
|
28
28
|
|
29
29
|
Let's create a model with an image:
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
class User
|
32
|
+
belongs_to_image :mugshot
|
33
|
+
end
|
34
34
|
|
35
35
|
Uploading files is pretty straightforward, just add a <tt>file_field</tt>
|
36
|
-
to your form and update your record as usual:
|
36
|
+
to your form and update your record as usual:
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
<%= form_for @user, :html => {:multipart => true} do |f| %>
|
39
|
+
Name: <%= f.text_field :name %>
|
40
|
+
Mugshot: <%= f.file_field :mugshot %>
|
41
|
+
<%= submit_tag "Save" %>
|
42
|
+
<% end %>
|
43
43
|
|
44
44
|
You can now use the <tt>dynamic_image_tag</tt> helper to show off your
|
45
45
|
new image:
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
<% if @user.mugshot? %>
|
48
|
+
<%= dynamic_image_tag @user.profile_picture, :size => '64x64' %>
|
49
|
+
<% end %>
|
50
50
|
|
51
51
|
|
52
|
-
|
52
|
+
## Filters
|
53
53
|
|
54
54
|
I'm cleaning up the filters syntax, watch this space.
|
55
55
|
|
56
56
|
|
57
|
-
|
57
|
+
## Technical
|
58
58
|
|
59
|
-
The original master files are stored in the file system and identified a
|
59
|
+
The original master files are stored in the file system and identified a
|
60
60
|
SHA-1 hash of the contents. If you're familiar with the internal workings
|
61
|
-
of git, this should seem familiar.
|
61
|
+
of git, this should seem familiar.
|
62
62
|
|
63
63
|
Processing images on the fly is expensive. Therefore, page caching is enabled
|
64
64
|
by default, even in development mode. To disable page caching, add the following
|
@@ -67,28 +67,28 @@ line in your initializers:
|
|
67
67
|
DynamicImage.page_caching = false
|
68
68
|
|
69
69
|
|
70
|
-
|
70
|
+
## History
|
71
71
|
|
72
72
|
DynamicImage was originally created in early 2006 to handle images
|
73
73
|
for the Pages CMS. It was later extracted as a Rails Engine for Rails
|
74
|
-
1.2 in 2007, which also marked the first public release as
|
75
|
-
dynamic_image_engine.
|
74
|
+
1.2 in 2007, which also marked the first public release as
|
75
|
+
dynamic_image_engine.
|
76
76
|
|
77
77
|
The API has remained more or less unchanged, but the internal workings
|
78
78
|
have been refactored a few times over the years, most notably dropping
|
79
79
|
the Engines dependency and transitioning from database storage to file
|
80
|
-
system.
|
80
|
+
system.
|
81
81
|
|
82
|
-
The current version is based on an internal branch targeting Rails
|
82
|
+
The current version is based on an internal branch targeting Rails
|
83
83
|
2.3, and modified to work as a Rails 3 plugin. It's not directly
|
84
|
-
compatible with earlier versions, but upgrading shouldn't be more
|
84
|
+
compatible with earlier versions, but upgrading shouldn't be more
|
85
85
|
trouble than migrating the files out of the database.
|
86
86
|
|
87
87
|
|
88
|
-
|
88
|
+
## Copyright
|
89
|
+
|
90
|
+
Copyright © 2006 Inge Jørgensen.
|
89
91
|
|
90
|
-
Copyright © 2006-2010 Inge Jørgensen.
|
91
|
-
|
92
92
|
Permission is hereby granted, free of charge, to any person obtaining
|
93
93
|
a copy of this software and associated documentation files (the
|
94
94
|
"Software"), to deal in the Software without restriction, including
|
data/Rakefile
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/testtask'
|
3
|
-
require 'rake/rdoctask'
|
4
3
|
|
5
4
|
require "rake"
|
6
5
|
|
@@ -13,7 +12,7 @@ begin
|
|
13
12
|
gem.homepage = "http://github.com/elektronaut/dynamic_image"
|
14
13
|
gem.authors = ["Inge Jørgensen"]
|
15
14
|
gem.files = Dir["*", "{lib}/**/*", "{app}/**/*", "{config}/**/*"]
|
16
|
-
gem.add_dependency("rmagick", "~> 2.
|
15
|
+
gem.add_dependency("rmagick", "~> 2.13.2")
|
17
16
|
gem.add_dependency("vector2d", "~> 1.0.0")
|
18
17
|
end
|
19
18
|
Jeweler::GemcutterTasks.new
|
@@ -32,11 +31,3 @@ Rake::TestTask.new(:test) do |t|
|
|
32
31
|
t.verbose = true
|
33
32
|
end
|
34
33
|
|
35
|
-
desc 'Generate documentation for the dynamic_image plugin.'
|
36
|
-
Rake::RDocTask.new(:rdoc) do |rdoc|
|
37
|
-
rdoc.rdoc_dir = 'rdoc'
|
38
|
-
rdoc.title = 'DynamicImage'
|
39
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
40
|
-
rdoc.rdoc_files.include('README')
|
41
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
42
|
-
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.7
|
data/dynamic_image.gemspec
CHANGED
@@ -5,19 +5,19 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "dynamic_image"
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Inge J\303\270rgensen"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2014-02-11"
|
13
13
|
s.email = "inge@elektronaut.no"
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
16
|
-
"README.
|
16
|
+
"README.md"
|
17
17
|
]
|
18
18
|
s.files = [
|
19
19
|
"LICENSE",
|
20
|
-
"README.
|
20
|
+
"README.md",
|
21
21
|
"Rakefile",
|
22
22
|
"VERSION",
|
23
23
|
"app/controllers/images_controller.rb",
|
@@ -48,14 +48,14 @@ Gem::Specification.new do |s|
|
|
48
48
|
s.specification_version = 3
|
49
49
|
|
50
50
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
51
|
-
s.add_runtime_dependency(%q<rmagick>, ["~> 2.
|
51
|
+
s.add_runtime_dependency(%q<rmagick>, ["~> 2.13.2"])
|
52
52
|
s.add_runtime_dependency(%q<vector2d>, ["~> 1.0.0"])
|
53
53
|
else
|
54
|
-
s.add_dependency(%q<rmagick>, ["~> 2.
|
54
|
+
s.add_dependency(%q<rmagick>, ["~> 2.13.2"])
|
55
55
|
s.add_dependency(%q<vector2d>, ["~> 1.0.0"])
|
56
56
|
end
|
57
57
|
else
|
58
|
-
s.add_dependency(%q<rmagick>, ["~> 2.
|
58
|
+
s.add_dependency(%q<rmagick>, ["~> 2.13.2"])
|
59
59
|
s.add_dependency(%q<vector2d>, ["~> 1.0.0"])
|
60
60
|
end
|
61
61
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_image
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 53
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 7
|
10
|
+
version: 0.9.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Inge J\xC3\xB8rgensen"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2014-02-11 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rmagick
|
@@ -25,12 +25,12 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 63
|
29
29
|
segments:
|
30
30
|
- 2
|
31
|
-
-
|
31
|
+
- 13
|
32
32
|
- 2
|
33
|
-
version: 2.
|
33
|
+
version: 2.13.2
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -57,10 +57,10 @@ extensions: []
|
|
57
57
|
|
58
58
|
extra_rdoc_files:
|
59
59
|
- LICENSE
|
60
|
-
- README.
|
60
|
+
- README.md
|
61
61
|
files:
|
62
62
|
- LICENSE
|
63
|
-
- README.
|
63
|
+
- README.md
|
64
64
|
- Rakefile
|
65
65
|
- VERSION
|
66
66
|
- app/controllers/images_controller.rb
|