1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Remove Radius support

This commit is contained in:
Eloy Perez 2022-07-17 11:32:46 +02:00
parent 00c97a7f60
commit e542dda2a2
11 changed files with 4 additions and 77 deletions

View file

@ -32,7 +32,6 @@ gem 'slim', '~> 4'
gem 'rdoc'
gem 'kramdown'
gem 'markaby'
gem 'radius'
gem 'asciidoctor'
gem 'liquid'
gem 'rabl'

View file

@ -31,7 +31,7 @@ end
Rake::TestTask.new(:"test:core") do |t|
core_tests = %w[base delegator encoding extensions filter
helpers mapped_error middleware radius rdoc
helpers mapped_error middleware rdoc
readme request response result route_added_hook
routing server settings sinatra static templates]
t.test_files = core_tests.map {|n| "test/#{n}_test.rb"}

View file

@ -733,10 +733,6 @@ module Sinatra
render :asciidoc, template, options, locals
end
def radius(template, options = {}, locals = {})
render :radius, template, options, locals
end
def markaby(template = nil, options = {}, locals = {}, &block)
render_ruby(:mab, template, options, locals, &block)
end

View file

@ -45,11 +45,6 @@ module Sinatra
@current_engine == :rdoc
end
# @return [Boolean] Returns true if current engine is `:radius.
def radius?
@current_engine == :radius
end
# @return [Boolean] Returns true if current engine is `:markaby`.
def markaby?
@current_engine == :markaby

View file

@ -226,7 +226,7 @@ module Sinatra
ALLOWED_ENGINES = [
:erb, :erubi, :haml, :hamlit, :builder, :nokogiri,
:liquid, :markdown, :rdoc, :asciidoc, :radius, :markaby,
:liquid, :markdown, :rdoc, :asciidoc, :markaby,
:rabl, :slim, :yajl
]

View file

@ -238,7 +238,7 @@ module Sinatra
def self.engines
engines = {
:xml => [:builder, :nokogiri],
:html => [:erb, :erubi, :haml, :hamlit, :slim, :liquid, :radius,
:html => [:erb, :erubi, :haml, :hamlit, :slim, :liquid,
:mab, :markdown, :rdoc],
:all => (Sinatra::Templates.instance_methods.map(&:to_sym) +
[:mab] - [:find_template, :markaby]),

View file

@ -50,7 +50,6 @@ EOF
s.add_development_dependency "liquid"
s.add_development_dependency "redcarpet"
s.add_development_dependency "asciidoctor"
s.add_development_dependency "radius"
s.add_development_dependency "nokogiri"
s.add_development_dependency "markaby"
s.add_development_dependency "rake", "< 11"

View file

@ -90,7 +90,7 @@ RSpec.describe Sinatra::ContentFor do
end
end
# TODO: liquid radius markaby builder nokogiri
# TODO: liquid markaby builder nokogiri
engines = %w[erb erubi haml hamlit slim]
engines.each do |inner|

View file

@ -1,59 +0,0 @@
require File.expand_path('helper', __dir__)
begin
require 'radius'
class RadiusTest < Minitest::Test
def radius_app(&block)
mock_app do
set :views, __dir__ + '/views'
get('/', &block)
end
get '/'
end
it 'renders inline radius strings' do
radius_app { radius '<h1>Hiya</h1>' }
assert ok?
assert_equal "<h1>Hiya</h1>", body
end
it 'renders .radius files in views path' do
radius_app { radius :hello }
assert ok?
assert_equal "<h1>Hello From Radius</h1>\n", body
end
it "renders with inline layouts" do
mock_app do
layout { "<h1>THIS. IS. <r:yield /></h1>" }
get('/') { radius '<EM>SPARTA</EM>' }
end
get '/'
assert ok?
assert_equal "<h1>THIS. IS. <EM>SPARTA</EM></h1>", body
end
it "renders with file layouts" do
radius_app { radius 'Hello World', :layout => :layout2 }
assert ok?
assert_equal "<h1>Radius Layout!</h1>\n<p>Hello World</p>\n", body
end
it "raises error if template not found" do
mock_app { get('/') { radius :no_such_template } }
assert_raises(Errno::ENOENT) { get('/') }
end
it "allows passing locals" do
radius_app {
radius '<r:value />', :locals => { :value => 'foo' }
}
assert ok?
assert_equal 'foo', body
end
end
rescue LoadError
warn "#{$!}: skipping radius tests"
end

View file

@ -1 +0,0 @@
<h1>Hello From Radius</h1>

View file

@ -1,2 +0,0 @@
<h1>Radius Layout!</h1>
<p><r:yield /></p>