padrino-core 0.16.0.pre3 → 0.16.0.pre4
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/padrino-core/caller.rb +24 -25
- data/lib/padrino-core/logger.rb +2 -1
- data/lib/padrino-core/version.rb +1 -1
- data/padrino-core.gemspec +1 -0
- data/test/fixtures/apps/complex.rb +1 -1
- data/test/test_filters.rb +6 -6
- data/test/test_flash.rb +4 -4
- data/test/test_logger.rb +1 -1
- data/test/test_reloader_complex.rb +1 -1
- data/test/test_routing.rb +17 -17
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0598394e65fde3235a6a76871f740444771c3d7b3f9844a4d9dd9590e219da35'
|
|
4
|
+
data.tar.gz: d20d12d95e74e282f8b637957a26c2d656d70335701aa7279361e47a1694db6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8e9cd927d836b26837025b4b508cedfc2e4accb28245762b350bc3b247e33dd3c9fc25db9cfa07e11b56add4d179ae5c76502401e4334f8840ffacd0731b1da
|
|
7
|
+
data.tar.gz: 3e315bef9862e3ba489b87fd5c5342a54ff7dab2b648b5136c26227a3d61c5293f14f9974e0c7bdba3f7da108dcc4a0a7acc01ed99714caec7070109c94362f9
|
data/lib/padrino-core/caller.rb
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
module Padrino
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
%r{/lib/bundler}
|
|
23
|
-
] unless defined?(PADRINO_IGNORE_CALLERS)
|
|
3
|
+
unless defined?(PADRINO_IGNORE_CALLERS)
|
|
4
|
+
# List of callers in a Padrino application that should be ignored as part of a stack trace.
|
|
5
|
+
PADRINO_IGNORE_CALLERS = [
|
|
6
|
+
*Sinatra::Base.callers_to_ignore, # Inherit Sinatra's default ignore patterns
|
|
7
|
+
Regexp.new(Regexp.escape(RbConfig::CONFIG['rubylibdir'])), # Ignore the Ruby standard lib path
|
|
8
|
+
%r{lib/padrino-.*$},
|
|
9
|
+
%r{/padrino-.*/(lib|bin)},
|
|
10
|
+
%r{/bin/padrino$},
|
|
11
|
+
%r{lib/rack.*\.rb$},
|
|
12
|
+
%r{lib/mongrel.*\.rb$},
|
|
13
|
+
%r{lib/shotgun.*\.rb$},
|
|
14
|
+
%r{bin/shotgun$},
|
|
15
|
+
%r{shoulda/context\.rb$},
|
|
16
|
+
%r{mocha/integration},
|
|
17
|
+
%r{test/unit},
|
|
18
|
+
%r{rake_test_loader\.rb},
|
|
19
|
+
%r{custom_require\.rb$},
|
|
20
|
+
%r{/thor}
|
|
21
|
+
]
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
##
|
|
24
|
+
# Add rubinius (and hopefully other VM implementations) ignore patterns ...
|
|
25
|
+
#
|
|
26
|
+
PADRINO_IGNORE_CALLERS.concat(RUBY_IGNORE_CALLERS) if defined?(RUBY_IGNORE_CALLERS)
|
|
27
|
+
end
|
|
29
28
|
|
|
30
29
|
##
|
|
31
30
|
# The filename for the file that is the direct caller (first caller).
|
data/lib/padrino-core/logger.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'pathname'
|
|
2
|
+
require 'stringio'
|
|
2
3
|
|
|
3
4
|
# Defines the log level for a Padrino project.
|
|
4
5
|
PADRINO_LOG_LEVEL = ENV['PADRINO_LOG_LEVEL'] unless defined?(PADRINO_LOG_LEVEL)
|
|
@@ -361,7 +362,7 @@ WARNING! `Padrino.logger = new_logger` no longer extends it with #colorize! and
|
|
|
361
362
|
FileUtils.mkdir_p(Padrino.root('log')) unless File.exist?(Padrino.root('log'))
|
|
362
363
|
File.new(Padrino.root('log', "#{Padrino.env}.log"), 'a+')
|
|
363
364
|
end
|
|
364
|
-
when :null then StringIO.new
|
|
365
|
+
when :null then ::StringIO.new
|
|
365
366
|
when :stdout then $stdout
|
|
366
367
|
when :stderr then $stderr
|
|
367
368
|
else config[:stream] # return itself, probabilly is a custom stream.
|
data/lib/padrino-core/version.rb
CHANGED
data/padrino-core.gemspec
CHANGED
|
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.summary = "The required Padrino core gem"
|
|
9
9
|
s.homepage = "http://www.padrinorb.com"
|
|
10
10
|
s.description = "The Padrino core gem required for use of this framework"
|
|
11
|
+
s.required_ruby_version = ">= 2.7.8"
|
|
11
12
|
s.required_rubygems_version = ">= 1.3.6"
|
|
12
13
|
s.version = Padrino.version
|
|
13
14
|
s.date = Time.now.strftime("%Y-%m-%d")
|
data/test/test_filters.rb
CHANGED
|
@@ -17,14 +17,14 @@ describe "Filters" do
|
|
|
17
17
|
assert ok?
|
|
18
18
|
assert_equal 'application/xml;charset=utf-8', response.headers['Content-Type']
|
|
19
19
|
|
|
20
|
-
get '/foo', {}, { 'HTTP_ACCEPT' => '
|
|
20
|
+
get '/foo', {}, { 'HTTP_ACCEPT' => 'text/javascript' }
|
|
21
21
|
assert ok?
|
|
22
|
-
assert_equal '
|
|
23
|
-
assert_equal '
|
|
22
|
+
assert_equal 'text/javascript', body
|
|
23
|
+
assert_equal 'text/javascript;charset=utf-8', response.headers['Content-Type']
|
|
24
24
|
|
|
25
25
|
get '/foo.js'
|
|
26
26
|
assert ok?
|
|
27
|
-
assert_equal '
|
|
27
|
+
assert_equal 'text/javascript;charset=utf-8', response.headers['Content-Type']
|
|
28
28
|
|
|
29
29
|
get '/foo', {}, { "HTTP_ACCEPT" => 'text/html' }
|
|
30
30
|
assert_equal 406, status
|
|
@@ -107,11 +107,11 @@ describe "Filters" do
|
|
|
107
107
|
mock_app do
|
|
108
108
|
before { }
|
|
109
109
|
get :index do
|
|
110
|
-
params.
|
|
110
|
+
params.to_json
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
get '/?test=what'
|
|
114
|
-
assert_equal '{"test"
|
|
114
|
+
assert_equal '{"test":"what"}', body
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
it 'should be able to filter based on a path' do
|
data/test/test_flash.rb
CHANGED
|
@@ -68,12 +68,12 @@ describe Padrino::Flash do
|
|
|
68
68
|
|
|
69
69
|
routes = proc do
|
|
70
70
|
get :index do
|
|
71
|
-
params[:key] ? flash[params[:key].to_sym].to_s : flash.now.
|
|
71
|
+
params[:key] ? flash[params[:key].to_sym].to_s : flash.now.to_json
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
post :index do
|
|
75
75
|
params.each { |k,v| flash[k.to_sym] = v.to_s }
|
|
76
|
-
flash.next.
|
|
76
|
+
flash.next.to_json
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
get :session do
|
|
@@ -107,7 +107,7 @@ describe Padrino::Flash do
|
|
|
107
107
|
|
|
108
108
|
it 'should set a flash' do
|
|
109
109
|
post '/', :foo => :bar
|
|
110
|
-
assert_equal '{
|
|
110
|
+
assert_equal '{"foo":"bar"}', body
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
|
|
@@ -129,7 +129,7 @@ describe Padrino::Flash do
|
|
|
129
129
|
|
|
130
130
|
it 'should set a flash' do
|
|
131
131
|
post '/', :foo => :bar
|
|
132
|
-
assert_equal '{
|
|
132
|
+
assert_equal '{"foo":"bar"}', body
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
it 'should get a flash' do
|
data/test/test_logger.rb
CHANGED
|
@@ -334,7 +334,7 @@ describe "options :source_location" do
|
|
|
334
334
|
|
|
335
335
|
it 'should output source_location if :source_location is set to true' do
|
|
336
336
|
stub_root { Padrino.logger.debug("hello world") }
|
|
337
|
-
assert_match(
|
|
337
|
+
assert_match(/hello world/, Padrino.logger.log.string)
|
|
338
338
|
end
|
|
339
339
|
|
|
340
340
|
it 'should output source_location if file path is relative' do
|
|
@@ -64,7 +64,7 @@ describe "ComplexReloader" do
|
|
|
64
64
|
assert_equal 200, status
|
|
65
65
|
|
|
66
66
|
get "/complex_2_demo/var/destroy/variable"
|
|
67
|
-
assert_equal '{"id"
|
|
67
|
+
assert_equal '{"id":"variable"}', body
|
|
68
68
|
ensure
|
|
69
69
|
# Now we need to prevent to commit a new changed file so we revert it
|
|
70
70
|
File.open(Complex1Demo.app_file, "w") { |f| f.write(buffer) }
|
data/test/test_routing.rb
CHANGED
|
@@ -537,7 +537,7 @@ describe "Routing" do
|
|
|
537
537
|
get("/foo", :provides => [:html, :js, :xml]) { content_type.to_s }
|
|
538
538
|
end
|
|
539
539
|
|
|
540
|
-
get '/foo', {}, { 'HTTP_ACCEPT' => '
|
|
540
|
+
get '/foo', {}, { 'HTTP_ACCEPT' => 'text/javascript, */*;q=0.5' }
|
|
541
541
|
assert_equal 'js', body
|
|
542
542
|
end
|
|
543
543
|
|
|
@@ -556,7 +556,7 @@ describe "Routing" do
|
|
|
556
556
|
end
|
|
557
557
|
|
|
558
558
|
get "/a", {}, {}
|
|
559
|
-
assert_equal "
|
|
559
|
+
assert_equal "text/javascript;charset=utf-8", content_type
|
|
560
560
|
end
|
|
561
561
|
|
|
562
562
|
it 'should not match routes if url_format and http_accept is provided but not included' do
|
|
@@ -794,7 +794,7 @@ describe "Routing" do
|
|
|
794
794
|
end
|
|
795
795
|
get "/a.js"
|
|
796
796
|
assert_equal "js", body
|
|
797
|
-
assert_equal '
|
|
797
|
+
assert_equal 'text/javascript;charset=utf-8', response["Content-Type"]
|
|
798
798
|
get "/a.json"
|
|
799
799
|
assert_equal "json", body
|
|
800
800
|
assert_equal 'application/json', response["Content-Type"]
|
|
@@ -1324,9 +1324,9 @@ describe "Routing" do
|
|
|
1324
1324
|
end
|
|
1325
1325
|
end
|
|
1326
1326
|
|
|
1327
|
-
get '/foo', {}, { 'CONTENT_TYPE' => '
|
|
1327
|
+
get '/foo', {}, { 'CONTENT_TYPE' => 'text/javascript' }
|
|
1328
1328
|
assert ok?
|
|
1329
|
-
assert_equal '
|
|
1329
|
+
assert_equal 'text/javascript', body
|
|
1330
1330
|
end
|
|
1331
1331
|
|
|
1332
1332
|
it 'should filters by accept header' do
|
|
@@ -1345,14 +1345,14 @@ describe "Routing" do
|
|
|
1345
1345
|
assert ok?
|
|
1346
1346
|
assert_equal 'application/xml;charset=utf-8', response.headers['Content-Type']
|
|
1347
1347
|
|
|
1348
|
-
get '/foo', {}, { 'HTTP_ACCEPT' => '
|
|
1348
|
+
get '/foo', {}, { 'HTTP_ACCEPT' => 'text/javascript' }
|
|
1349
1349
|
assert ok?
|
|
1350
|
-
assert_equal '
|
|
1351
|
-
assert_equal '
|
|
1350
|
+
assert_equal 'text/javascript', body
|
|
1351
|
+
assert_equal 'text/javascript;charset=utf-8', response.headers['Content-Type']
|
|
1352
1352
|
|
|
1353
1353
|
get '/foo.js'
|
|
1354
1354
|
assert ok?
|
|
1355
|
-
assert_equal '
|
|
1355
|
+
assert_equal 'text/javascript;charset=utf-8', response.headers['Content-Type']
|
|
1356
1356
|
|
|
1357
1357
|
get '/foo', {}, { "HTTP_ACCEPT" => 'text/html' }
|
|
1358
1358
|
assert_equal 406, status
|
|
@@ -1433,11 +1433,11 @@ describe "Routing" do
|
|
|
1433
1433
|
assert_equal 'html', body
|
|
1434
1434
|
end
|
|
1435
1435
|
|
|
1436
|
-
it 'should set content_type to :js if Accept includes both
|
|
1436
|
+
it 'should set content_type to :js if Accept includes both text/javascript and */*;q=0.5' do
|
|
1437
1437
|
mock_app do
|
|
1438
1438
|
get("/foo", :provides => [:html, :js]) { content_type.to_s }
|
|
1439
1439
|
end
|
|
1440
|
-
get '/foo', {}, { 'HTTP_ACCEPT' => '
|
|
1440
|
+
get '/foo', {}, { 'HTTP_ACCEPT' => 'text/javascript, */*;q=0.5' }
|
|
1441
1441
|
assert_equal 'js', body
|
|
1442
1442
|
end
|
|
1443
1443
|
|
|
@@ -1450,12 +1450,12 @@ describe "Routing" do
|
|
|
1450
1450
|
assert_equal 'html', body
|
|
1451
1451
|
end
|
|
1452
1452
|
|
|
1453
|
-
it 'should set content_type to :js if Accept includes both
|
|
1453
|
+
it 'should set content_type to :js if Accept includes both text/javascript, */*;q=0.5 and provides of :any' do
|
|
1454
1454
|
mock_app do
|
|
1455
1455
|
get("/foo", :provides => :any) { content_type.to_s }
|
|
1456
1456
|
end
|
|
1457
1457
|
|
|
1458
|
-
get '/foo', {}, { 'HTTP_ACCEPT' => '
|
|
1458
|
+
get '/foo', {}, { 'HTTP_ACCEPT' => 'text/javascript, */*;q=0.5' }
|
|
1459
1459
|
assert_equal 'js', body
|
|
1460
1460
|
end
|
|
1461
1461
|
|
|
@@ -1681,11 +1681,11 @@ describe "Routing" do
|
|
|
1681
1681
|
mock_app do
|
|
1682
1682
|
before { }
|
|
1683
1683
|
get :index do
|
|
1684
|
-
params.
|
|
1684
|
+
params.to_json
|
|
1685
1685
|
end
|
|
1686
1686
|
end
|
|
1687
1687
|
get '/?test=what'
|
|
1688
|
-
assert_equal '{"test"
|
|
1688
|
+
assert_equal '{"test":"what"}', body
|
|
1689
1689
|
end
|
|
1690
1690
|
|
|
1691
1691
|
it 'should work only for the given controller and route when using before-filter with route name' do
|
|
@@ -2267,11 +2267,11 @@ describe "Routing" do
|
|
|
2267
2267
|
end
|
|
2268
2268
|
|
|
2269
2269
|
put '/b/:b/:c', :csrf_protection => false do
|
|
2270
|
-
params.
|
|
2270
|
+
params.to_json
|
|
2271
2271
|
end
|
|
2272
2272
|
end
|
|
2273
2273
|
put "/b/x/y"
|
|
2274
|
-
assert_equal '{"b"
|
|
2274
|
+
assert_equal '{"b":"x","c":"y"}', body
|
|
2275
2275
|
end
|
|
2276
2276
|
|
|
2277
2277
|
it "should support named captures like %r{/hello/(?<person>[^/?#]+)} on Ruby >= 1.9" do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: padrino-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.16.0.
|
|
4
|
+
version: 0.16.0.pre4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Padrino Team
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date:
|
|
14
|
+
date: 2025-11-19 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: padrino-support
|
|
@@ -19,14 +19,14 @@ dependencies:
|
|
|
19
19
|
requirements:
|
|
20
20
|
- - '='
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 0.16.0.
|
|
22
|
+
version: 0.16.0.pre4
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - '='
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0.16.0.
|
|
29
|
+
version: 0.16.0.pre4
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: rackup
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
214
214
|
requirements:
|
|
215
215
|
- - ">="
|
|
216
216
|
- !ruby/object:Gem::Version
|
|
217
|
-
version:
|
|
217
|
+
version: 2.7.8
|
|
218
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
requirements:
|
|
220
220
|
- - ">"
|