class Object
Constants
- ENTRIES_BY_DISTRO
- FANSUBBERS
- LARGE_RESOLUTION
- MEDIUM_RESOLUTION
- SMALL_RESOLUTION
- SPEEDSUBBER
Public Instance Methods
delete_distro(distro)
click to toggle source
# File lib/nyaa_anime/remove.rb, line 50 def delete_distro(distro) ts = ENTRIES_BY_DISTRO[distro].map { |entry| "#{NyaaAnime::NYAA_DL_DIR}#{entry.title}" } if agree "Delete all #{ts.size} torrent files for #{distro}? (y/n) " File.delete(*ts) end end
prompt_to_open(torrents)
click to toggle source
# File lib/nyaa_anime/search.rb, line 136 def prompt_to_open(torrents) torrents = [torrents] unless torrents.is_a? Array if torrents.count == 1 puts "Downloaded #{File.basename torrents[0]}." else puts "Downloaded #{torrents.count} torrent files." end if agree "Open downloaded torrent#{"s" if torrents.count > 1}? (y/n): " if OS.mac? `open #{torrents.join " "}` elsif OS.windows? torrents.each { |torr| `#{torr}` } else # POSIX assumed torrents.each { |torr| `xdg-open #{torr} &` } end end end