webcomics 3.0.1 → 3.1.0

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: b4d0d32b1fa0a5ca57332ea1c517c51a2073f38c
4
- data.tar.gz: 3dc1b49a31c9c3400639d40e221c1f7db5b3cb7b
3
+ metadata.gz: c3a1915ceca574e8ed53cf743fc3ee07a85cc880
4
+ data.tar.gz: 1e10065fb222825fd5241cbec42879911d328b09
5
5
  SHA512:
6
- metadata.gz: 199b3ecdaf3154285455710a64bad0ca36c7bccb3cf4d0163e028687bdffa5925841b776ed1e90795d6a39a8761b0f07de7872d69be21dc7d00d804312f85fd4
7
- data.tar.gz: 53763159c81dfc4bce0759414ca458af0ee314a3be4800493fca53d14f716323898ae3b9184d1cc015490f2b43f8fb1f443c64ac10588646f35038847ddc043f
6
+ metadata.gz: 1306a0c72ed2f7133651f1c84718a7de5c25caa914e6aa88fc7f0a8c5ef93bcdd96c2d313222bd03b3ba3f7eb8d88d8ba59e549efd85e3acf0c8d7c900463656
7
+ data.tar.gz: 2235f7611b719f65d75c90e75beae5648b2f03478f0bfeb415699429519031f9e887ad2ab88eb86aa290ea8a5b20dd194b99b928f69494e4c63413ce94511e80
@@ -8,7 +8,7 @@ def is_this_file_a_cbz_or_zip?(file)
8
8
  end
9
9
  end
10
10
 
11
- def list_cbz_files(series_path)
11
+ def return_an_array_cbz_files(series_path)
12
12
  files_array = []
13
13
  return_an_array_of_files(series_path).each do |file|
14
14
  files_array.push(file) if is_this_file_a_cbz_or_zip?(file)
@@ -17,11 +17,11 @@ def list_cbz_files(series_path)
17
17
  files_array
18
18
  end
19
19
 
20
- def list_pages_inside_a_cbz(path_to_cbz, xml_ignore = true)
20
+ def return_pages_inside_a_cbz(path_to_cbz, xml_ignore = true)
21
21
  files_array = []
22
- Zip::File.open(path_to_cbz) do |file|
23
- file.each do |pages|
24
- files_array.push(pages.name)
22
+ Zip::File.open(path_to_cbz) do |images|
23
+ images.each do |image|
24
+ files_array.push(image.name) if File.extname(image.name) == ".jpg" || File.extname(image.name) == ".png" || File.extname(image.name) == ".bmp" || File.extname(image.name) == ".xml"
25
25
  end
26
26
  end
27
27
 
@@ -30,9 +30,9 @@ def list_pages_inside_a_cbz(path_to_cbz, xml_ignore = true)
30
30
  files_array
31
31
  end
32
32
 
33
- def extract(path_to_cbz, index = 0)
33
+ def extract_image(path_to_cbz, index = 0)
34
34
  Zip::File.open(path_to_cbz) do |cbz|
35
- @page = cbz.extract(list_pages_inside_a_cbz(path_to_cbz)[index], list_pages_inside_a_cbz(path_to_cbz)[index])
35
+ @page = cbz.extract(return_pages_inside_a_cbz(path_to_cbz)[index], return_pages_inside_a_cbz(path_to_cbz)[index])
36
36
  end
37
37
 
38
38
  @page
@@ -8,5 +8,5 @@ def is_there_a_db_field_value_that_matches_an_asset?(field_value, assets_path)
8
8
  !field_values_array.empty?
9
9
  end
10
10
 
11
- alias :is_there_a_db_field_value_that_matches_an_series? :is_there_a_db_field_value_that_matches_an_asset?
11
+ alias :is_there_a_db_field_value_that_matches_a_series? :is_there_a_db_field_value_that_matches_an_asset?
12
12
  alias :db_assets_match? :is_there_a_db_field_value_that_matches_an_asset?
@@ -1,5 +1,5 @@
1
1
  def return_page(series_path, page = 0)
2
- list_pages(series_path)[page]
2
+ return_an_array_of_pages(series_path)[page]
3
3
  end
4
4
 
5
5
  def does_this_directory_have_directories?(series_path)
@@ -12,13 +12,13 @@ def return_series_assets_directories(series_path)
12
12
  return_an_array_of_entries_without_image_files(return_an_array_of_comics_entries(series_path))
13
13
  end
14
14
 
15
- def list_pages_from_cbz(path_to_cbz)
16
- list_pages_inside_a_cbz(path_to_cbz).sort
15
+ def return_an_array_pages_from_cbz(path_to_cbz)
16
+ return_pages_inside_a_cbz(path_to_cbz).sort
17
17
  end
18
18
 
19
- def list_pages(series_path = "", path_to_cbz = "")
19
+ def return_an_array_of_pages(series_path = "", path_to_cbz = "")
20
20
  if is_this_file_a_cbz_or_zip?(path_to_cbz)
21
- list_pages_from_cbz(path_to_cbz)
21
+ return_an_array_pages_from_cbz(path_to_cbz)
22
22
  else
23
23
  image_array = []
24
24
  FileUtils.cd(series_path) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webcomics
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralph Desir
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-25 00:00:00.000000000 Z
12
+ date: 2016-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake