webcomics 3.0.0 → 3.0.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: 1e08bd5d61d611d1fb5a27b2ed3698604a3b29e4
4
- data.tar.gz: 46488c2940ebae2ac65a514f063724f8e7019aa1
3
+ metadata.gz: b4d0d32b1fa0a5ca57332ea1c517c51a2073f38c
4
+ data.tar.gz: 3dc1b49a31c9c3400639d40e221c1f7db5b3cb7b
5
5
  SHA512:
6
- metadata.gz: 09bbfc667d2d48570f6d2ecd5672eca394402f2ec8280ac6eb52bcc3bbd51763232b0809e68ca2c9e8d02dabd16fd398ec4f9d77c7d86eaf96da733928c743a0
7
- data.tar.gz: 91cdcf6f7db27207995aa61b92fc7951beb4cd7921d9c85b34a0684297d9fefd4586fd8e0f325feb95907879cf76b9887dfd888e2bb1f077daad4e32c7897340
6
+ metadata.gz: 199b3ecdaf3154285455710a64bad0ca36c7bccb3cf4d0163e028687bdffa5925841b776ed1e90795d6a39a8761b0f07de7872d69be21dc7d00d804312f85fd4
7
+ data.tar.gz: 53763159c81dfc4bce0759414ca458af0ee314a3be4800493fca53d14f716323898ae3b9184d1cc015490f2b43f8fb1f443c64ac10588646f35038847ddc043f
@@ -9,32 +9,3 @@ def page_equalizer(page, series_path)
9
9
  return $page_number = 0
10
10
  end
11
11
  end
12
- =begin
13
- module WebComics
14
- module ComicsCanvas
15
- def self.num_of_pages(series)
16
- num_of_pages = WebComics::ComicsDir.comics_entries(series).size
17
- end
18
-
19
- def self.page_equalizer(page, series)
20
- if page < 0
21
- return $page_number = num_of_pages(series) - 1
22
- elsif page >= num_of_pages(series)
23
- return $page_number = 0
24
- end
25
-
26
- end
27
-
28
- def self.list_pages(series)
29
- WebComics::ComicsDir.comics_entries(series)
30
- end
31
-
32
- def self.list_chapters(series)
33
- comic_dir = WebComics::ComicsDir.new
34
- comic_dir.series = series
35
- comic_dir.list_directories
36
- end
37
- end
38
-
39
- end
40
- =end
@@ -46,58 +46,3 @@ def ignore_xml(array)
46
46
 
47
47
  files_array
48
48
  end
49
- =begin
50
- module WebComics
51
- class CBZ < ComicsDir
52
- attr_accessor :cbz
53
-
54
- def self.cbz_or_zip?(file)
55
- if File.extname(file) == ".cbz" || File.extname(file) == ".zip"
56
- return true
57
- else
58
- return false
59
- end
60
- end
61
-
62
- def list_cbz_files
63
- files_list = []
64
- list_files.each do |cbz|
65
- files_list.push(cbz) if CBZ.cbz_or_zip?(cbz)
66
- end
67
-
68
- files_list
69
- end
70
-
71
- def list_pages_inside(xml_ignore = true)
72
- files_list = []
73
- Zip::File.open("#{@series}/#{@cbz}") do |cbz|
74
- cbz.each do |pages|
75
- files_list.push(pages.name)
76
- end
77
- end
78
-
79
- return CBZ.ignore_xml(files_list) if xml_ignore
80
-
81
- files_list
82
- end
83
-
84
- def extract(index = 0)
85
- @page = nil
86
- Zip::File.open("#{@series}/#{@cbz}") do |cbz|
87
- @page = cbz.extract(list_pages_inside[index], list_pages_inside[index])
88
- end
89
-
90
- @page
91
- end
92
-
93
- def self.ignore_xml(list)
94
- files_list = []
95
- list.each do |entry|
96
- files_list.push(entry) if File.extname(entry) != ".xml"
97
- end
98
-
99
- files_list
100
- end
101
- end
102
- end
103
- =end
@@ -10,21 +10,3 @@ end
10
10
 
11
11
  alias :is_there_a_db_field_value_that_matches_an_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?
13
- =begin
14
- module WebComics
15
- class ComicsDB
16
- attr_accessor :db_record
17
- attr_accessor :assets
18
-
19
- def exists?
20
- asset_names = []
21
-
22
- Dir.entries(@assets).each do |a|
23
- asset_names.push(a) if a == @db_record
24
- end
25
-
26
- !asset_names.empty?
27
- end
28
- end
29
- end
30
- =end
@@ -68,83 +68,3 @@ alias :is_this_series_path_a_page? :is_this_series_path_a_file?
68
68
  alias :return_an_array_of_comics_pages :return_an_array_of_files
69
69
  alias :return_an_array_of_alpha_chapters :return_an_array_of_alpha_directories
