Skip to content

Commit

Permalink
remove erubis dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jjb committed Oct 12, 2021
1 parent 45987f2 commit adddd75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion heroics.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'yard'
spec.add_development_dependency 'pry'

spec.add_dependency 'erubis', '~> 2.0'
spec.add_dependency 'excon'
spec.add_dependency 'multi_json', '>= 1.9.2'
spec.add_dependency 'moneta'
Expand Down
2 changes: 1 addition & 1 deletion lib/heroics.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'base64'
require 'erubis'
require 'erb'
require 'excon'
require 'multi_json'
require 'uri'
Expand Down
7 changes: 5 additions & 2 deletions lib/heroics/client_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ module Heroics
# option if you want to ship a gem or generate API documentation using Yard.
def self.generate_client
filename = File.dirname(__FILE__) + '/views/client.erb'
eruby = Erubis::Eruby.new(File.read(filename))
eruby = ERB.new(File.read(filename))
context = build_context(Heroics::Configuration.defaults.module_name,
Heroics::Configuration.defaults.schema,
Heroics::Configuration.defaults.base_url,
Heroics::Configuration.defaults.options)
eruby.evaluate(context)
context.each do |k, v|
instance_variable_set(:"@#{k}", v)
end
eruby.result(binding)
end

private
Expand Down

0 comments on commit adddd75

Please sign in to comment.