downloads_sorter 0.0.1 → 0.0.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: 83fda5b9acf3a03419dc03f3fb96e5611722cae6
4
- data.tar.gz: d863f259b8b81d4c14f1afb3273fbf563668174b
3
+ metadata.gz: 88676a8201e39b9211c483c4c2f1e16be6764ba8
4
+ data.tar.gz: 33091d22e15617312bdb0603b64c7e8fcc2f4a5f
5
5
  SHA512:
6
- metadata.gz: a0343432f570685f5cc6d49f69f9ac9e737f5f6a2af32ac3ff2c83b4c31f52ce51d9d3f0684691d2c99ad58efa0394ea4c780f0c941a703cfa1e9751da72f14f
7
- data.tar.gz: a5e6bbd229a3e0b066c7c37d6b3ea3d9406842f271c9cb75645236c9db63ac26e453caebf9229b0c93345ce32a229980638fe5755f98a741a7f43eac5b9f0b65
6
+ metadata.gz: 306cf80dbe15470ea6fdc8d1b9ed81302a8537d2058163054158550fdbbb25d015a969f75ad28d286c50bf527d2e0affab52d461a56a52c443f79fbb0bb14162
7
+ data.tar.gz: 64ac116f2ff6bfc00c161525dd22458e9c573b8d8d8622fb1c60f5b4bc04ef3ae30fc5b438f9d9c245946095f7c220aea5a6517351c7f8208d6a0cb99f540a52
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'downloads_sorter/version'
4
+ require "downloads_sorter"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "downloads_sorter"
@@ -2,14 +2,15 @@ require 'fileutils'
2
2
  class NoPathError < Exception; end;
3
3
 
4
4
  class DownloadsSorter
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
  PATH = File.join(Dir.home, "Downloads")
7
7
  Images = %w{ *.jpg *.png *.jpeg}
8
8
  Documents = %w{ *.pdf *.doc *.docx *.txt}
9
9
  Audio = %w{ *.mp3 }
10
10
  Books = %w{ *.epub }
11
11
  Apps = %w{ *.dmg }
12
- SUB_DIRS = %w{ Images Documents Audio Books Apps}
12
+ Archives = %w{ .zip .tar .gzip}
13
+ SUB_DIRS = %w{ Images Documents Audio Books Apps Archives}
13
14
 
14
15
 
15
16
  attr_reader :dir_path
@@ -15,15 +15,15 @@ class DownloadsSorterTest < MiniTest::Test
15
15
 
16
16
  def teardown
17
17
  Dir.chdir(TEST_PATH) do
18
- `rm -rf Images` if Dir.exists?('Images')
19
- `rm -rf Documents` if Dir.exists?('Documents')
20
- `rm -rf Audio` if Dir.exists?('Audio')
18
+ DownloadsSorter::SUB_DIRS.each do |dir|
19
+ `rm -rf #{dir}` if Dir.exists?(dir)
20
+ end
21
21
  end
22
22
  end
23
23
 
24
24
  def seed_folder
25
25
  Dir.chdir(TEST_PATH) do
26
- %w{ file1.png file2.pdf file3.jpeg file4.txt file5.docx file6.xlsx file7.csv file.dump file.mp3 file.mp4 }.each do |file|
26
+ %w{ file1.png file2.pdf file3.jpeg file4.txt file5.docx file6.xlsx file7.csv file.dump file.mp3 file.mp4 test.zip }.each do |file|
27
27
  File.new(file, 'w+')
28
28
  end
29
29
  end
@@ -43,6 +43,7 @@ class DownloadsSorterTest < MiniTest::Test
43
43
  ds.sort
44
44
  assert(true, File.exists?("tmp/Downloads/Images/file1.png"))
45
45
  assert(true, File.exists?("tmp/Downloads/Documents/file5.docx"))
46
+ assert(true, File.exists?("tmp/Downloads/Archives/test.zip"))
46
47
  Dir.chdir(TEST_PATH) do
47
48
  assert(1, Dir.glob("*").count)
48
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: downloads_sorter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kavinder Dhaliwal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-12 00:00:00.000000000 Z
11
+ date: 2015-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,7 +54,6 @@ files:
54
54
  - bin/dl_sort
55
55
  - downloads_sorter.gemspec
56
56
  - lib/downloads_sorter.rb
57
- - lib/downloads_sorter/version.rb
58
57
  - test/download_sorter_test.rb
59
58
  homepage: ''
60
59
  licenses:
@@ -1,3 +0,0 @@
1
- module DownloadsSorter
2
- VERSION = "0.0.1"
3
- end