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

tag_builder.method for rails 5.1 #77

Open
wants to merge 3 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
10 changes: 9 additions & 1 deletion lib/rails_rinku.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ def rinku_auto_link(text, *args, &block)
options.reverse_merge!(:link => :all, :html => {})
text = h(text) unless text.html_safe?

tag_options_method = if Gem::Version.new(Rails.version) >= Gem::Version.new("5.1")
# Rails >= 5.1
tag_builder.method(:tag_options)
else
# Rails <= 5.0
method(:tag_options)
end

Rinku.auto_link(
text,
options[:link],
tag_options(options[:html]),
tag_options_method.call(options[:html]),
options[:skip],
&block
).html_safe
Expand Down
2 changes: 1 addition & 1 deletion lib/rinku.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Rinku
VERSION = "2.0.2"
VERSION = "2.0.5"

class << self
attr_accessor :skip_tags
Expand Down
2 changes: 1 addition & 1 deletion rinku.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'rinku'
s.version = '2.0.2'
s.version = '2.0.5'
s.summary = "Mostly autolinking"
s.description = <<-EOF
A fast and very smart autolinking library that
Expand Down