blitzcrank 0.0.5 → 0.0.6

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: dab0d16ac92cd86527396a935efe51975f723476
4
- data.tar.gz: 05da35ec05ebe6f12c9a8a2d0b87a9713bc8c8ea
3
+ metadata.gz: 29fc15af6198605e637b0c3bb56d44adcd16f2fc
4
+ data.tar.gz: 5225375f08734c89cbfd1aceb796d010a6d6754f
5
5
  SHA512:
6
- metadata.gz: 76e549f85edb5f31bec31e7357494f6d35bb153b82ad4d690adea318e5f810fdd23778a7d651661b58b53a1000eb107e715f7db2f33fb3a03a5b654549b39a42
7
- data.tar.gz: eff80c388a1e017ad286db93c4bda41e7504a25cde4c5233154d3ce7727a5d8b5535b88c6535cd51f1402c4e7ba81b44ceea2f4b73840d1f087d91b0baf01ee3
6
+ metadata.gz: f23d53f0404652b67025b77f60d8cba6f4d0113a77f719315eb32481371693af0c79756b8013fc5681a2d061963f9688fd94979c66f7d90044bd89c51d453405
7
+ data.tar.gz: 31b615201c293a9b0eb17d82cfc8bb08679647d3ae67f33947e7cbf829c48cf627d0252a71925cba55d61c4d099745a1f4bc87237bcc332cd2ab863c42e93d16
data/README.md CHANGED
@@ -47,11 +47,12 @@ Blitzcrank requires a small amount of setup. First, it mainly does transfers vi
47
47
  $ cat ~/.blitzcrank
48
48
  ---
49
49
  :base_tv_dir: "/Volumes/Public/TV Shows/"
50
+ :base_movie_dir: "/Volumes/Public/Movies/"
50
51
  :remote_user: "root"
51
52
  :remote_host: "subdomain.domain.tld"
52
53
  :remote_base_dir: "~/torrents/"
53
54
 
54
- This can be generated with [Mana Barrier](#mana-barrier)
55
+ This can be generated with [Mana Barrier](#mana-barrier). If you would also like to limit the connection speed rsync uses, add `:bwlimit: <kb/sec>`. `:bwlimit: 2000` would limit transfer speeds to 2000kb/second.
55
56
 
56
57
  ### Sample Directory Structure
57
58
 
data/lib/blitzcrank.rb CHANGED
@@ -46,6 +46,7 @@ module Blitzcrank
46
46
  system("rsync -avz #{ '--bwlimit=' + @config[:bwlimit] unless @config[:bwlimit].nil? } --progress --rsh='ssh' \"#{@config[:remote_user]}@#{@config[:remote_host]}:#{@config[:remote_base_dir]}#{remote_path.gsub(' ', '\\ ')}\" \"#{local_dir}\"")
47
47
  end
48
48
 
49
+ # get a listing of all remote files that would be considered "videos"
49
50
  def self.remote_video_file_list
50
51
  %x[ssh -q #{@config[:remote_user]}@#{@config[:remote_host]} "cd #{@config[:remote_base_dir]} && find . -type f \\( -iname \'*.avi\' -or -iname \'*.mkv\' -or -iname \'*.mp4\' -or -iname \'*.m4v\' -or -iname \'*.divx\' \\)"]
51
52
  end
@@ -79,6 +80,7 @@ module Blitzcrank
79
80
  Blitzcrank.transfer_files(filesToTransfer)
80
81
  end
81
82
 
83
+ # copies all files if they find a matching local directory
82
84
  def self.rsync_all_files
83
85
  puts "Downloading all remote videos\n"
84
86
  fileArray = Blitzcrank.remote_video_file_list.gsub('./','').split("\n")
@@ -92,7 +94,6 @@ module Blitzcrank
92
94
  # any files (hashes) passed into here will be checked against our local TV folders and IMDB to see if it's a movie
93
95
  def self.transfer_files(filesToTransfer)
94
96
  Dir.chdir(@config[:base_tv_dir])
95
- tv_directories = Dir.glob("*/")
96
97
 
97
98
  filesToTransfer.each do |dh|
98
99
  Dir.chdir(@config[:base_tv_dir])
@@ -111,6 +112,7 @@ module Blitzcrank
111
112
  end
112
113
  end
113
114
 
115
+ # pulls the season number froma file
114
116
  def self.season(file_name)
115
117
  /s?(\d{2})e?\d{2}/i.match(file_name)
116
118
  $1.gsub(/\A0+/, '')
@@ -125,7 +127,7 @@ module Blitzcrank
125
127
  word.capitalize!
126
128
  end
127
129
  end
128
- wordsInShowName.join(" ")
130
+ wordsInShowName.join(" ").gsub!(/\b(us|uk)$/i, '(\1)') # adding parens around US/UK marked shows
129
131
  else
130
132
  file_name
131
133
  end
@@ -142,6 +144,7 @@ module Blitzcrank
142
144
  end
143
145
  end
144
146
 
147
+ # runs the interactive transfer menu, returns an array of files to download
145
148
  def self.transfer_menu(files)
146
149
  filesToTransfer = Array.new
147
150
  begin
@@ -1,3 +1,3 @@
1
1
  module Blitzcrank
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blitzcrank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyro2927
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-29 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler