toreriklinnerud-dated_backup 0.2.3 → 0.2.4
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.
@@ -9,7 +9,7 @@ module DatedBackup
|
|
9
9
|
# and return these Directories as a BackupSet
|
10
10
|
def find_files_in_directory(dir)
|
11
11
|
raise InvalidDirectoryError, "A valid directory must be given." unless File.directory?(dir)
|
12
|
-
new(Dir.glob("#{dir}
|
12
|
+
new(Dir.glob("#{dir}/*-*-*-*h-*m-*s"))
|
13
13
|
end
|
14
14
|
|
15
15
|
# Creates the boolean include_*? methods (include_month?, include_year? and so on).
|
@@ -12,10 +12,10 @@ class String
|
|
12
12
|
time_array = $1.gsub(/h|m|s/, '').split '-'
|
13
13
|
Time.gm(*time_array)
|
14
14
|
rescue
|
15
|
-
raise StringToTimeConversionError, "The string cannot be a converted to a valid time (it is out of range)"
|
15
|
+
raise StringToTimeConversionError, "The string '#{self}' cannot be a converted to a valid time (it is out of range)"
|
16
16
|
end
|
17
17
|
else
|
18
|
-
raise StringToTimeConversionError, "The string cannot be converted to a time object"
|
18
|
+
raise StringToTimeConversionError, "The string '#{self}' cannot be converted to a time object"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|