file_police 0.0.1 → 0.1.0
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 +8 -8
- data/lib/file_police/backlog_file.rb +2 -2
- data/lib/file_police/version.rb +1 -1
- data/spec/backlog_file_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzM4MDRiMDMzZGY0Yjk5ODgzNGEzN2FjOGM0ODAxMWE3MWM1MDMwMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDc1MWU0NDgyYzhjMTA3YTE5YmFjZjM3NjkwNDg4NmU4NWQ5ZmVmNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGI4YzQwM2NkYTg4OWFmZTA3ZTk5OWUyYTllOTJiNTQzYmRhODVmZWRhMzA0
|
10
|
+
MWRjMjc5NzllMzFmMmUzYjhiOWMzNGU4NGJkOGI4YjZiZWJhYWExYTQ2YjM4
|
11
|
+
MGVhM2MzNjE2ZDNjMTFmZTVkNmY3MTM2OTI3NDNhNGVmYzA0NGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDY2YWRkODliYWY1YzFhYTAyYTg4Nzc2NjI5OTJlN2M1YTViMGUxNzM1ZTVj
|
14
|
+
ZDQwZGY4MTcxNzVlOWYxYzM3MDE3NjlkZDJlMDBjMTMzNjc5MjJlNTg3ZTQx
|
15
|
+
Y2UzZDEyMWY0NTQxZmQ4ZTZjODU5ZDE3N2E0OWQ0ZTc3ZWIyYWI=
|
@@ -34,7 +34,7 @@ class FilePolice::BacklogFile
|
|
34
34
|
|
35
35
|
# Should match strings like BX1
|
36
36
|
def validate_box box = String.new
|
37
|
-
self.errors << "#{box} does not match BX# format" unless box.match(/^
|
37
|
+
self.errors << "#{box} does not match BX# format" unless box.match(/^[A-Z]{2,2}[0-9]{1,3}$/)
|
38
38
|
self.box = box
|
39
39
|
end
|
40
40
|
|
@@ -46,7 +46,7 @@ class FilePolice::BacklogFile
|
|
46
46
|
|
47
47
|
# Sould be numbers only
|
48
48
|
def validate_number number = String.new
|
49
|
-
self.errors << "#{number} does not match number format" unless number.match(/^[0-9]{1,4}$/)
|
49
|
+
self.errors << "#{number} does not match number format" unless number.match(/^[0-9]{1,4}[a-z]{0,1}$/)
|
50
50
|
self.number = number
|
51
51
|
end
|
52
52
|
|
data/lib/file_police/version.rb
CHANGED
data/spec/backlog_file_spec.rb
CHANGED
@@ -32,6 +32,14 @@ describe FilePolice::BacklogFile do
|
|
32
32
|
@sample.number.should == "001"
|
33
33
|
end
|
34
34
|
|
35
|
+
it "can have numbers at the end" do
|
36
|
+
FilePolice::BacklogFile.new("ARC0001_BX1_FL1_name_001b.tif").errors.should be_empty
|
37
|
+
end
|
38
|
+
|
39
|
+
it "can have OS instead of BX" do
|
40
|
+
FilePolice::BacklogFile.new("ARC0001_OS1_FL1_name_001.tif").errors.should be_empty
|
41
|
+
end
|
42
|
+
|
35
43
|
end
|
36
44
|
|
37
45
|
describe "an invalid filename" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_police
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Wead
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|