Skip to content

Commit

Permalink
break: Drop "Less" templating support
Browse files Browse the repository at this point in the history
This removes the support for the defunct Less templating library, and
removes the therubyracer dependency, which was used to run tests for
it.

See #1716, #1715 for more discussion and background.
  • Loading branch information
olleolleolle authored and jkowens committed Feb 2, 2022
1 parent 26745b0 commit d1af2f1
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 93 deletions.
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ if RUBY_ENGINE == 'jruby' || RUBY_ENGINE == 'ruby'
end

if RUBY_ENGINE == "ruby"
gem 'less', '~> 2.0'
gem 'therubyracer'
gem 'redcarpet'
gem 'wlang', '>= 3.0.1'
gem 'bluecloth'
Expand Down
7 changes: 1 addition & 6 deletions lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def with_params(temp_params)
# Possible options are:
# :content_type The content type to use, same arguments as content_type.
# :layout If set to something falsy, no layout is rendered, otherwise
# the specified layout is used (Ignored for `sass` and `less`)
# the specified layout is used (Ignored for `sass`)
# :layout_engine Engine to use for rendering the layout.
# :locals A hash with local variables that should be available
# in the template
Expand Down Expand Up @@ -727,11 +727,6 @@ def scss(template, options = {}, locals = {})
render :scss, template, options, locals
end

def less(template, options = {}, locals = {})
options.merge! :layout => false, :default_content_type => :css
render :less, template, options, locals
end

def builder(template = nil, options = {}, locals = {}, &block)
options[:default_content_type] = :xml
render_ruby(:builder, template, options, locals, &block)
Expand Down
3 changes: 0 additions & 3 deletions sinatra-contrib/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ group :development, :test do
gem 'nokogiri', '1.5.10'
gem 'redcarpet', '2.3.0'
gem 'yajl-ruby'
# ref is a dependency of therubyracer
gem 'ref'
gem 'therubyracer'
end

gem 'multi_json'
Expand Down
5 changes: 0 additions & 5 deletions sinatra-contrib/lib/sinatra/engine_tracking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ def scss?
@current_engine == :scss
end

# @return [Boolean] Returns true if current engine is `:less`.
def less?
@current_engine == :less
end

# @return [Boolean] Returns true if current engine is `:builder`.
def builder?
@current_engine == :builder
Expand Down
2 changes: 1 addition & 1 deletion sinatra-contrib/lib/sinatra/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ module NamespacedMethods

ALLOWED_ENGINES = [
:erb, :erubi, :erubis, :haml, :hamlit, :builder, :nokogiri, :sass, :scss,
:less, :liquid, :markdown, :textile, :rdoc, :asciidoc, :radius, :markaby,
:liquid, :markdown, :textile, :rdoc, :asciidoc, :radius, :markaby,
:rabl, :slim, :creole, :mediawiki, :coffee, :yajl, :wlang
]

Expand Down
2 changes: 1 addition & 1 deletion sinatra-contrib/lib/sinatra/respond_with.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def self.jrubyify(engs)

def self.engines
engines = {
:css => [:less, :sass, :scss],
:css => [:sass, :scss],
:xml => [:builder, :nokogiri],
:js => [:coffee],
:html => [:erb, :erubi, :erubis, :haml, :hamlit, :slim, :liquid, :radius,
Expand Down
1 change: 0 additions & 1 deletion sinatra-contrib/sinatra-contrib.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ EOF
s.add_development_dependency "erubi"
s.add_development_dependency "erubis"
s.add_development_dependency "slim"
s.add_development_dependency "less"
s.add_development_dependency "sass"
s.add_development_dependency "builder"
s.add_development_dependency "liquid"
Expand Down
69 changes: 0 additions & 69 deletions test/less_test.rb

This file was deleted.

5 changes: 0 additions & 5 deletions test/views/hello.less

This file was deleted.

0 comments on commit d1af2f1

Please sign in to comment.