rack-multipage 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/rack-multipage.rb +8 -7
- data/lib/rack-multipage/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: 853c0aceebecc556b7ae67c9ef5ebc9ae9d45d53
|
4
|
+
data.tar.gz: a4b152e071aadecf1724140532605cf7e788c69f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e70ae8ef336f0428d68f055c81d5a25cb0f5a8cd8a25e8a24bf0b974ddc5d9166440baa35074fef598df9a0cc9704a935a29950085e06579962ebf073d526697
|
7
|
+
data.tar.gz: 108b87f5e0209c277cf641dad94af45c0a6a8d8677747075d81236da7bc15badf8b9df083a4be05cdadd2b75ec2d46ce4ca5214782c94624de0dcb2e06562a41
|
data/README.md
CHANGED
@@ -51,6 +51,17 @@ That's maybe unclear: you set the route, and the pages as a configuration hash,
|
|
51
51
|
|
52
52
|
use Rack::MultiPage, route: "/something_else", pages: ["/", "/users/1", "/login"]
|
53
53
|
|
54
|
+
## Configuration
|
55
|
+
|
56
|
+
Out of the box the pages are rendered as 50% thumbnails of 800 * 600 pages.
|
57
|
+
|
58
|
+
here are the configuration variables
|
59
|
+
|
60
|
+
- height: default 800
|
61
|
+
- width: default 600
|
62
|
+
- percentage: default 50
|
63
|
+
|
64
|
+
use Rack::MultiPage, {height: 1200, percentage: 25, pages: ["/", "/users/1", "/login"]}
|
54
65
|
|
55
66
|
## Contributing
|
56
67
|
|
data/lib/rack-multipage.rb
CHANGED
@@ -13,16 +13,17 @@ class Rack::MultiPage
|
|
13
13
|
attr_accessor :app
|
14
14
|
attr_reader :pages_list
|
15
15
|
attr_reader :route
|
16
|
-
attr_reader :height
|
17
16
|
attr_reader :width
|
17
|
+
attr_reader :height
|
18
|
+
attr_reader :percentage
|
18
19
|
|
19
20
|
def initialize (app, config = {})
|
20
21
|
@app = app
|
21
22
|
@pages_list = config.fetch :pages, []
|
22
23
|
@route = config.fetch :route, "/multipage"
|
23
|
-
@
|
24
|
-
@
|
25
|
-
@percentage = config.fetch :
|
24
|
+
@width = config.fetch :width, 800
|
25
|
+
@height = config.fetch :height, 600
|
26
|
+
@percentage = config.fetch :percentage, 50
|
26
27
|
|
27
28
|
end
|
28
29
|
|
@@ -35,19 +36,19 @@ class Rack::MultiPage
|
|
35
36
|
end
|
36
37
|
|
37
38
|
def scale
|
38
|
-
|
39
|
+
percentage / 100.0
|
39
40
|
end
|
40
41
|
|
41
42
|
def css
|
42
43
|
<<-CSS
|
43
44
|
body {
|
44
|
-
background-color: #
|
45
|
+
background-color: #ccc;
|
45
46
|
padding: 0; margin:0;
|
46
47
|
}
|
47
48
|
|
48
49
|
div.pageboxes {
|
49
50
|
height: 100%;
|
50
|
-
width:
|
51
|
+
width: 100%;
|
51
52
|
}
|
52
53
|
|
53
54
|
div.pageboxes .page {
|