mangdown 0.13.0 → 0.13.2

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: 0d85a1d5f0bf974970fcc26e817583bfcf16226b
4
- data.tar.gz: 9b8108fd038b01dd78eda987753c38a4e21c0f94
3
+ metadata.gz: 4619032c750ec3a18f5427f6d51ed5d0ea934b20
4
+ data.tar.gz: defdc99d480348dd4e17f72eec385596224d5df1
5
5
  SHA512:
6
- metadata.gz: c61a0df176b08ed90f5f4a56a8215aa027af64a2f3ed89a7ae722c5cf8d7b32e005b2d8c4851b7ba23abfae80506651e8459b8ee2b66d4c761572cafc6406034
7
- data.tar.gz: 638112e648008bde76e405c5309b19223cde0a9d684ee4827cfd0901b4170ca723edabab0374884799ef937f4b2e429144a30b7dcc4728f4a78ce999a0100608
6
+ metadata.gz: 5dc4f1d2436738e29f96f729e85248c2e4d87d46c308cca0a31c245971b9439e9455f8fc9b04cbf9572637647c7d560e9836215f61e93078958f467a051e15e7
7
+ data.tar.gz: f280db306b9dd05717a644b2b66dc19b5c28d255b67af05fae7003c928d89406c92d9f8c1a6f312e474875b1c19e85703a8e4ec496f6dda96316f015532ca4d4
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ ![Gitten badge](http://gittens.r15.railsrumble.com//badge/jphager2/mangdown)
2
+
3
+ There is a simple built-in client, "M", that you can use for finding manga:
4
+
5
+ ```
6
+ results = M.find("Dragon Ball")
7
+
8
+ # Get a Mangdown::Manga object
9
+ manga = results.first.to_manga
10
+
11
+ # Get a chapter count
12
+ manga.count
13
+
14
+ # Download everything
15
+ manga.download
16
+
17
+ # Download a specific range
18
+ manga.download(0, 99)
19
+
20
+ # Convert all downloaded chapters to CBZ
21
+ manga.cbz
22
+
23
+ ```
@@ -4,13 +4,13 @@ module Mangdown
4
4
 
5
5
  def initialize(uri, doc, name)
6
6
  super
7
- @root ||= 'http://www.mangareader.net'
8
- @manga_list_css = 'ul.series_alpha li a'
7
+ @root ||= 'http://www.mangareader.net'
8
+ @manga_list_css = 'ul.series_alpha li a'
9
9
  @manga_name_css = 'h2.aname'
10
- @chapter_list_css = 'div#chapterlist td a'
10
+ @chapter_list_css = 'div#chapterlist td a'
11
11
  @manga_list_uri = "#{@root}/alphabetical"
12
- @manga_link_prefix = @root
13
- @reverse_chapters = false
12
+ @manga_link_prefix = @root
13
+ @reverse_chapters = false
14
14
  @manga_uri_regex =
15
15
  /#{@root}(\/\d+)?(\/[^\/]+)(\.html)?/i
16
16
  @chapter_uri_regex =
@@ -5,7 +5,7 @@ module M
5
5
 
6
6
  DATA_FILE_PATH = Dir.home + '/.manga_list.yml'
7
7
  HELP_FILE_PATH = File.expand_path(
8
- '../../doc/help.txt', File.dirname(__FILE__)
8
+ '../../README.md', File.dirname(__FILE__)
9
9
  )
10
10
  =begin
11
11
  MANGA_PAGES = (1..9).map { |p|
@@ -29,12 +29,12 @@ module M
29
29
 
30
30
  # cbz all subdirectories in a directory
31
31
  def cbz(dir)
32
- Dir.exist?(dir) ? (CBZ.all(dir)) : (raise Errno::ENOENT, dir)
32
+ Dir.exist?(dir) ? CBZ.all(dir) : raise(Errno::ENOENT, dir)
33
33
  end
34
34
 
35
- # isplay help file
35
+ # display help file
36
36
  def help
37
- puts File.open(HELP_FILE_PATH, 'r').read
37
+ puts File.read(HELP_FILE_PATH)
38
38
  end
39
39
 
40
40
  # delete data file
@@ -62,10 +62,10 @@ module M
62
62
  # otherwise fetch new data and write it to the data file
63
63
  def current_manga_list
64
64
  data = data_from_file
65
- return MangaList.from_data(data) if data.is_a? Array
65
+ return MangaList.from_data(data) if data
66
66
 
67
67
  MangaList.new(*MANGA_PAGES).tap { |list|
68
- File.open(path,'w+') {|f| f.write(list.to_yaml)}
68
+ File.open(path, 'w+') { |f| f.write(list.to_yaml) }
69
69
  }
70
70
  rescue Object => error
71
71
  puts "#{path} may be corrupt: #{error.message}"
@@ -0,0 +1,3 @@
1
+ module Mangdown
2
+ VERSION = "0.13.2"
3
+ end
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.0
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jphager2
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-14 00:00:00.000000000 Z
11
+ date: 2016-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -143,7 +143,7 @@ extensions: []
143
143
  extra_rdoc_files: []
144
144
  files:
145
145
  - LICENSE
146
- - doc/help.txt
146
+ - README.md
147
147
  - lib/mangdown.rb
148
148
  - lib/mangdown/adapter.rb
149
149
  - lib/mangdown/adapter/mangafox.rb
@@ -163,6 +163,7 @@ files:
163
163
  - lib/mangdown/properties.rb
164
164
  - lib/mangdown/tools.rb
165
165
  - lib/mangdown/uri.rb
166
+ - lib/mangdown/version.rb
166
167
  - spec/lib/mangdown/cbz_spec.rb
167
168
  - spec/lib/mangdown/chapter_spec.rb
168
169
  - spec/lib/mangdown/commands_spec.rb
data/doc/help.txt DELETED
@@ -1,54 +0,0 @@
1
- ====================================================================
2
- Mangdown
3
-
4
- Commands
5
-
6
- M.find(string) - Will return an array of Mangdown::MDHash given
7
- a string which is matched to manga names of the
8
- 3000 most popular mangas on Mangareader, Mangafox,
9
- Wiemanga, and more (you can roll your own adapter
10
- for any site you want).
11
-
12
- results = M.find('Naruto')
13
-
14
-
15
-
16
- **Use Mangdown::MDHash#to_manga to get a Mangdown::Manga object**
17
-
18
- naruto = results[0].to_manga
19
-
20
-
21
-
22
- Mangdown::Manga#download(int = 0, int = -1)
23
- - Will download a manga (Mangdown::Manga object)
24
- from the first int (index of the first chapter)
25
- to the last int (index of the last chapter) to
26
- a subdirectory of the set DOWNLOAD_DIR which
27
- is the Dir.home directory by default named
28
- #{manga.name}". If no indexes are given, all
29
- chapters are downloaded.
30
-
31
- # naruto is the Mangdown::Manga object from the example above
32
- naruto.download(500, 549)
33
-
34
- Mangdown::Manga#download_to(dir, int = 0, int = -1)
35
- - Same as download above, but you can provide
36
- the directory when the manga subdirectory
37
- will be downloaded
38
-
39
- # naruto is the Mangdown::Manga object from the example above
40
- naruto.download_to(Dir.home + '/manga', 500, 549)
41
-
42
- M.cbz(path) - Will validate names of subdirectories in the path
43
- and thier files and then Zip those subdirectories
44
- with a .cbz extention
45
-
46
- M.clean_up - Will delete .manga_list.yml file from the home
47
- directory
48
-
49
- M.clean_up
50
-
51
-
52
- M.help - Will display help for commands
53
-
54
- =======================================================================