versioned_blocks 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/versioned_blocks.rb +8 -5
- data/spec/versioned_blocks_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTQwZGMyMzIyNTZmOGNkZWVjYmU0ZWE2YWY2MmJhZGU3NzRhMGJjYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTI2NTgyMWM4NDUzMDdjMzIxNTU1NmRhY2U1YTg4MWE3NGY1YTI1Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGNjZTgzNWRjN2Q2ZTEyYTE0YTdmNjRiOWFkZTMyYTM3MzViYTMyNDM1NjQ0
|
10
|
+
ZTI0MDdiMjIwMDk0MTU1ZTEzOGNiMTRmOTE4MzNlNmQ3MGUyNDhhYzRmODky
|
11
|
+
YjJiZWQ4MWJmNTBhYjhjYjNkMmE5MjA0MDFiODhjYjlkNDI3MmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmY1NTU1YTk4YThhYTljMWExMDJjYWM4NjBiNjhiYjE4NTk0NWEyZTBlYzNh
|
14
|
+
YzYxOWM5OTY4ODc3MzQxM2M4YzYxNTgwMDhjNWFmZDM4YWU5NmE5NjYwZWU2
|
15
|
+
ZDc3YjY2ZjBjMzBjN2I4MjUwMTliNTc0NzA3ZWNkMzU2Zjg0OTg=
|
data/lib/versioned_blocks.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class VersionedBlocks
|
2
|
-
VERSION = "1.0.
|
2
|
+
VERSION = "1.0.3"
|
3
3
|
|
4
4
|
class << self
|
5
5
|
attr_accessor :versions, :base_uri, :prepend_errors
|
@@ -40,9 +40,9 @@ class VersionedBlocks
|
|
40
40
|
# or reset the default versioning with:
|
41
41
|
# VersionedRetry.reset
|
42
42
|
opts = opts_specify_a_version?(opts) || (opts[:override]==true && opts_specify_a_version?(opts)) ? opts : self.versions
|
43
|
-
|
43
|
+
raise VersionedBlocksException, "No versions specified!" if opts == {} || !opts_specify_a_version?(opts)
|
44
44
|
if opts[:from].is_a?(Integer) && opts[:to].is_a?(Integer) # from vX to vY
|
45
|
-
raise "Expected :from (#{opts[:from]}) to be less than :to (#{opts[:to]})" if opts[:from] > opts[:to]
|
45
|
+
raise VersionedBlocksException, "Expected :from (#{opts[:from]}) to be less than :to (#{opts[:to]})" if opts[:from] > opts[:to]
|
46
46
|
versions_to_test = (opts[:from]..opts[:to])
|
47
47
|
else
|
48
48
|
if opts[:to].is_a?(Integer) # up to vX
|
@@ -53,10 +53,10 @@ class VersionedBlocks
|
|
53
53
|
if opts[:these].all?{|n| n.is_a?(Integer)}
|
54
54
|
versions_to_test = opts[:these]
|
55
55
|
else
|
56
|
-
raise "Each element in :these must be an integer"
|
56
|
+
raise VersionedBlocksException, "Each element in :these must be an integer"
|
57
57
|
end
|
58
58
|
else
|
59
|
-
raise "Couldn't determine which versions to test!\nUse :only, :these, :to, or :from and :to"
|
59
|
+
raise VersionedBlocksException, "Couldn't determine which versions to test!\nUse :only, :these, :to, or :from and :to"
|
60
60
|
end
|
61
61
|
end
|
62
62
|
versions_to_test
|
@@ -84,4 +84,7 @@ module Kernel
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
87
|
+
end
|
88
|
+
|
89
|
+
class VersionedBlocksException < Exception
|
87
90
|
end
|