rai 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +58 -1
- data/lib/rai/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e3e45323e085e138807ed68cb37d8c59d02b7d0
|
4
|
+
data.tar.gz: 8a23e4f8448d84c90cabb0f5e1eb501977c1a0d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11b1deacc4d2fff0b5fedd45fabff32391df3759a5216ddd716aeebff6da7ba77c7375218cd529142fde08d0d0230edc5246e1578d0a7c6802e19b841154b4c7
|
7
|
+
data.tar.gz: f430662073ad9123d3b5b9c47ad25b106b44e0431c54a7289d43950279a465bfb4841fe6ade4e0cee1ede3292d0531de7682e0d82e5db356e0f0620b87c383bd
|
data/README.md
CHANGED
@@ -1,7 +1,64 @@
|
|
1
1
|
# Ruby Adaptive-Images
|
2
|
-
This is a ruby port of Adaptive-Images (http://adaptive-images.com/, originally by Matt Wilcox).
|
2
|
+
This is a ruby port of Adaptive-Images (http://adaptive-images.com/, originally by Matt Wilcox). It does not contain all features, but it does more or less the same in the same way. It uses ImageMagick (via mini_magick) in stead of GD.
|
3
3
|
|
4
4
|
It runs as a sinatra application that can be mounted using Rack.
|
5
5
|
|
6
|
+
# Installation
|
7
|
+
|
8
|
+
To install, run: `gem install rai`
|
9
|
+
|
10
|
+
# Configuration
|
11
|
+
|
12
|
+
Put something like this in your config.ru:
|
13
|
+
|
14
|
+
```
|
15
|
+
require 'rai'
|
16
|
+
|
17
|
+
map '/gallery' do
|
18
|
+
Rai::App.set :img_path, '/path/to/your/images'
|
19
|
+
Rai::App.set :cache_path, '/path/to/your/cache'
|
20
|
+
run Rai::App
|
21
|
+
end
|
22
|
+
|
23
|
+
```
|
24
|
+
|
25
|
+
## Settings
|
26
|
+
|
27
|
+
### :watch_cache
|
28
|
+
Keep an eye on the cache to see if it needs updating.
|
29
|
+
Values: true/false
|
30
|
+
Default: true
|
31
|
+
|
32
|
+
### :resolutions
|
33
|
+
Resolution break-points (screen widths).
|
34
|
+
Value: array
|
35
|
+
Default: [1382, 992, 768, 480, 320]
|
36
|
+
|
37
|
+
### :jpg_quality
|
38
|
+
JPG compression ratio, 0-100.
|
39
|
+
Value: integer, 0-100
|
40
|
+
Default: 75
|
41
|
+
|
42
|
+
### :sharpen
|
43
|
+
Wether image should be sharpened or not.
|
44
|
+
Value: true/false
|
45
|
+
Default: true
|
46
|
+
|
47
|
+
### :cache_max_age
|
48
|
+
Browser cache TTL
|
49
|
+
Value: integer, seconds
|
50
|
+
Default: 60*60*24*7 (7 days)
|
51
|
+
|
52
|
+
### :img_path
|
53
|
+
Where images are placed.
|
54
|
+
Value: string, path
|
55
|
+
Default:File.join(File.dirname(__FILE__), 'images')
|
56
|
+
|
57
|
+
### :cache_path
|
58
|
+
Where cached versions are placed.
|
59
|
+
Value: string, path
|
60
|
+
Default: File.join(File.dirname(__FILE__), 'images', 'cache')
|
61
|
+
|
6
62
|
# Author
|
7
63
|
Kim Nørgaard <jasen@jasen.dk>
|
64
|
+
|
data/lib/rai/version.rb
CHANGED