70
70
  alias :return_an_array_of_numeric_chapters :return_an_array_of_numeric_directories
71
-
72
- =begin
73
- module WebComics
74
- class ComicsDir
75
- attr_accessor :series
76
-
77
- def self.comics_entries(dir)
78
- entries = Dir.entries(dir)
79
- entries.delete(".")
80
- entries.delete("..")
81
-
82
- entries
83
- end
84
-
85
- def self.trim(entries)
86
- trimed_entries = []
87
- entries.each do |e|
88
- trimed_entries.push(File.basename(e, ".*"))
89
- end
90
-
91
- trimed_entries
92
- end
93
-
94
- def directory?
95
- File.directory?(@series)
96
- end
97
-
98
- def list_directories
99
- dirs_list = []
100
- ComicsDir.comics_entries(@series).each do |d|
101
- dirs_list.push(d) if File.directory?("#{@series}/#{d}")
102
- end
103
-
104
- dirs_list
105
- end
106
-
107
- def file?
108
- File.file?(@series)
109
- end
110
-
111
- def list_files
112
- files_list = []
113
- ComicsDir.comics_entries(@series).each do |d|
114
- files_list.push(d) if File.file?("#{@series}/#{d}")
115
- end
116
-
117
- files_list
118
- end
119
-
120
- def filter_alphanum_dirs
121
- alphanum_dirs = []
122
- list_directories.each do |d|
123
- alphanum_dirs.push(d) if d =~ /[0-9]/ && d =~ /[a-z]/ || d =~ /[A-Z]/
124
- end
125
-
126
- alphanum_dirs
127
- end
128
-
129
- def filter_alpha_dirs
130
- alpha_dirs = []
131
- list_directories.each do |d|
132
- alpha_dirs.push(d) if d =~ /[a-z]/ || d =~ /[A-Z]/
133
- alpha_dirs.delete_if { |d| d =~ /[0-9]/ }
134
- end
135
-
136
- alpha_dirs
137
- end
138
-
139
- def filter_num_dirs
140
- num_dirs = []
141
- list_directories.each do |d|
142
- num_dirs.push(d) if d =~ /[0-9]/
143
- num_dirs.delete_if { |d| d =~ /[a-z]/ || d =~ /[A-Z]/ }
144
- end
145
-
146
- num_dirs
147
- end
148
- end
149
- end
150
- =end
@@ -11,35 +11,3 @@ def does_this_directory_have_directories?(series_path)
11
11
  end
12
12
 
13
13
  alias :does_this_series_have_chapters? :does_this_directory_have_directories?
14
- =begin
15
- module WebComics
16
- module ComicsDirectoriesHelper
17
- def self.db_assets_match?(db_record, assets_path)
18
- comics_db = WebComics::ComicsDB.new
19
- comics_db.db_record = db_record
20
- comics_db.assets = assets_path
21
-
22
- comics_db.exists?
23
- end
24
-
25
- def self.return_page(series_path, page = 0)
26
- comics_engine = WebComics::ComicsEngine.new
27
- comics_engine.series = series_path
28
-
29
- comics_engine.list_pages[page]
30
- end
31
-
32
- def self.chapter_dir?(series_path)
33
- comics_engine = WebComics::ComicsEngine.new
34
- comics_engine.series = series_path
35
-
36
- if comics_engine.assets_dirs.empty?
37
- return false
38
- else
39
- return true
40
- end
41
- end
42
-
43
- end
44
- end
45
- =end
@@ -30,40 +30,3 @@ def list_pages(series_path = "", path_to_cbz = "")
30
30
  image_array.sort
31
31
  end
32
32
  end
33
- =begin
34
- module WebComics
35
- class ComicsEngine < CBZ
36
- FILE_EXT_ARRY = [".jpg", ".png", ".tiff", ".bmp", ".gif"]
37
-
38
- def filter(entries)
39
- entries.each_index do |i|
40
- entries.delete_if { |e| e.include?(FILE_EXT_ARRY[i]) || e.include?("#") }
41
- end
42
- end
43
-
44
- def assets_dirs
45
- filter(ComicsDir.comics_entries(@series))
46
- end
47
-
48
- def list_pages_cbz
49
- list_pages_inside.sort
50
- end
51
-
52
- def list_pages
53
- if CBZ.cbz_or_zip?("#{@series}/#{@cbz}")
54
- list_pages_cbz
55
- else
56
- img_list = []
57
- FileUtils.cd(@series) do
58
- ComicsDir.comics_entries(".").each do |e|
59
- img_list.push(e) if File.extname(e) == ".jpg" || File.extname(e) == ".png"
60
- end
61
- end
62
-
63
- img_list.sort
64
- end
65
- end
66
-
67
- end
68
- end
69
- =end
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.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralph Desir