cuba 3.8.1 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +8 -0
  3. data/cuba.gemspec +1 -1
  4. data/lib/cuba.rb +2 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6428d24a19fc99881ffad1b18f7757fe6c3656d8
4
- data.tar.gz: 22adf9cf4289ff9976cb364a3c4b9795e7225015
3
+ metadata.gz: 7a0f252d0cdb3d4dc2a109fbf9c23b79d5b9a25a
4
+ data.tar.gz: 174baccd84a96ae2f0844decaa081b72ff1633cc
5
5
  SHA512:
6
- metadata.gz: 27074004e24756499709bd7c6272e54e2d4c60e6ced2831f893872a514a8ef85d2d91f6c5a4eb70f39565f5059be84e407ffb45a82e66244e3b9521c3c219ae8
7
- data.tar.gz: c4e893414f0cfa688a583bccf516e646514ae635cb37ee79a74f3b2bbd48eb886623a8447eab39f2840057bb5706676d9c302ca896f98b6d50c844df344b670b
6
+ metadata.gz: 821b6dfa92e9c2a5ae19953e44823b2de138521a2cd722b48b4ed6c0e3900a29027f32cc38e84c90f9add8752e908b05460782b21cfbc9e0b5780a3e307667f0
7
+ data.tar.gz: 4d3ca82b85b09f7257e993fd8f3eb1ef59a69c5a42993646c468bc0c831c6429934de245addcbe7d643cd3be22f247f8cf30be726dd2a630aeb8a22edfde51af
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ 3.9.0
2
+
3
+ * Cache regular expressions
4
+
5
+ 3.8.1
6
+
7
+ * Remove requirement on Time
8
+
1
9
  3.8.0
2
10
 
3
11
  * Change gemspec to allow Rack 2.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cuba"
3
- s.version = "3.8.1"
3
+ s.version = "3.9.0"
4
4
  s.summary = "Microframework for web applications."
5
5
  s.description = "Cuba is a microframework for web applications."
6
6
  s.authors = ["Michel Martens"]
@@ -5,6 +5,7 @@ class Cuba
5
5
  EMPTY = "".freeze
6
6
  SEGMENT = "([^\\/]+)".freeze
7
7
  DEFAULT = "text/html; charset=utf-8".freeze
8
+ REGEXES = Hash.new { |h, pattern| h[pattern] = /\A\/(#{pattern})(\/|\z)/ }
8
9
 
9
10
  class Response
10
11
  LOCATION = "Location".freeze
@@ -211,7 +212,7 @@ class Cuba
211
212
  private :try
212
213
 
213
214
  def consume(pattern)
214
- matchdata = env[Rack::PATH_INFO].match(/\A\/(#{pattern})(\/|\z)/)
215
+ matchdata = env[Rack::PATH_INFO].match(REGEXES[pattern])
215
216
 
216
217
  return false unless matchdata
217
218
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuba
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.1
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Martens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-30 00:00:00.000000000 Z
11
+ date: 2017-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack