AnimeDL 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/anime_dl.gemspec +1 -1
  3. data/bin/anime_dl +9 -7
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 442b8f7aef89fead7a481779590f8c4536071730
4
- data.tar.gz: 7d3f93f2911d31c0d3c837ce86dca532a76947f7
3
+ metadata.gz: 4c4ab79d1ef8cdd5e1358c92ea756e281050ca61
4
+ data.tar.gz: 1d3a2171a534122c4d2c6a3f62b2cf6cc4112f7e
5
5
  SHA512:
6
- metadata.gz: fa4a8feb712dbf6e08c971441272745125e34daa4b27bef079319bb467eeaf0ecad127ed5c4f59ac24cfee4d8e94c42942a0ec174a1b2b5186a40d0421d4243b
7
- data.tar.gz: ae49f39942d5d67084f7a9fcf1af3590acfd94ff2cc0ac41ca924abbd13fb015dba5e07a2636ed613d753a71f80815b6ce79b63c529c1f2811b4e0b0dd0445a4
6
+ metadata.gz: c8f5495fb0dbe795148c8ba90986607eae29105c1e497d79e11c1e62465531a9972d83093db6502704b1faf18105c5b340f1dff057ac3ad69b0c4785506be130
7
+ data.tar.gz: 552eeff77729d8797cc6995d162db669ff5513664c1036360b272727ff4040a5300c3a7a0b880e993a58a8e6211dcd5c03aed01bae23b6c3fc384743dd594cf3
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "AnimeDL"
3
- spec.version = "0.1.6"
3
+ spec.version = "0.1.7"
4
4
  spec.authors = ["Anirudh Sundar"]
5
5
  spec.email = "anirudhsundar@hotmail.com"
6
6
 
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "anime_dl"
3
3
  require "optparse"
4
+ require "fileutils"
4
5
 
5
6
  # APP OPTIONS
6
7
  options = { option: "link", episode: true, file: nil, quiet: false }
@@ -19,8 +20,7 @@ ARGV.options do |opts|
19
20
  opts.separator ""
20
21
  opts.separator "User can either download episodes or get links to video sources of episodes of a particular anime."
21
22
  opts.separator "On running the command the program prompts the user for a search query and prints a list of search results."
22
- opts.separator "The user can then choose a particular anime. Details for all episodes are scraped."
23
- opts.separator "To select particular episodes call the app with the '-e' option."
23
+ opts.separator "The user can then choose a particular anime and choose which episodes to scrape."
24
24
  opts.separator ""
25
25
  opts.separator "Links: "
26
26
  opts.separator " To output links to a file, provide the path to a file as the last argument."
@@ -31,7 +31,7 @@ ARGV.options do |opts|
31
31
  opts.separator ""
32
32
  opts.separator "Options:"
33
33
 
34
- opts.on("-o option", "--option option", help_statements[:option]) do |option|
34
+ opts.on("-o option", "--option=option", help_statements[:option]) do |option|
35
35
  unless (['l', 'link', 'd', 'download'].include? option)
36
36
  puts "Invalid argument to --option"
37
37
  puts %Q[Valid options: "l" (or) "link", "d" (or) "download"]
@@ -127,15 +127,17 @@ if (options[:file])
127
127
  exit
128
128
  end
129
129
  elsif ( !File.exists?( File.split(options[:file])[0] ) )
130
- puts "Directory does not exist"
130
+ puts "Location does not exist"
131
131
  exit
132
132
  end
133
133
 
134
- elsif ( !File.exists?(options[:file]) || !File.directory?(options[:file]) )
135
- puts "Directory does not exist (or) argument is not a directory"
134
+ elsif ( File.file?(options[:file]) )
135
+ puts "Argument is not a directory"
136
136
  puts "For --option=download , argument to --file must be a directory"
137
137
  exit
138
-
138
+ elsif ( !File.exists?(options[:file]) )
139
+ puts "Creating New Directory #{options[:file]}"
140
+ FileUtils.mkdir_p(options[:file])
139
141
  end
140
142
 
141
143
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: AnimeDL
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anirudh Sundar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-27 00:00:00.000000000 Z
11
+ date: 2017-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize