dexter 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/features/dexter_organises_series.feature +10 -0
- data/lib/dexter.rb +2 -1
- data/lib/dexter/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -14,6 +14,16 @@ Feature: Dexter organises series
|
|
14
14
|
Then the following directories should exist:
|
15
15
|
| Video/Dexter/S01 |
|
16
16
|
|
17
|
+
@announce
|
18
|
+
Scenario: Dexter tries to move a file that's already organized
|
19
|
+
Given a directory named "Dexter/S01"
|
20
|
+
And an empty file named "Dexter/Dexter S01E01.avi"
|
21
|
+
When I run "dexter"
|
22
|
+
Then the following directories should exist:
|
23
|
+
| Dexter/S01 |
|
24
|
+
And the following files should exist:
|
25
|
+
| Dexter/S01/Dexter S01E01.avi |
|
26
|
+
|
17
27
|
@announce
|
18
28
|
Scenario: Dexter organises using a custom format
|
19
29
|
Given a directory named "Downloads"
|
data/lib/dexter.rb
CHANGED
@@ -130,8 +130,9 @@ module Dexter
|
|
130
130
|
|
131
131
|
def organize!(path)
|
132
132
|
output_path = File.dirname(output(path))
|
133
|
+
output_file = output(path)
|
133
134
|
FileUtils.mkdir_p(output_path)
|
134
|
-
FileUtils.mv(@filename, output(path))
|
135
|
+
FileUtils.mv(@filename, output_file) unless File.expand_path(@filename) == File.expand_path(output(path))
|
135
136
|
return output(path)
|
136
137
|
end
|
137
138
|
|
data/lib/dexter/version.rb
CHANGED