cnc 0.1.9 → 0.1.10
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 +4 -4
- data/lib/cnc/core_ext/uri.rb +23 -0
- data/lib/cnc/version.rb +1 -1
- metadata +16 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6706e3ee380e33d2ccf32c2c200e8dbdf5ea5189d35257dead75ddd7c849af9
|
|
4
|
+
data.tar.gz: 1ac76ab138162a2acc1102574ede700a85d79d3d251d75555b6beff53cc703ea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bcabd1a6ad9a92c2f69e188000ea9eba92f218338e78c98beddc6bc4d5cbf3fd8b9417b6db79831e143993bacb72343d7b17c2fa4ac9655323cda3d084d1cf8
|
|
7
|
+
data.tar.gz: b87998ee93a6a7fa66197de3961ccad8af65e36f5352cd934acfb1ba184d1776dc0f0c462040e8beb38552ee1aa6b655cf5c0f839e01177a656ada8652a7c4cf
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require "uri"
|
|
2
|
+
require "rack"
|
|
3
|
+
|
|
4
|
+
class URI::Generic
|
|
5
|
+
def params
|
|
6
|
+
Rack::Utils.parse_query(query)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
# Returns true if this URI is the same or less specific than `oth` URI.
|
|
10
|
+
def <=(oth)
|
|
11
|
+
oth = URI(oth)
|
|
12
|
+
oth.path.start_with?(path) && params <= oth.params
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Returns true if `oth` URI is the same or less specific than itself.
|
|
16
|
+
def >=(oth)
|
|
17
|
+
oth = URI(oth)
|
|
18
|
+
path.start_with?(oth.path) && params >= oth.params
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def >(oth) = URI(oth) <= self
|
|
22
|
+
def <(oth) = URI(oth) >= self
|
|
23
|
+
end
|
data/lib/cnc/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cnc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeff Peterson
|
|
@@ -65,6 +65,20 @@ dependencies:
|
|
|
65
65
|
- - ">="
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: '0'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: rack
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0'
|
|
75
|
+
type: :runtime
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '0'
|
|
68
82
|
- !ruby/object:Gem::Dependency
|
|
69
83
|
name: listen
|
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -126,6 +140,7 @@ files:
|
|
|
126
140
|
- lib/cnc/core_ext/module.rb
|
|
127
141
|
- lib/cnc/core_ext/object.rb
|
|
128
142
|
- lib/cnc/core_ext/symbol.rb
|
|
143
|
+
- lib/cnc/core_ext/uri.rb
|
|
129
144
|
- lib/cnc/migrator.rb
|
|
130
145
|
- lib/cnc/version.rb
|
|
131
146
|
- lib/tasks/cnc_tasks.rake
|