hamidashi 0.1.0 → 0.1.1

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: b6759e01f75ab860eea331d8113aa007122cbb30
4
- data.tar.gz: fbad71ed914f7d4fe22f40df39e6fbf40d826c3b
3
+ metadata.gz: b911bc9d39ccb9d0763cf351ea38704757d9c5d6
4
+ data.tar.gz: 9df53507831095a16c00f323c1fc9d8374e3720f
5
5
  SHA512:
6
- metadata.gz: bcbf00d328a0127e64775a3d6025c64364eb3931e0c36ec03b02723a1202d307fa016a3db9b47247eed2c5938bd856bbe4cb85764e095c623e5363265e108b80
7
- data.tar.gz: 6a852d3c2bc181b9c2a3e437ab9ebd5249ba94fc3d79e217c69c6d0bbafb2dfb48273c65961488383d9e045fe01dd523fb70bbe90decb86d8ad405dceba2e24a
6
+ metadata.gz: 0fc143212b3e6b0a7e7598091817c591fea3c7a6097dcb1665dbae792ec79045639dab983da9743e78dfa9355dbb6ffcd8575f50f4f7c6671e9f13e597151af7
7
+ data.tar.gz: b85faa5e17447be04bb1e182d2e9840b6ab40e06df95dddf3f42d842d300883abb7c8f9e370a40d55cc7fdaad16da067f8fb1e809e36ccc3ec755844a8432987
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Hamidashi
2
2
 
3
- PDFの文字がはみ出してるか調べる
3
+ Detect PDF text overflow.
4
4
 
5
5
  ## Requirements
6
6
 
data/exe/hamidashi CHANGED
@@ -13,12 +13,12 @@ pdf_path = File.expand_path(ARGV[0])
13
13
  output_dir = File.expand_path("hamidashi-#{Time.now.strftime("%Y%m%d%H%M%S")}")
14
14
 
15
15
  Dir.mktmpdir('hamidashi') do |temp_dir|
16
- はみだし = Hamidashi.new
16
+ hamidashi = Hamidashi.new
17
17
 
18
18
  (0...PDF::Reader.new(pdf_path).page_count).each do |page|
19
- if はみだし.てる?(pdf_path, page)
19
+ if hamidashi.overflow?(pdf_path, page)
20
20
  puts page
21
- はみだし.てる画像を保存(pdf_path, page, "#{temp_dir}/#{page}.png")
21
+ hamidashi.save_page(pdf_path, page, "#{temp_dir}/#{page}.png")
22
22
  end
23
23
  end
24
24
 
data/hamidashi.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Seiei Miyagi"]
10
10
  spec.email = ["hanachin@gmail.com"]
11
11
 
12
- spec.summary = %q{PDFの文字がはみ出してないか調べる.}
12
+ spec.summary = %q{Detect PDF text overflow.}
13
13
  spec.homepage = "https://github.com/yasslab/hamidashi"
14
14
  spec.license = "MIT"
15
15
 
data/lib/hamidashi.rb CHANGED
@@ -1,18 +1,18 @@
1
1
  require "hamidashi/version"
2
2
 
3
3
  class Hamidashi
4
- def てる?(pdf_path, page)
4
+ def overflow?(pdf_path, page)
5
5
  colornum=`convert -density 92 -geometry #{width} -crop #{crop} "#{pdf_path}[#{page}]" -format %c histogram:info: | wc -l`.to_i
6
6
  colornum != expected_colornum
7
7
  end
8
8
 
9
- def てる画像を保存(pdf_path, page, path)
9
+ def save_page(pdf_path, page, path)
10
10
  `convert -density 92 -geometry #{width} "#{pdf_path}[#{page}]" #{path}`
11
11
  end
12
12
 
13
13
  private
14
14
 
15
- # TODO 外部から設定出来るようにしたい
15
+ # TODO provide a way to set these config values
16
16
 
17
17
  def crop
18
18
  "#{crop_width}x+#{width - crop_width}+0"
@@ -1,3 +1,3 @@
1
1
  class Hamidashi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hamidashi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seiei Miyagi
@@ -111,5 +111,5 @@ rubyforge_project:
111
111
  rubygems_version: 2.4.5
112
112
  signing_key:
113
113
  specification_version: 4
114
- summary: PDFの文字がはみ出してないか調べる.
114
+ summary: Detect PDF text overflow.
115
115
  test_files: []