sinatra-contrib 2.0.0.rc1 → 2.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +2 -1
- data/lib/sinatra/decompile.rb +5 -0
- data/lib/sinatra/runner.rb +155 -0
- data/lib/sinatra/webdav.rb +93 -0
- data/sinatra-contrib.gemspec +5 -199
- metadata +13 -175
- data/spec/capture_spec.rb +0 -100
- data/spec/config_file/key_value.yml +0 -7
- data/spec/config_file/key_value.yml.erb +0 -6
- data/spec/config_file/key_value_override.yml +0 -2
- data/spec/config_file/missing_env.yml +0 -4
- data/spec/config_file/with_envs.yml +0 -7
- data/spec/config_file/with_nested_envs.yml +0 -11
- data/spec/config_file_spec.rb +0 -76
- data/spec/content_for/different_key.erb +0 -1
- data/spec/content_for/different_key.erubis +0 -1
- data/spec/content_for/different_key.haml +0 -2
- data/spec/content_for/different_key.slim +0 -2
- data/spec/content_for/footer.erb +0 -3
- data/spec/content_for/footer.erubis +0 -3
- data/spec/content_for/footer.haml +0 -2
- data/spec/content_for/footer.slim +0 -2
- data/spec/content_for/layout.erb +0 -1
- data/spec/content_for/layout.erubis +0 -1
- data/spec/content_for/layout.haml +0 -1
- data/spec/content_for/layout.slim +0 -1
- data/spec/content_for/multiple_blocks.erb +0 -4
- data/spec/content_for/multiple_blocks.erubis +0 -4
- data/spec/content_for/multiple_blocks.haml +0 -8
- data/spec/content_for/multiple_blocks.slim +0 -8
- data/spec/content_for/multiple_yields.erb +0 -3
- data/spec/content_for/multiple_yields.erubis +0 -3
- data/spec/content_for/multiple_yields.haml +0 -3
- data/spec/content_for/multiple_yields.slim +0 -3
- data/spec/content_for/passes_values.erb +0 -1
- data/spec/content_for/passes_values.erubis +0 -1
- data/spec/content_for/passes_values.haml +0 -1
- data/spec/content_for/passes_values.slim +0 -1
- data/spec/content_for/same_key.erb +0 -1
- data/spec/content_for/same_key.erubis +0 -1
- data/spec/content_for/same_key.haml +0 -2
- data/spec/content_for/same_key.slim +0 -2
- data/spec/content_for/takes_values.erb +0 -1
- data/spec/content_for/takes_values.erubis +0 -1
- data/spec/content_for/takes_values.haml +0 -3
- data/spec/content_for/takes_values.slim +0 -3
- data/spec/content_for_spec.rb +0 -241
- data/spec/cookies_spec.rb +0 -826
- data/spec/custom_logger_spec.rb +0 -43
- data/spec/extension_spec.rb +0 -32
- data/spec/json_spec.rb +0 -115
- data/spec/link_header_spec.rb +0 -99
- data/spec/multi_route_spec.rb +0 -59
- data/spec/namespace/foo.erb +0 -1
- data/spec/namespace/nested/foo.erb +0 -1
- data/spec/namespace_spec.rb +0 -791
- data/spec/okjson.rb +0 -581
- data/spec/reloader/app.rb.erb +0 -40
- data/spec/reloader_spec.rb +0 -465
- data/spec/required_params_spec.rb +0 -68
- data/spec/respond_with/bar.erb +0 -1
- data/spec/respond_with/bar.json.erb +0 -1
- data/spec/respond_with/baz.yajl +0 -1
- data/spec/respond_with/foo.html.erb +0 -1
- data/spec/respond_with/not_html.sass +0 -2
- data/spec/respond_with_spec.rb +0 -317
- data/spec/spec_helper.rb +0 -7
- data/spec/streaming_spec.rb +0 -415
metadata
CHANGED
@@ -1,63 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Zachary Scott
|
9
|
-
- Gabriel Andretta
|
10
|
-
- Trevor Bramble
|
11
|
-
- Katrina Owen
|
12
|
-
- Ashley Williams
|
13
|
-
- Nicolas Sanguinetti
|
14
|
-
- Hrvoje Šimić
|
15
|
-
- Masahiro Fujiwara
|
16
|
-
- Rafael Magana
|
17
|
-
- Vipul A M
|
18
|
-
- ashley williams
|
19
|
-
- Jack Chu
|
20
|
-
- Sumeet Singh
|
21
|
-
- Ilya Shindyapin
|
22
|
-
- lest
|
23
|
-
- Jake Worth
|
24
|
-
- Kashyap
|
25
|
-
- Matt Lyon
|
26
|
-
- Matthew Conway
|
27
|
-
- Meck
|
28
|
-
- Michi Huber
|
29
|
-
- Nic Benders
|
30
|
-
- Patricio Mac Adden
|
31
|
-
- Reed Lipman
|
32
|
-
- Samy Dindane
|
33
|
-
- Sergey Nartimov
|
34
|
-
- Thibaut Sacreste
|
35
|
-
- Uchio KONDO
|
36
|
-
- Will Bailey
|
37
|
-
- mono
|
38
|
-
- Adrian Pacała
|
39
|
-
- undr
|
40
|
-
- Aish
|
41
|
-
- Alexey Chernenkov
|
42
|
-
- Andrew Crump
|
43
|
-
- Anton Davydov
|
44
|
-
- Bo Jeanes
|
45
|
-
- David Asabina
|
46
|
-
- Eliot Shepard
|
47
|
-
- Eric Marden
|
48
|
-
- Gray Manley
|
49
|
-
- Guillaume Bouteille
|
50
|
-
- Jamie Hodge
|
51
|
-
- Julie Ng
|
52
|
-
- Koichi Sasada
|
53
|
-
- Kyle Lacy
|
54
|
-
- Lars Vonk
|
55
|
-
- Martin Frost
|
56
|
-
- Mathieu Allaire
|
7
|
+
- https://github.com/sinatra/sinatra/graphs/contributors
|
57
8
|
autorequire:
|
58
9
|
bindir: bin
|
59
10
|
cert_chain: []
|
60
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-19 00:00:00.000000000 Z
|
61
12
|
dependencies:
|
62
13
|
- !ruby/object:Gem::Dependency
|
63
14
|
name: sinatra
|
@@ -65,14 +16,14 @@ dependencies:
|
|
65
16
|
requirements:
|
66
17
|
- - '='
|
67
18
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.0.0.
|
19
|
+
version: 2.0.0.rc2
|
69
20
|
type: :runtime
|
70
21
|
prerelease: false
|
71
22
|
version_requirements: !ruby/object:Gem::Requirement
|
72
23
|
requirements:
|
73
24
|
- - '='
|
74
25
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.0.0.
|
26
|
+
version: 2.0.0.rc2
|
76
27
|
- !ruby/object:Gem::Dependency
|
77
28
|
name: mustermann
|
78
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,14 +78,14 @@ dependencies:
|
|
127
78
|
requirements:
|
128
79
|
- - '='
|
129
80
|
- !ruby/object:Gem::Version
|
130
|
-
version: 2.0.0.
|
81
|
+
version: 2.0.0.rc2
|
131
82
|
type: :runtime
|
132
83
|
prerelease: false
|
133
84
|
version_requirements: !ruby/object:Gem::Requirement
|
134
85
|
requirements:
|
135
86
|
- - '='
|
136
87
|
- !ruby/object:Gem::Version
|
137
|
-
version: 2.0.0.
|
88
|
+
version: 2.0.0.rc2
|
138
89
|
- !ruby/object:Gem::Dependency
|
139
90
|
name: multi_json
|
140
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -416,61 +367,7 @@ dependencies:
|
|
416
367
|
- !ruby/object:Gem::Version
|
417
368
|
version: '0'
|
418
369
|
description: Collection of useful Sinatra extensions
|
419
|
-
email:
|
420
|
-
- konstantin.mailinglists@googlemail.com
|
421
|
-
- ohhgabriel@gmail.com
|
422
|
-
- inbox@trevorbramble.com
|
423
|
-
- e@zzak.io
|
424
|
-
- zachary@zacharyscott.net
|
425
|
-
- katrina.owen@gmail.com
|
426
|
-
- ashley@bocoup.com
|
427
|
-
- contacto@nicolassanguinetti.info
|
428
|
-
- shime.ferovac@gmail.com
|
429
|
-
- raf.magana@gmail.com
|
430
|
-
- m-fujiwara@axsh.net
|
431
|
-
- vipulnsward@gmail.com
|
432
|
-
- konstantin.haase@gmail.com
|
433
|
-
- jack@jackchu.com
|
434
|
-
- ashley666ashley@gmail.com
|
435
|
-
- ilya@shindyapin.com
|
436
|
-
- just.lest@gmail.com
|
437
|
-
- kashyap.kmbc@gmail.com
|
438
|
-
- ortuna@gmail.com
|
439
|
-
- tbramble@chef.io
|
440
|
-
- jworth@prevailhs.com
|
441
|
-
- mail@zzak.io
|
442
|
-
- nic@newrelic.com
|
443
|
-
- patriciomacadden@gmail.com
|
444
|
-
- rmlipman@gmail.com
|
445
|
-
- samy@dindane.com
|
446
|
-
- just.lest@gmail.com
|
447
|
-
- thibaut.sacreste@gmail.com
|
448
|
-
- udzura@udzura.jp
|
449
|
-
- will.bailey@gmail.com
|
450
|
-
- mono@mono0x.net
|
451
|
-
- altpacala@gmail.com
|
452
|
-
- undr@yandex.ru
|
453
|
-
- aisha.fenton@visfleet.com
|
454
|
-
- laise@pisem.net
|
455
|
-
- andrew.crump@ieee.org
|
456
|
-
- antondavydov.o@gmail.com
|
457
|
-
- me@bjeanes.com
|
458
|
-
- david@supr.nu
|
459
|
-
- eshepard@slower.net
|
460
|
-
- eric.marden@gmail.com
|
461
|
-
- g.manley@tukaiz.com
|
462
|
-
- duffman@via.ecp.fr
|
463
|
-
- jamiehodge@me.com
|
464
|
-
- uxjulie@gmail.com
|
465
|
-
- ko1@atdot.net
|
466
|
-
- kylewlacy@me.com
|
467
|
-
- lars.vonk@gmail.com
|
468
|
-
- blame@kth.se
|
469
|
-
- mathieuallaire@gmail.com
|
470
|
-
- matt@flowerpowered.com
|
471
|
-
- himself@mattonrails.com
|
472
|
-
- yesmeck@gmail.com
|
473
|
-
- michi.huber@gmail.com
|
370
|
+
email: sinatrarb@googlegroups.com
|
474
371
|
executables: []
|
475
372
|
extensions: []
|
476
373
|
extra_rdoc_files: []
|
@@ -488,6 +385,7 @@ files:
|
|
488
385
|
- lib/sinatra/contrib/version.rb
|
489
386
|
- lib/sinatra/cookies.rb
|
490
387
|
- lib/sinatra/custom_logger.rb
|
388
|
+
- lib/sinatra/decompile.rb
|
491
389
|
- lib/sinatra/engine_tracking.rb
|
492
390
|
- lib/sinatra/extension.rb
|
493
391
|
- lib/sinatra/json.rb
|
@@ -497,72 +395,12 @@ files:
|
|
497
395
|
- lib/sinatra/reloader.rb
|
498
396
|
- lib/sinatra/required_params.rb
|
499
397
|
- lib/sinatra/respond_with.rb
|
398
|
+
- lib/sinatra/runner.rb
|
500
399
|
- lib/sinatra/streaming.rb
|
501
400
|
- lib/sinatra/test_helpers.rb
|
401
|
+
- lib/sinatra/webdav.rb
|
502
402
|
- sinatra-contrib.gemspec
|
503
|
-
|
504
|
-
- spec/config_file/key_value.yml
|
505
|
-
- spec/config_file/key_value.yml.erb
|
506
|
-
- spec/config_file/key_value_override.yml
|
507
|
-
- spec/config_file/missing_env.yml
|
508
|
-
- spec/config_file/with_envs.yml
|
509
|
-
- spec/config_file/with_nested_envs.yml
|
510
|
-
- spec/config_file_spec.rb
|
511
|
-
- spec/content_for/different_key.erb
|
512
|
-
- spec/content_for/different_key.erubis
|
513
|
-
- spec/content_for/different_key.haml
|
514
|
-
- spec/content_for/different_key.slim
|
515
|
-
- spec/content_for/footer.erb
|
516
|
-
- spec/content_for/footer.erubis
|
517
|
-
- spec/content_for/footer.haml
|
518
|
-
- spec/content_for/footer.slim
|
519
|
-
- spec/content_for/layout.erb
|
520
|
-
- spec/content_for/layout.erubis
|
521
|
-
- spec/content_for/layout.haml
|
522
|
-
- spec/content_for/layout.slim
|
523
|
-
- spec/content_for/multiple_blocks.erb
|
524
|
-
- spec/content_for/multiple_blocks.erubis
|
525
|
-
- spec/content_for/multiple_blocks.haml
|
526
|
-
- spec/content_for/multiple_blocks.slim
|
527
|
-
- spec/content_for/multiple_yields.erb
|
528
|
-
- spec/content_for/multiple_yields.erubis
|
529
|
-
- spec/content_for/multiple_yields.haml
|
530
|
-
- spec/content_for/multiple_yields.slim
|
531
|
-
- spec/content_for/passes_values.erb
|
532
|
-
- spec/content_for/passes_values.erubis
|
533
|
-
- spec/content_for/passes_values.haml
|
534
|
-
- spec/content_for/passes_values.slim
|
535
|
-
- spec/content_for/same_key.erb
|
536
|
-
- spec/content_for/same_key.erubis
|
537
|
-
- spec/content_for/same_key.haml
|
538
|
-
- spec/content_for/same_key.slim
|
539
|
-
- spec/content_for/takes_values.erb
|
540
|
-
- spec/content_for/takes_values.erubis
|
541
|
-
- spec/content_for/takes_values.haml
|
542
|
-
- spec/content_for/takes_values.slim
|
543
|
-
- spec/content_for_spec.rb
|
544
|
-
- spec/cookies_spec.rb
|
545
|
-
- spec/custom_logger_spec.rb
|
546
|
-
- spec/extension_spec.rb
|
547
|
-
- spec/json_spec.rb
|
548
|
-
- spec/link_header_spec.rb
|
549
|
-
- spec/multi_route_spec.rb
|
550
|
-
- spec/namespace/foo.erb
|
551
|
-
- spec/namespace/nested/foo.erb
|
552
|
-
- spec/namespace_spec.rb
|
553
|
-
- spec/okjson.rb
|
554
|
-
- spec/reloader/app.rb.erb
|
555
|
-
- spec/reloader_spec.rb
|
556
|
-
- spec/required_params_spec.rb
|
557
|
-
- spec/respond_with/bar.erb
|
558
|
-
- spec/respond_with/bar.json.erb
|
559
|
-
- spec/respond_with/baz.yajl
|
560
|
-
- spec/respond_with/foo.html.erb
|
561
|
-
- spec/respond_with/not_html.sass
|
562
|
-
- spec/respond_with_spec.rb
|
563
|
-
- spec/spec_helper.rb
|
564
|
-
- spec/streaming_spec.rb
|
565
|
-
homepage: http://github.com/sinatra/sinatra-contrib
|
403
|
+
homepage: http://github.com/sinatra/sinatra/tree/master/sinatra-contrib
|
566
404
|
licenses:
|
567
405
|
- MIT
|
568
406
|
metadata: {}
|
@@ -582,7 +420,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
582
420
|
version: 1.3.1
|
583
421
|
requirements: []
|
584
422
|
rubyforge_project:
|
585
|
-
rubygems_version: 2.
|
423
|
+
rubygems_version: 2.6.8
|
586
424
|
signing_key:
|
587
425
|
specification_version: 4
|
588
426
|
summary: Collection of useful Sinatra extensions
|
data/spec/capture_spec.rb
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require 'slim'
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe Sinatra::Capture do
|
6
|
-
subject do
|
7
|
-
Sinatra.new do
|
8
|
-
enable :inline_templates
|
9
|
-
helpers Sinatra::Capture
|
10
|
-
end.new!
|
11
|
-
end
|
12
|
-
Tilt.prefer Tilt::ERBTemplate
|
13
|
-
|
14
|
-
extend Forwardable
|
15
|
-
def_delegators :subject, :capture, :capture_later
|
16
|
-
|
17
|
-
def render(engine, template)
|
18
|
-
subject.send(:render, engine, template.to_sym).strip.gsub(/\s+/, ' ')
|
19
|
-
end
|
20
|
-
|
21
|
-
shared_examples_for "a template language" do |engine|
|
22
|
-
lang = engine == :erubis ? :erb : engine
|
23
|
-
require "#{engine}"
|
24
|
-
|
25
|
-
it "captures content" do
|
26
|
-
expect(render(engine, "simple_#{lang}")).to eq("Say Hello World!")
|
27
|
-
end
|
28
|
-
|
29
|
-
it "allows nested captures" do
|
30
|
-
expect(render(engine, "nested_#{lang}")).to eq("Say Hello World!")
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe('haml') { it_behaves_like "a template language", :haml }
|
35
|
-
describe('slim') { it_behaves_like "a template language", :slim }
|
36
|
-
describe('erubis') { it_behaves_like "a template language", :erubis }
|
37
|
-
|
38
|
-
describe 'erb' do
|
39
|
-
it_behaves_like "a template language", :erb
|
40
|
-
|
41
|
-
it "handles utf-8 encoding" do
|
42
|
-
expect(render(:erb, "utf_8")).to eq("UTF-8 –")
|
43
|
-
end
|
44
|
-
|
45
|
-
it "handles ISO-8859-1 encoding" do
|
46
|
-
expect(render(:erb, "iso_8859_1")).to eq("ISO-8859-1 -")
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
__END__
|
52
|
-
|
53
|
-
@@ simple_erb
|
54
|
-
Say
|
55
|
-
<% a = capture do %>World<% end %>
|
56
|
-
Hello <%= a %>!
|
57
|
-
|
58
|
-
@@ nested_erb
|
59
|
-
Say
|
60
|
-
<% a = capture do %>
|
61
|
-
<% b = capture do %>World<% end %>
|
62
|
-
<%= b %>!
|
63
|
-
<% end %>
|
64
|
-
Hello <%= a.strip %>
|
65
|
-
|
66
|
-
@@ simple_slim
|
67
|
-
| Say
|
68
|
-
- a = capture do
|
69
|
-
| World
|
70
|
-
| Hello #{a.strip}!
|
71
|
-
|
72
|
-
@@ nested_slim
|
73
|
-
| Say
|
74
|
-
- a = capture do
|
75
|
-
- b = capture do
|
76
|
-
| World
|
77
|
-
| #{b.strip}!
|
78
|
-
| Hello #{a.strip}
|
79
|
-
|
80
|
-
@@ simple_haml
|
81
|
-
Say
|
82
|
-
- a = capture do
|
83
|
-
World
|
84
|
-
Hello #{a.strip}!
|
85
|
-
|
86
|
-
@@ nested_haml
|
87
|
-
Say
|
88
|
-
- a = capture do
|
89
|
-
- b = capture do
|
90
|
-
World
|
91
|
-
#{b.strip}!
|
92
|
-
Hello #{a.strip}
|
93
|
-
|
94
|
-
@@ utf_8
|
95
|
-
<% a = capture do %>–<% end %>
|
96
|
-
UTF-8 <%= a %>
|
97
|
-
|
98
|
-
@@ iso_8859_1
|
99
|
-
<% a = capture do %>-<% end %>
|
100
|
-
ISO-8859-1 <%= a.force_encoding("iso-8859-1") %>
|
data/spec/config_file_spec.rb
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Sinatra::ConfigFile do
|
4
|
-
def config_file(*args, &block)
|
5
|
-
mock_app do
|
6
|
-
register Sinatra::ConfigFile
|
7
|
-
set :root, File.expand_path('../config_file', __FILE__)
|
8
|
-
instance_eval(&block) if block
|
9
|
-
config_file(*args)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should set options from a simple config_file' do
|
14
|
-
config_file 'key_value.yml'
|
15
|
-
expect(settings.foo).to eq('bar')
|
16
|
-
expect(settings.something).to eq(42)
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should create indifferent hashes' do
|
20
|
-
config_file 'key_value.yml'
|
21
|
-
expect(settings.nested['a']).to eq(1)
|
22
|
-
expect(settings.nested[:a]).to eq(1)
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'should render options in ERB tags when using .yml files' do
|
26
|
-
config_file 'key_value.yml'
|
27
|
-
expect(settings.bar).to eq "bar"
|
28
|
-
expect(settings.something).to eq 42
|
29
|
-
expect(settings.nested['a']).to eq 1
|
30
|
-
expect(settings.nested[:a]).to eq 1
|
31
|
-
expect(settings.nested['b']).to eq 2
|
32
|
-
expect(settings.nested[:b]).to eq 2
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should render options in ERB tags when using .yml.erb files' do
|
36
|
-
config_file 'key_value.yml.erb'
|
37
|
-
expect(settings.foo).to eq("bar")
|
38
|
-
expect(settings.something).to eq(42)
|
39
|
-
expect(settings.nested['a']).to eq(1)
|
40
|
-
expect(settings.nested[:a]).to eq(1)
|
41
|
-
expect(settings.nested['b']).to eq(2)
|
42
|
-
expect(settings.nested[:b]).to eq(2)
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'should raise error if config file extension is not .yml or .erb' do
|
46
|
-
expect{ config_file 'config.txt' }.to raise_error(Sinatra::ConfigFile::UnsupportedConfigType)
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'should recognize env specific settings per file' do
|
50
|
-
config_file 'with_envs.yml'
|
51
|
-
expect(settings.foo).to eq('test')
|
52
|
-
end
|
53
|
-
|
54
|
-
it 'should recognize env specific settings per setting' do
|
55
|
-
config_file 'with_nested_envs.yml'
|
56
|
-
expect(settings.database[:adapter]).to eq('sqlite')
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'should not set present values to nil if the current env is missing' do
|
60
|
-
# first let's check the test is actually working properly
|
61
|
-
config_file('missing_env.yml') { set :foo => 42, :environment => :production }
|
62
|
-
expect(settings.foo).to eq(10)
|
63
|
-
# now test it
|
64
|
-
config_file('missing_env.yml') { set :foo => 42, :environment => :test }
|
65
|
-
expect(settings.foo).to eq(42)
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'should prioritize settings in latter files' do
|
69
|
-
# first let's check the test is actually working properly
|
70
|
-
config_file 'key_value.yml'
|
71
|
-
expect(settings.foo).to eq('bar')
|
72
|
-
# now test it
|
73
|
-
config_file 'key_value_override.yml'
|
74
|
-
expect(settings.foo).to eq('foo')
|
75
|
-
end
|
76
|
-
end
|