rack-multipage 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b98abbf91288f4c9afb976fac0d230436a55dca7
4
- data.tar.gz: 71390d5c9b1bbaa466f8b1e41c3dcbb893388da5
3
+ metadata.gz: 853c0aceebecc556b7ae67c9ef5ebc9ae9d45d53
4
+ data.tar.gz: a4b152e071aadecf1724140532605cf7e788c69f
5
5
  SHA512:
6
- metadata.gz: 48f365b74f2466d985e2dc20ffb7767eaeb962efe9d784bf8282a953c18c7a805c2a39f59b7a3db4260af7bc3659733b524f9d3e92c1b7ca5a35ad58dac69306
7
- data.tar.gz: 494cdb5aa27bf74b720d229d1d02028cbfc050924f477d67e8c4cbf68cfba8e3df5ae19c6d048580ae7ba4242394b0e7417f3f52f80559d5adb39d2cb22153fa
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
 
@@ -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
- @height = config.fetch :height, "600"
24
- @width = config.fetch :width, "800"
25
- @percentage = config.fetch :width, "50"
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
- (percentage / 100).to_f
39
+ percentage / 100.0
39
40
  end
40
41
 
41
42
  def css
42
43
  <<-CSS
43
44
  body {
44
- background-color: #eee;
45
+ background-color: #ccc;
45
46
  padding: 0; margin:0;
46
47
  }
47
48
 
48
49
  div.pageboxes {
49
50
  height: 100%;
50
- width: 100p%;
51
+ width: 100%;
51
52
  }
52
53
 
53
54
  div.pageboxes .page {
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  end
3
3
  class Rack::Multipage
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-multipage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Graeme Worthy