rendaku 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e331152fd22cbf0bfdc63cf645c14de30e021941
4
- data.tar.gz: a8ef2e1b61a5f476b86024edb6513647680a94d5
3
+ metadata.gz: 14aecdb69c1ecc2eade7a6db74083f5effdaa35b
4
+ data.tar.gz: 581bf0344d0c774da2a2ad7674b539a8ad547829
5
5
  SHA512:
6
- metadata.gz: e01b15e3361576f1942370f685f1d22d5ebfe80edf96219172d2875f39302cfb6ed52ca477e2141dcedc6e21d857d9dd700f42e08bcc7bcd31ea673a514e6e49
7
- data.tar.gz: 715eb7e49535a00fd88610e17b39964cd8adba6f76df51be3ff8e97be3014924d1edd5f4434c56c461e905b35f1a729212590327b29c3a8b28d710d0bfae1dd0
6
+ metadata.gz: 77a3273edec8bb2d8cb1ed6786f14c653c04f9f73b1beb58d2ec9a865167cbb3ea400517e3803e39e81ee69ceaf5d34d0484a9a57b8f9db23b2c01c36feea414
7
+ data.tar.gz: cdd37879ef5effd767002aaaf7e5995fee3ac17d868083da6c6b2d9670a4b78c42667578d91971e572d354373e7aeda9f5cf074127dd6a30c39a0d18619786da
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rendaku (0.0.0)
4
+ rendaku (1.0.0)
5
5
  rmagick (~> 2.13)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -3,9 +3,49 @@
3
3
  Rendaku is a ruby gem which accepts book dimensions and a simple image file for
4
4
  generating book art page-folding instructions.
5
5
 
6
- ![image](https://i.imgur.com/9KTDiUG.png)
6
+ ![book-folding art by my wife](https://i.imgur.com/9KTDiUG.png)
7
+
7
8
 
8
9
  Inspired by the work at https://github.com/Moini/BookArtGenerator
9
10
 
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'rendaku'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ ```shell
22
+ bundle
23
+ ```
24
+
25
+ Or install it locally:
26
+
27
+ ```shell
28
+ gem install rendaku
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ```ruby
34
+ book_first_page = 2
35
+ book_last_page = 300
36
+ book_height_in_cm = 18 # or inches
37
+ book = Rendaku::Book.new book_first_page, book_last_page, book_height_in_cm
38
+
39
+ # image can be of jpeg, gif, or png format,
40
+ # but should be a simple black & white image for best results
41
+ image = Rendaku::Image::read('/path/to/file.png').first
42
+
43
+ pattern = Rendaku::Pattern.new book, image
10
44
 
45
+ pattern.book #=> #<Rendaku::Book:0x007fde931e03b0 @first_page=2, @last_page=300, @height=18>
46
+ pattern.image #=> /path/to/file.png PNG 629x1241=>150x1800 150x1800+0+0 DirectClass 8-bit
11
47
 
48
+ # the template outputs a list of page numbers and associated folds
49
+ # measured from the bottom of the page
50
+ pattern.template #=> [[{ :page => 2, :top => 6.04, :bottom => 6.08 }],[{ :page => 4, :top => 6.02, :bottom => 6.11 }]]
51
+ ```
@@ -1,3 +1,3 @@
1
1
  module Rendaku
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/rendaku.rb CHANGED
@@ -26,9 +26,9 @@ module Rendaku
26
26
  def fold_template pattern
27
27
  template = []
28
28
  pattern.each_with_index do |contents, col|
29
- top_corner = contents[0][:start]
29
+ top_corner = contents[0][:start]
30
30
  bottom_corner = contents[0][:end]
31
- page = (col*2) + @book.first_page
31
+ page = (col*2) + @book.first_page
32
32
 
33
33
  template << { page: page, top: top_corner, bottom: bottom_corner }
34
34
  end
data/rendaku.gemspec CHANGED
@@ -16,5 +16,6 @@ Gem::Specification.new do |s|
16
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
17
17
  s.require_paths = ['lib']
18
18
 
19
+ s.required_ruby_version = ">= 1.9.3"
19
20
  s.add_dependency 'rmagick', '~> 2.13'
20
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rendaku
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Anderson
@@ -52,7 +52,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: 1.9.3
56
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="