Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for safe_level, trim_mode argument of ERB.new is deprecated warning #550

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ gem 'rubyzip', rubyzip_version if rubyzip_version && !rubyzip_version.empty?

group :development, :test do
gem 'rdoc', ['>= 3.10', '< 4.3'], :require => nil
gem 'dotenv'
end
2 changes: 1 addition & 1 deletion lib/warbler/jar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def add_with_pathmaps(config, f, map_type)

def expand_erb(file, config)
require 'erb'
erb = ERB.new(File.read(file), nil, '-')
erb = ERB.new(File.read(file), trim_mode: '-')
StringIO.new(erb.result(erb_binding(config)))
end

Expand Down
16 changes: 14 additions & 2 deletions spec/warbler/web_server_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require File.expand_path('../../spec_helper', __FILE__)
require 'dotenv'


class Warbler::WebServer::Artifact
def self.reset_local_repository
Expand All @@ -8,9 +10,19 @@ def self.reset_local_repository

describe Warbler::WebServer::Artifact do

@@_env = ENV.to_h
#@@_env = ENV.to_h
Dotenv.load

before(:all) do
@original_env = ENV.to_h
end

after(:all) do
ENV.clear
@original_env.each { |k, v| ENV[k] = v }
end

after(:all) { ENV.clear; ENV.update @@_env }
# after(:all) { ENV.clear; ENV.update @@_env }

before do
Warbler::WebServer::Artifact.reset_local_repository
Expand Down
Loading