mangdown 0.13.3 → 0.13.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mangdown/page.rb +6 -4
- data/lib/mangdown/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b46ede1b55f92c1ff03e43c64890bcb77f98838
|
4
|
+
data.tar.gz: ce4927534522cc6bf0ab39deece40bb58d7524d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 669578148a673bdd314a4f49cb541947e473d9286e907f51effc28e298d877ac56f68c44830c4c6b123732deacb289395d96bf13245d5f2db28d8e61305748f1
|
7
|
+
data.tar.gz: c4e48d29330badd3ebd2166262b6fa62783b0ce614ccac4907ec7b7e2c4259618aa16c8535d0498770451ee507bc5f8f33f599757235573063eb0c5145e7a0c9
|
data/lib/mangdown/page.rb
CHANGED
@@ -6,7 +6,7 @@ module Mangdown
|
|
6
6
|
attr_reader :uri, :name, :manga, :chapter
|
7
7
|
|
8
8
|
def initialize(uri, name, manga, chapter)
|
9
|
-
@name = name
|
9
|
+
@name = Tools.valid_path_name(name)
|
10
10
|
@chapter = chapter
|
11
11
|
@manga = manga
|
12
12
|
@uri = Mangdown::Uri.new(uri)
|
@@ -21,14 +21,16 @@ module Mangdown
|
|
21
21
|
@path ||= set_path
|
22
22
|
end
|
23
23
|
|
24
|
+
# Set path of page to file path if a file exists or to path
|
25
|
+
# without file extension if file is not found. File extensions
|
26
|
+
# are appended only after the file has been downloaded.
|
24
27
|
def set_path(dir = nil)
|
25
28
|
dir ||= File.join(manga, chapter)
|
26
29
|
dir = Tools.valid_path_name(dir)
|
27
|
-
path = File.join(dir, name)
|
28
30
|
if Dir.exist?(dir)
|
29
|
-
|
31
|
+
file = Dir.entries(dir).find { |file| file[name] }
|
30
32
|
end
|
31
|
-
path =
|
33
|
+
path = File.join(dir, file || name)
|
32
34
|
@path = Tools.relative_or_absolute_path(path)
|
33
35
|
end
|
34
36
|
|
data/lib/mangdown/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mangdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jphager2
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|