file_police 0.1.1 → 0.1.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 +8 -8
- data/.gitignore +1 -0
- data/lib/file_police/backlog_file.rb +3 -3
- data/lib/file_police/version.rb +1 -1
- data/spec/backlog_file_spec.rb +2 -2
- metadata +1 -2
- data/Gemfile.lock +0 -27
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDNjY2Q3NGRiODViMDdiMzcwNmVmZDhkNWY0OTRlNzhlNGNjYjExYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzA5N2MxNzM4ZDAyMmQzMmQ0NWRmNzU0M2Y2OTYxYjFkYmVkOGNmNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjkwN2JlMzBmNzY2NDZmMTczYTA5ZDY5NjBmYzdiZDk1MzBjOTRjYzM5ZmNm
|
10
|
+
NjdjYTVkZGZiZGJjNWZhM2YxMTdjNmRlYWU1ZjY4ZmE4MWQ5ODhmOTIxM2Qy
|
11
|
+
NTVhNWQ3MTI0ZjdlMzU4MWVlNDJlOTE0ZjVjZjFmMzQ5ZGZlMjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjVhZmViMGRjZTRiYjY5YzJkMjIyNzM0ZjNlN2NmYmI0MzAwOTI3YTMzMmRk
|
14
|
+
YWQxZWZiZjMyNjkwZTU3Yzg5M2NlOWViZmExOGMzNmE4N2U4NTU2Yzg2NTM1
|
15
|
+
OTVmZjVmY2EyNGVjYzlkNDdjMGIzYjM2NTczNjI1ZmEwNmM2YzM=
|
data/.gitignore
CHANGED
@@ -34,19 +34,19 @@ 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
|
37
|
+
self.errors << "#{box} does not have the correct format" unless box.match(/^[A-Z]{2,2}[0-9]{1,3}$/)
|
38
38
|
self.box = box
|
39
39
|
end
|
40
40
|
|
41
41
|
# Should match strings like FL1, OS2, or FL22b
|
42
42
|
def validate_folder folder = String.new
|
43
|
-
self.errors << "#{folder} does not
|
43
|
+
self.errors << "#{folder} does not have the correct format" unless folder.match(/^[A-Z]{2,2}[0-9]{1,3}[a-z]{0,1}$/)
|
44
44
|
self.folder = folder
|
45
45
|
end
|
46
46
|
|
47
47
|
# Sould be numbers only
|
48
48
|
def validate_number number = String.new
|
49
|
-
self.errors << "#{number} does not
|
49
|
+
self.errors << "#{number} does not have the correct 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
@@ -67,12 +67,12 @@ describe FilePolice::BacklogFile do
|
|
67
67
|
|
68
68
|
it "has an incorrect box" do
|
69
69
|
invalid = FilePolice::BacklogFile.new("ARC0001_box2_FL4_name_001.tif")
|
70
|
-
invalid.errors.should include "box2 does not
|
70
|
+
invalid.errors.should include "box2 does not have the correct format"
|
71
71
|
end
|
72
72
|
|
73
73
|
it "has an incorrect folder" do
|
74
74
|
invalid = FilePolice::BacklogFile.new("ARC0001_BX1_folder3_name_001.tif")
|
75
|
-
invalid.errors.should include "folder3 does not
|
75
|
+
invalid.errors.should include "folder3 does not have the correct format"
|
76
76
|
end
|
77
77
|
|
78
78
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_police
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Wead
|
@@ -62,7 +62,6 @@ files:
|
|
62
62
|
- .gitignore
|
63
63
|
- .rspec
|
64
64
|
- Gemfile
|
65
|
-
- Gemfile.lock
|
66
65
|
- LICENSE.txt
|
67
66
|
- README.md
|
68
67
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
file_police (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.2.4)
|
10
|
-
rake (10.1.0)
|
11
|
-
rspec (2.13.0)
|
12
|
-
rspec-core (~> 2.13.0)
|
13
|
-
rspec-expectations (~> 2.13.0)
|
14
|
-
rspec-mocks (~> 2.13.0)
|
15
|
-
rspec-core (2.13.1)
|
16
|
-
rspec-expectations (2.13.0)
|
17
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
18
|
-
rspec-mocks (2.13.1)
|
19
|
-
|
20
|
-
PLATFORMS
|
21
|
-
ruby
|
22
|
-
|
23
|
-
DEPENDENCIES
|
24
|
-
bundler (~> 1.3)
|
25
|
-
file_police!
|
26
|
-
rake
|
27
|
-
rspec
|