mustermann 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -6
- data/README.md +247 -10
- data/lib/mustermann.rb +13 -5
- data/lib/mustermann/ast/expander.rb +15 -0
- data/lib/mustermann/ast/pattern.rb +2 -3
- data/lib/mustermann/expander.rb +39 -4
- data/lib/mustermann/mapper.rb +94 -0
- data/lib/mustermann/pattern.rb +3 -3
- data/lib/mustermann/regular.rb +26 -0
- data/lib/mustermann/router/rack.rb +2 -2
- data/lib/mustermann/router/simple.rb +1 -1
- data/lib/mustermann/sinatra.rb +1 -1
- data/lib/mustermann/to_pattern.rb +45 -0
- data/lib/mustermann/version.rb +1 -1
- data/mustermann.gemspec +3 -1
- data/spec/expander_spec.rb +28 -0
- data/spec/mapper_spec.rb +83 -0
- data/spec/mustermann_spec.rb +30 -10
- data/spec/pattern_spec.rb +27 -4
- data/spec/regexp_based_spec.rb +1 -1
- data/spec/regular_spec.rb +36 -0
- data/spec/router/rack_spec.rb +1 -1
- data/spec/router/simple_spec.rb +9 -7
- data/spec/shell_spec.rb +1 -1
- data/spec/simple_match_spec.rb +1 -1
- data/spec/sinatra_spec.rb +13 -0
- data/spec/support/env.rb +11 -1
- data/spec/support/expand_matcher.rb +2 -2
- data/spec/support/match_matcher.rb +2 -2
- data/spec/support/pattern.rb +6 -2
- data/spec/to_pattern_spec.rb +20 -0
- metadata +64 -28
- data/lib/mustermann/equality_map.rb +0 -46
data/spec/mustermann_spec.rb
CHANGED
@@ -5,16 +5,36 @@ require 'sinatra/base'
|
|
5
5
|
|
6
6
|
describe Mustermann do
|
7
7
|
describe :new do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
context "string argument" do
|
9
|
+
example { Mustermann.new('') .should be_a(Mustermann::Sinatra) }
|
10
|
+
example { Mustermann.new('', type: :identity) .should be_a(Mustermann::Identity) }
|
11
|
+
example { Mustermann.new('', type: :rails) .should be_a(Mustermann::Rails) }
|
12
|
+
example { Mustermann.new('', type: :shell) .should be_a(Mustermann::Shell) }
|
13
|
+
example { Mustermann.new('', type: :sinatra) .should be_a(Mustermann::Sinatra) }
|
14
|
+
example { Mustermann.new('', type: :simple) .should be_a(Mustermann::Simple) }
|
15
|
+
example { Mustermann.new('', type: :template) .should be_a(Mustermann::Template) }
|
16
|
+
|
17
|
+
example { expect { Mustermann.new('', foo: :bar) }.to raise_error(ArgumentError, "unsupported option :foo for Mustermann::Sinatra") }
|
18
|
+
example { expect { Mustermann.new('', type: :ast) }.to raise_error(ArgumentError, "unsupported type :ast") }
|
19
|
+
end
|
20
|
+
|
21
|
+
context "pattern argument" do
|
22
|
+
subject(:pattern) { Mustermann.new('') }
|
23
|
+
example { Mustermann.new(pattern).should be == pattern }
|
24
|
+
example { Mustermann.new(pattern, type: :rails).should be_a(Mustermann::Sinatra) }
|
25
|
+
end
|
26
|
+
|
27
|
+
context "regexp argument" do
|
28
|
+
example { Mustermann.new(//) .should be_a(Mustermann::Regular) }
|
29
|
+
example { Mustermann.new(//, type: :rails) .should be_a(Mustermann::Regular) }
|
30
|
+
end
|
31
|
+
|
32
|
+
context "argument implementing #to_pattern" do
|
33
|
+
subject(:pattern) { Class.new { def to_pattern(**o) Mustermann.new('foo', **o) end }.new }
|
34
|
+
example { Mustermann.new(pattern) .should be_a(Mustermann::Sinatra) }
|
35
|
+
example { Mustermann.new(pattern, type: :rails) .should be_a(Mustermann::Rails) }
|
36
|
+
example { Mustermann.new(pattern).to_s.should be == 'foo' }
|
37
|
+
end
|
18
38
|
end
|
19
39
|
|
20
40
|
describe :[] do
|
data/spec/pattern_spec.rb
CHANGED
@@ -1,26 +1,49 @@
|
|
1
1
|
require 'support'
|
2
2
|
require 'mustermann/pattern'
|
3
|
+
require 'mustermann/sinatra'
|
4
|
+
require 'mustermann/rails'
|
3
5
|
|
4
6
|
describe Mustermann::Pattern do
|
5
7
|
describe :=== do
|
6
8
|
it 'raises a NotImplementedError when used directly' do
|
7
|
-
expect {
|
9
|
+
expect { Mustermann::Pattern.new("") === "" }.to raise_error(NotImplementedError)
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
11
13
|
describe :initialize do
|
12
14
|
it 'raises an ArgumentError for unknown options' do
|
13
|
-
expect {
|
15
|
+
expect { Mustermann::Pattern.new("", foo: :bar) }.to raise_error(ArgumentError)
|
14
16
|
end
|
15
17
|
|
16
18
|
it 'does not complain about unknown options if ignore_unknown_options is enabled' do
|
17
|
-
expect {
|
19
|
+
expect { Mustermann::Pattern.new("", foo: :bar, ignore_unknown_options: true) }.not_to raise_error
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
21
23
|
describe :expand do
|
22
|
-
subject(:pattern) {
|
24
|
+
subject(:pattern) { Mustermann::Pattern.new("") }
|
23
25
|
it { should_not respond_to(:expand) }
|
24
26
|
it { expect { pattern.expand }.to raise_error(NotImplementedError) }
|
25
27
|
end
|
28
|
+
|
29
|
+
describe :== do
|
30
|
+
example { Mustermann::Pattern.new('/foo') .should be == Mustermann::Pattern.new('/foo') }
|
31
|
+
example { Mustermann::Pattern.new('/foo') .should_not be == Mustermann::Pattern.new('/bar') }
|
32
|
+
example { Mustermann::Sinatra.new('/foo') .should be == Mustermann::Sinatra.new('/foo') }
|
33
|
+
example { Mustermann::Rails.new('/foo') .should_not be == Mustermann::Sinatra.new('/foo') }
|
34
|
+
end
|
35
|
+
|
36
|
+
describe :eql? do
|
37
|
+
example { Mustermann::Pattern.new('/foo') .should be_eql Mustermann::Pattern.new('/foo') }
|
38
|
+
example { Mustermann::Pattern.new('/foo') .should_not be_eql Mustermann::Pattern.new('/bar') }
|
39
|
+
example { Mustermann::Sinatra.new('/foo') .should be_eql Mustermann::Sinatra.new('/foo') }
|
40
|
+
example { Mustermann::Rails.new('/foo') .should_not be_eql Mustermann::Sinatra.new('/foo') }
|
41
|
+
end
|
42
|
+
|
43
|
+
describe :equal? do
|
44
|
+
example { Mustermann::Pattern.new('/foo') .should be_equal Mustermann::Pattern.new('/foo') }
|
45
|
+
example { Mustermann::Pattern.new('/foo') .should_not be_equal Mustermann::Pattern.new('/bar') }
|
46
|
+
example { Mustermann::Sinatra.new('/foo') .should be_equal Mustermann::Sinatra.new('/foo') }
|
47
|
+
example { Mustermann::Rails.new('/foo') .should_not be_equal Mustermann::Sinatra.new('/foo') }
|
48
|
+
end
|
26
49
|
end
|
data/spec/regexp_based_spec.rb
CHANGED
@@ -3,6 +3,6 @@ require 'mustermann/regexp_based'
|
|
3
3
|
|
4
4
|
describe Mustermann::RegexpBased do
|
5
5
|
it 'raises a NotImplementedError when used directly' do
|
6
|
-
expect {
|
6
|
+
expect { Mustermann::RegexpBased.new("") === "" }.to raise_error(NotImplementedError)
|
7
7
|
end
|
8
8
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'support'
|
2
|
+
require 'mustermann/regular'
|
3
|
+
|
4
|
+
describe Mustermann::Regular do
|
5
|
+
extend Support::Pattern
|
6
|
+
|
7
|
+
pattern '' do
|
8
|
+
it { should match('') }
|
9
|
+
it { should_not match('/') }
|
10
|
+
end
|
11
|
+
|
12
|
+
pattern '/' do
|
13
|
+
it { should match('/') }
|
14
|
+
it { should_not match('/foo') }
|
15
|
+
end
|
16
|
+
|
17
|
+
pattern '/foo' do
|
18
|
+
it { should match('/foo') }
|
19
|
+
it { should_not match('/bar') }
|
20
|
+
it { should_not match('/foo.bar') }
|
21
|
+
end
|
22
|
+
|
23
|
+
pattern '/foo/bar' do
|
24
|
+
it { should match('/foo/bar') }
|
25
|
+
it { should_not match('/foo%2Fbar') }
|
26
|
+
it { should_not match('/foo%2fbar') }
|
27
|
+
end
|
28
|
+
|
29
|
+
pattern '/(?<foo>.*)' do
|
30
|
+
it { should match('/foo') .capturing foo: 'foo' }
|
31
|
+
it { should match('/bar') .capturing foo: 'bar' }
|
32
|
+
it { should match('/foo.bar') .capturing foo: 'foo.bar' }
|
33
|
+
it { should match('/%0Afoo') .capturing foo: '%0Afoo' }
|
34
|
+
it { should match('/foo%2Fbar') .capturing foo: 'foo%2Fbar' }
|
35
|
+
end
|
36
|
+
end
|
data/spec/router/rack_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'mustermann/router/rack'
|
|
2
2
|
|
3
3
|
describe Mustermann::Router::Rack do
|
4
4
|
include Rack::Test::Methods
|
5
|
-
subject(:app) {
|
5
|
+
subject(:app) { Mustermann::Router::Rack.new }
|
6
6
|
|
7
7
|
context 'matching' do
|
8
8
|
before { app.on('/foo') { [418, {'Content-Type' => 'text/plain'}, 'bar'] } }
|
data/spec/router/simple_spec.rb
CHANGED
@@ -3,28 +3,30 @@ require 'mustermann/router/simple'
|
|
3
3
|
describe Mustermann::Router::Simple do
|
4
4
|
describe :initialize do
|
5
5
|
context "with implicit receiver" do
|
6
|
-
subject(:router) {
|
6
|
+
subject(:router) { Mustermann::Router::Simple.new { on('/foo') { 'bar' } } }
|
7
7
|
example { router.call('/foo').should be == 'bar' }
|
8
8
|
end
|
9
9
|
|
10
10
|
context "with explicit receiver" do
|
11
|
-
subject(:router) {
|
11
|
+
subject(:router) { Mustermann::Router::Simple.new { |r| r.on('/foo') { 'bar' } } }
|
12
12
|
example { router.call('/foo').should be == 'bar' }
|
13
13
|
end
|
14
14
|
|
15
15
|
context "with default" do
|
16
|
-
subject(:router) {
|
16
|
+
subject(:router) { Mustermann::Router::Simple.new(default: 'bar') }
|
17
17
|
example { router.call('/foo').should be == 'bar' }
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
describe :[]= do
|
22
|
-
|
23
|
-
|
22
|
+
subject(:router) { Mustermann::Router::Simple.new }
|
23
|
+
before { router['/:name'] = proc { |*a| a } }
|
24
|
+
example { router.call('/foo').should be == ['/foo', "name" => 'foo'] }
|
24
25
|
end
|
25
26
|
|
26
27
|
describe :[] do
|
27
|
-
|
28
|
-
|
28
|
+
subject(:router) { Mustermann::Router::Simple.new }
|
29
|
+
before { router.on('/x') { 42 } }
|
30
|
+
example { router['/x'].call.should be == 42 }
|
29
31
|
end
|
30
32
|
end
|
data/spec/shell_spec.rb
CHANGED
data/spec/simple_match_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'support'
|
|
2
2
|
require 'mustermann/simple_match'
|
3
3
|
|
4
4
|
describe Mustermann::SimpleMatch do
|
5
|
-
subject {
|
5
|
+
subject { Mustermann::SimpleMatch.new('example') }
|
6
6
|
its(:to_s) { should be == 'example' }
|
7
7
|
its(:names) { should be == [] }
|
8
8
|
its(:captures) { should be == [] }
|
data/spec/sinatra_spec.rb
CHANGED
@@ -94,6 +94,19 @@ describe Mustermann::Sinatra do
|
|
94
94
|
example { pattern.params('/foo').should be == {"splat" => ["foo"]} }
|
95
95
|
end
|
96
96
|
|
97
|
+
pattern '/*foo' do
|
98
|
+
it { should match('/') .capturing foo: '' }
|
99
|
+
it { should match('/foo') .capturing foo: 'foo' }
|
100
|
+
it { should match('/foo/bar') .capturing foo: 'foo/bar' }
|
101
|
+
|
102
|
+
example { pattern.params('/foo') .should be == {"foo" => "foo" } }
|
103
|
+
example { pattern.params('/foo/bar') .should be == {"foo" => "foo/bar" } }
|
104
|
+
end
|
105
|
+
|
106
|
+
pattern '/*foo/*bar' do
|
107
|
+
it { should match('/foo/bar') .capturing foo: 'foo', bar: 'bar' }
|
108
|
+
end
|
109
|
+
|
97
110
|
pattern '/:foo/*' do
|
98
111
|
it { should match("/foo/bar/baz") .capturing foo: 'foo', splat: 'bar/baz' }
|
99
112
|
it { should match("/foo/") .capturing foo: 'foo', splat: '' }
|
data/spec/support/env.rb
CHANGED
@@ -3,4 +3,14 @@ if RUBY_VERSION < '2.0.0'
|
|
3
3
|
exit 1
|
4
4
|
end
|
5
5
|
|
6
|
-
ENV['RACK_ENV'] = 'test'
|
6
|
+
ENV['RACK_ENV'] = 'test'
|
7
|
+
|
8
|
+
require 'tool/warning_filter'
|
9
|
+
require 'rspec'
|
10
|
+
require 'rspec/its'
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.expect_with :rspec do |c|
|
14
|
+
c.syntax = [:should, :expect]
|
15
|
+
end
|
16
|
+
end
|
@@ -14,14 +14,14 @@ RSpec::Matchers.define :expand do |values = {}|
|
|
14
14
|
@string = string
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
failure_message do |pattern|
|
18
18
|
message = "expected %p to be expandable with %p" % [pattern, values]
|
19
19
|
expanded = pattern.expand(values)
|
20
20
|
message << " and result in %p, but got %p" % [@string, expanded] if @string
|
21
21
|
message
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
failure_message_when_negated do |pattern|
|
25
25
|
"expected %p not to be expandable with %p" % [pattern, values]
|
26
26
|
end
|
27
27
|
end
|
@@ -10,7 +10,7 @@ RSpec::Matchers.define :match do |expected|
|
|
10
10
|
@captures = captures
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
failure_message do |actual|
|
14
14
|
require 'pp'
|
15
15
|
match = actual.match(expected)
|
16
16
|
if match
|
@@ -31,7 +31,7 @@ RSpec::Matchers.define :match do |expected|
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
failure_message_when_negated do |actual|
|
35
35
|
"expected %p not to match %p" % [
|
36
36
|
actual.to_s, expected
|
37
37
|
]
|
data/spec/support/pattern.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
require 'timeout'
|
2
|
+
|
1
3
|
module Support
|
2
4
|
module Pattern
|
3
5
|
def pattern(pattern, options = nil, &block)
|
4
|
-
description
|
6
|
+
description = "pattern %p" % pattern
|
5
7
|
|
6
8
|
if options
|
7
9
|
description << " with options %p" % [options]
|
@@ -26,8 +28,10 @@ module Support
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def subject_for(pattern, *args)
|
29
|
-
instance = described_class.new(pattern, *args)
|
31
|
+
instance = Timeout.timeout(1) { described_class.new(pattern, *args) }
|
30
32
|
proc { instance }
|
33
|
+
rescue Timeout::Error => error
|
34
|
+
proc { raise Timeout::Error, "could not compile #{pattern.inspect} in time", error.backtrace }
|
31
35
|
rescue Exception => error
|
32
36
|
proc { raise error }
|
33
37
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'support'
|
2
|
+
require 'mustermann/to_pattern'
|
3
|
+
|
4
|
+
describe Mustermann::ToPattern do
|
5
|
+
context String do
|
6
|
+
example { "".to_pattern .should be_a(Mustermann::Sinatra) }
|
7
|
+
example { "".to_pattern(type: :rails) .should be_a(Mustermann::Rails) }
|
8
|
+
end
|
9
|
+
|
10
|
+
context Regexp do
|
11
|
+
example { //.to_pattern .should be_a(Mustermann::Regular) }
|
12
|
+
example { //.to_pattern(type: :rails) .should be_a(Mustermann::Regular) }
|
13
|
+
end
|
14
|
+
|
15
|
+
context Mustermann::Pattern do
|
16
|
+
subject(:pattern) { Mustermann.new('') }
|
17
|
+
example { pattern.to_pattern.should be == pattern }
|
18
|
+
example { pattern.to_pattern(type: :rails).should be_a(Mustermann::Sinatra) }
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,139 +1,167 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mustermann
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tool
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.2'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rspec
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
|
-
- -
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-its
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
18
46
|
- !ruby/object:Gem::Version
|
19
47
|
version: '0'
|
20
48
|
type: :development
|
21
49
|
prerelease: false
|
22
50
|
version_requirements: !ruby/object:Gem::Requirement
|
23
51
|
requirements:
|
24
|
-
- -
|
52
|
+
- - ">="
|
25
53
|
- !ruby/object:Gem::Version
|
26
54
|
version: '0'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: addressable
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
|
-
- -
|
59
|
+
- - ">="
|
32
60
|
- !ruby/object:Gem::Version
|
33
61
|
version: '0'
|
34
62
|
type: :development
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
|
-
- -
|
66
|
+
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
68
|
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: sinatra
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
|
-
- - ~>
|
73
|
+
- - "~>"
|
46
74
|
- !ruby/object:Gem::Version
|
47
75
|
version: '1.4'
|
48
76
|
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
|
-
- - ~>
|
80
|
+
- - "~>"
|
53
81
|
- !ruby/object:Gem::Version
|
54
82
|
version: '1.4'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: rack-test
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
58
86
|
requirements:
|
59
|
-
- -
|
87
|
+
- - ">="
|
60
88
|
- !ruby/object:Gem::Version
|
61
89
|
version: '0'
|
62
90
|
type: :development
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
|
-
- -
|
94
|
+
- - ">="
|
67
95
|
- !ruby/object:Gem::Version
|
68
96
|
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: rake
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
|
-
- -
|
101
|
+
- - ">="
|
74
102
|
- !ruby/object:Gem::Version
|
75
103
|
version: '0'
|
76
104
|
type: :development
|
77
105
|
prerelease: false
|
78
106
|
version_requirements: !ruby/object:Gem::Requirement
|
79
107
|
requirements:
|
80
|
-
- -
|
108
|
+
- - ">="
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: yard
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
86
114
|
requirements:
|
87
|
-
- -
|
115
|
+
- - ">="
|
88
116
|
- !ruby/object:Gem::Version
|
89
117
|
version: '0'
|
90
118
|
type: :development
|
91
119
|
prerelease: false
|
92
120
|
version_requirements: !ruby/object:Gem::Requirement
|
93
121
|
requirements:
|
94
|
-
- -
|
122
|
+
- - ">="
|
95
123
|
- !ruby/object:Gem::Version
|
96
124
|
version: '0'
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
126
|
name: redcarpet
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
100
128
|
requirements:
|
101
|
-
- -
|
129
|
+
- - ">="
|
102
130
|
- !ruby/object:Gem::Version
|
103
131
|
version: '0'
|
104
132
|
type: :development
|
105
133
|
prerelease: false
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
107
135
|
requirements:
|
108
|
-
- -
|
136
|
+
- - ">="
|
109
137
|
- !ruby/object:Gem::Version
|
110
138
|
version: '0'
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
140
|
name: simplecov
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
114
142
|
requirements:
|
115
|
-
- -
|
143
|
+
- - ">="
|
116
144
|
- !ruby/object:Gem::Version
|
117
145
|
version: '0'
|
118
146
|
type: :development
|
119
147
|
prerelease: false
|
120
148
|
version_requirements: !ruby/object:Gem::Requirement
|
121
149
|
requirements:
|
122
|
-
- -
|
150
|
+
- - ">="
|
123
151
|
- !ruby/object:Gem::Version
|
124
152
|
version: '0'
|
125
153
|
- !ruby/object:Gem::Dependency
|
126
154
|
name: coveralls
|
127
155
|
requirement: !ruby/object:Gem::Requirement
|
128
156
|
requirements:
|
129
|
-
- -
|
157
|
+
- - ">="
|
130
158
|
- !ruby/object:Gem::Version
|
131
159
|
version: '0'
|
132
160
|
type: :development
|
133
161
|
prerelease: false
|
134
162
|
version_requirements: !ruby/object:Gem::Requirement
|
135
163
|
requirements:
|
136
|
-
- -
|
164
|
+
- - ">="
|
137
165
|
- !ruby/object:Gem::Version
|
138
166
|
version: '0'
|
139
167
|
description: library implementing patterns that behave like regular expressions
|
@@ -144,10 +172,10 @@ extra_rdoc_files:
|
|
144
172
|
- README.md
|
145
173
|
- internals.md
|
146
174
|
files:
|
147
|
-
- .gitignore
|
148
|
-
- .rspec
|
149
|
-
- .travis.yml
|
150
|
-
- .yardopts
|
175
|
+
- ".gitignore"
|
176
|
+
- ".rspec"
|
177
|
+
- ".travis.yml"
|
178
|
+
- ".yardopts"
|
151
179
|
- Gemfile
|
152
180
|
- LICENSE
|
153
181
|
- README.md
|
@@ -168,14 +196,15 @@ files:
|
|
168
196
|
- lib/mustermann/ast/tree_renderer.rb
|
169
197
|
- lib/mustermann/ast/validation.rb
|
170
198
|
- lib/mustermann/caster.rb
|
171
|
-
- lib/mustermann/equality_map.rb
|
172
199
|
- lib/mustermann/error.rb
|
173
200
|
- lib/mustermann/expander.rb
|
174
201
|
- lib/mustermann/extension.rb
|
175
202
|
- lib/mustermann/identity.rb
|
203
|
+
- lib/mustermann/mapper.rb
|
176
204
|
- lib/mustermann/pattern.rb
|
177
205
|
- lib/mustermann/rails.rb
|
178
206
|
- lib/mustermann/regexp_based.rb
|
207
|
+
- lib/mustermann/regular.rb
|
179
208
|
- lib/mustermann/router.rb
|
180
209
|
- lib/mustermann/router/rack.rb
|
181
210
|
- lib/mustermann/router/simple.rb
|
@@ -184,15 +213,18 @@ files:
|
|
184
213
|
- lib/mustermann/simple_match.rb
|
185
214
|
- lib/mustermann/sinatra.rb
|
186
215
|
- lib/mustermann/template.rb
|
216
|
+
- lib/mustermann/to_pattern.rb
|
187
217
|
- lib/mustermann/version.rb
|
188
218
|
- mustermann.gemspec
|
189
219
|
- spec/expander_spec.rb
|
190
220
|
- spec/extension_spec.rb
|
191
221
|
- spec/identity_spec.rb
|
222
|
+
- spec/mapper_spec.rb
|
192
223
|
- spec/mustermann_spec.rb
|
193
224
|
- spec/pattern_spec.rb
|
194
225
|
- spec/rails_spec.rb
|
195
226
|
- spec/regexp_based_spec.rb
|
227
|
+
- spec/regular_spec.rb
|
196
228
|
- spec/router/rack_spec.rb
|
197
229
|
- spec/router/simple_spec.rb
|
198
230
|
- spec/shell_spec.rb
|
@@ -206,6 +238,7 @@ files:
|
|
206
238
|
- spec/support/match_matcher.rb
|
207
239
|
- spec/support/pattern.rb
|
208
240
|
- spec/template_spec.rb
|
241
|
+
- spec/to_pattern_spec.rb
|
209
242
|
homepage: https://github.com/rkh/mustermann
|
210
243
|
licenses:
|
211
244
|
- MIT
|
@@ -216,17 +249,17 @@ require_paths:
|
|
216
249
|
- lib
|
217
250
|
required_ruby_version: !ruby/object:Gem::Requirement
|
218
251
|
requirements:
|
219
|
-
- -
|
252
|
+
- - ">="
|
220
253
|
- !ruby/object:Gem::Version
|
221
254
|
version: 2.0.0
|
222
255
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
256
|
requirements:
|
224
|
-
- -
|
257
|
+
- - ">="
|
225
258
|
- !ruby/object:Gem::Version
|
226
259
|
version: '0'
|
227
260
|
requirements: []
|
228
261
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.
|
262
|
+
rubygems_version: 2.2.2
|
230
263
|
signing_key:
|
231
264
|
specification_version: 4
|
232
265
|
summary: use patterns like regular expressions
|
@@ -234,10 +267,12 @@ test_files:
|
|
234
267
|
- spec/expander_spec.rb
|
235
268
|
- spec/extension_spec.rb
|
236
269
|
- spec/identity_spec.rb
|
270
|
+
- spec/mapper_spec.rb
|
237
271
|
- spec/mustermann_spec.rb
|
238
272
|
- spec/pattern_spec.rb
|
239
273
|
- spec/rails_spec.rb
|
240
274
|
- spec/regexp_based_spec.rb
|
275
|
+
- spec/regular_spec.rb
|
241
276
|
- spec/router/rack_spec.rb
|
242
277
|
- spec/router/simple_spec.rb
|
243
278
|
- spec/shell_spec.rb
|
@@ -251,4 +286,5 @@ test_files:
|
|
251
286
|
- spec/support/match_matcher.rb
|
252
287
|
- spec/support/pattern.rb
|
253
288
|
- spec/template_spec.rb
|
289
|
+
- spec/to_pattern_spec.rb
|
254
290
|
has_rdoc:
|