mustermann19 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.travis.yml +10 -0
- data/.yardopts +1 -0
- data/Gemfile +2 -0
- data/LICENSE +22 -0
- data/README.md +1081 -0
- data/Rakefile +6 -0
- data/bench/capturing.rb +57 -0
- data/bench/regexp.rb +21 -0
- data/bench/simple_vs_sinatra.rb +23 -0
- data/bench/template_vs_addressable.rb +26 -0
- data/internals.md +64 -0
- data/lib/mustermann.rb +61 -0
- data/lib/mustermann/ast/compiler.rb +168 -0
- data/lib/mustermann/ast/expander.rb +134 -0
- data/lib/mustermann/ast/node.rb +160 -0
- data/lib/mustermann/ast/parser.rb +137 -0
- data/lib/mustermann/ast/pattern.rb +84 -0
- data/lib/mustermann/ast/transformer.rb +129 -0
- data/lib/mustermann/ast/translator.rb +108 -0
- data/lib/mustermann/ast/tree_renderer.rb +29 -0
- data/lib/mustermann/ast/validation.rb +43 -0
- data/lib/mustermann/caster.rb +117 -0
- data/lib/mustermann/equality_map.rb +48 -0
- data/lib/mustermann/error.rb +6 -0
- data/lib/mustermann/expander.rb +206 -0
- data/lib/mustermann/extension.rb +52 -0
- data/lib/mustermann/identity.rb +19 -0
- data/lib/mustermann/mapper.rb +98 -0
- data/lib/mustermann/pattern.rb +182 -0
- data/lib/mustermann/rails.rb +17 -0
- data/lib/mustermann/regexp_based.rb +30 -0
- data/lib/mustermann/regular.rb +26 -0
- data/lib/mustermann/router.rb +9 -0
- data/lib/mustermann/router/rack.rb +50 -0
- data/lib/mustermann/router/simple.rb +144 -0
- data/lib/mustermann/shell.rb +29 -0
- data/lib/mustermann/simple.rb +38 -0
- data/lib/mustermann/simple_match.rb +30 -0
- data/lib/mustermann/sinatra.rb +22 -0
- data/lib/mustermann/template.rb +48 -0
- data/lib/mustermann/to_pattern.rb +45 -0
- data/lib/mustermann/version.rb +3 -0
- data/mustermann.gemspec +31 -0
- data/spec/expander_spec.rb +105 -0
- data/spec/extension_spec.rb +296 -0
- data/spec/identity_spec.rb +83 -0
- data/spec/mapper_spec.rb +83 -0
- data/spec/mustermann_spec.rb +65 -0
- data/spec/pattern_spec.rb +49 -0
- data/spec/rails_spec.rb +522 -0
- data/spec/regexp_based_spec.rb +8 -0
- data/spec/regular_spec.rb +36 -0
- data/spec/router/rack_spec.rb +39 -0
- data/spec/router/simple_spec.rb +32 -0
- data/spec/shell_spec.rb +109 -0
- data/spec/simple_match_spec.rb +10 -0
- data/spec/simple_spec.rb +237 -0
- data/spec/sinatra_spec.rb +574 -0
- data/spec/support.rb +5 -0
- data/spec/support/coverage.rb +16 -0
- data/spec/support/env.rb +15 -0
- data/spec/support/expand_matcher.rb +27 -0
- data/spec/support/match_matcher.rb +39 -0
- data/spec/support/pattern.rb +39 -0
- data/spec/template_spec.rb +815 -0
- data/spec/to_pattern_spec.rb +20 -0
- metadata +301 -0
@@ -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
ADDED
@@ -0,0 +1,301 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mustermann19
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Konstantin Haase
|
9
|
+
- namusyaka
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2014-09-23 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: enumerable-lazy
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: rspec
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :development
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec-its
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: addressable
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: sinatra
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '1.4'
|
87
|
+
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.4'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: rack-test
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ! '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: yard
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
type: :development
|
136
|
+
prerelease: false
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: simplecov
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
type: :development
|
152
|
+
prerelease: false
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: coveralls
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
type: :development
|
168
|
+
prerelease: false
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ! '>='
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
description: library implementing patterns that behave like regular expressions for
|
176
|
+
use in Ruby 1.9
|
177
|
+
email: namusyaka@gmail.com
|
178
|
+
executables: []
|
179
|
+
extensions: []
|
180
|
+
extra_rdoc_files:
|
181
|
+
- README.md
|
182
|
+
- internals.md
|
183
|
+
files:
|
184
|
+
- .gitignore
|
185
|
+
- .rspec
|
186
|
+
- .travis.yml
|
187
|
+
- .yardopts
|
188
|
+
- Gemfile
|
189
|
+
- LICENSE
|
190
|
+
- README.md
|
191
|
+
- Rakefile
|
192
|
+
- bench/capturing.rb
|
193
|
+
- bench/regexp.rb
|
194
|
+
- bench/simple_vs_sinatra.rb
|
195
|
+
- bench/template_vs_addressable.rb
|
196
|
+
- internals.md
|
197
|
+
- lib/mustermann.rb
|
198
|
+
- lib/mustermann/ast/compiler.rb
|
199
|
+
- lib/mustermann/ast/expander.rb
|
200
|
+
- lib/mustermann/ast/node.rb
|
201
|
+
- lib/mustermann/ast/parser.rb
|
202
|
+
- lib/mustermann/ast/pattern.rb
|
203
|
+
- lib/mustermann/ast/transformer.rb
|
204
|
+
- lib/mustermann/ast/translator.rb
|
205
|
+
- lib/mustermann/ast/tree_renderer.rb
|
206
|
+
- lib/mustermann/ast/validation.rb
|
207
|
+
- lib/mustermann/caster.rb
|
208
|
+
- lib/mustermann/equality_map.rb
|
209
|
+
- lib/mustermann/error.rb
|
210
|
+
- lib/mustermann/expander.rb
|
211
|
+
- lib/mustermann/extension.rb
|
212
|
+
- lib/mustermann/identity.rb
|
213
|
+
- lib/mustermann/mapper.rb
|
214
|
+
- lib/mustermann/pattern.rb
|
215
|
+
- lib/mustermann/rails.rb
|
216
|
+
- lib/mustermann/regexp_based.rb
|
217
|
+
- lib/mustermann/regular.rb
|
218
|
+
- lib/mustermann/router.rb
|
219
|
+
- lib/mustermann/router/rack.rb
|
220
|
+
- lib/mustermann/router/simple.rb
|
221
|
+
- lib/mustermann/shell.rb
|
222
|
+
- lib/mustermann/simple.rb
|
223
|
+
- lib/mustermann/simple_match.rb
|
224
|
+
- lib/mustermann/sinatra.rb
|
225
|
+
- lib/mustermann/template.rb
|
226
|
+
- lib/mustermann/to_pattern.rb
|
227
|
+
- lib/mustermann/version.rb
|
228
|
+
- mustermann.gemspec
|
229
|
+
- spec/expander_spec.rb
|
230
|
+
- spec/extension_spec.rb
|
231
|
+
- spec/identity_spec.rb
|
232
|
+
- spec/mapper_spec.rb
|
233
|
+
- spec/mustermann_spec.rb
|
234
|
+
- spec/pattern_spec.rb
|
235
|
+
- spec/rails_spec.rb
|
236
|
+
- spec/regexp_based_spec.rb
|
237
|
+
- spec/regular_spec.rb
|
238
|
+
- spec/router/rack_spec.rb
|
239
|
+
- spec/router/simple_spec.rb
|
240
|
+
- spec/shell_spec.rb
|
241
|
+
- spec/simple_match_spec.rb
|
242
|
+
- spec/simple_spec.rb
|
243
|
+
- spec/sinatra_spec.rb
|
244
|
+
- spec/support.rb
|
245
|
+
- spec/support/coverage.rb
|
246
|
+
- spec/support/env.rb
|
247
|
+
- spec/support/expand_matcher.rb
|
248
|
+
- spec/support/match_matcher.rb
|
249
|
+
- spec/support/pattern.rb
|
250
|
+
- spec/template_spec.rb
|
251
|
+
- spec/to_pattern_spec.rb
|
252
|
+
homepage: https://github.com/namusyaka/mustermann
|
253
|
+
licenses:
|
254
|
+
- MIT
|
255
|
+
post_install_message:
|
256
|
+
rdoc_options: []
|
257
|
+
require_paths:
|
258
|
+
- lib
|
259
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
260
|
+
none: false
|
261
|
+
requirements:
|
262
|
+
- - ! '>='
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: 1.9.2
|
265
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
266
|
+
none: false
|
267
|
+
requirements:
|
268
|
+
- - ! '>='
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: '0'
|
271
|
+
requirements: []
|
272
|
+
rubyforge_project:
|
273
|
+
rubygems_version: 1.8.23.2
|
274
|
+
signing_key:
|
275
|
+
specification_version: 3
|
276
|
+
summary: use patterns like regular expressions
|
277
|
+
test_files:
|
278
|
+
- spec/expander_spec.rb
|
279
|
+
- spec/extension_spec.rb
|
280
|
+
- spec/identity_spec.rb
|
281
|
+
- spec/mapper_spec.rb
|
282
|
+
- spec/mustermann_spec.rb
|
283
|
+
- spec/pattern_spec.rb
|
284
|
+
- spec/rails_spec.rb
|
285
|
+
- spec/regexp_based_spec.rb
|
286
|
+
- spec/regular_spec.rb
|
287
|
+
- spec/router/rack_spec.rb
|
288
|
+
- spec/router/simple_spec.rb
|
289
|
+
- spec/shell_spec.rb
|
290
|
+
- spec/simple_match_spec.rb
|
291
|
+
- spec/simple_spec.rb
|
292
|
+
- spec/sinatra_spec.rb
|
293
|
+
- spec/support.rb
|
294
|
+
- spec/support/coverage.rb
|
295
|
+
- spec/support/env.rb
|
296
|
+
- spec/support/expand_matcher.rb
|
297
|
+
- spec/support/match_matcher.rb
|
298
|
+
- spec/support/pattern.rb
|
299
|
+
- spec/template_spec.rb
|
300
|
+
- spec/to_pattern_spec.rb
|
301
|
+
has_rdoc:
|