Module: RailsClientChecker::CheckerHelper

Defined in:
app/helpers/rails_client_checker/checker_helper.rb

Instance Method Summary collapse

Instance Method Details

#checker_enabled?(name) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/helpers/rails_client_checker/checker_helper.rb', line 23

def checker_enabled?(name)
  ::RailsClientChecker.config.checkers.include? name
end

#inline_asset(name) ⇒ Object



4
5
6
7
# File 'app/helpers/rails_client_checker/checker_helper.rb', line 4

def inline_asset(name)
  assets = Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)
  assets.find_asset(name).to_s
end

#inline_javascript_tag(name) ⇒ Object



9
10
11
12
13
14
# File 'app/helpers/rails_client_checker/checker_helper.rb', line 9

def inline_javascript_tag(name)
  ("<script type='text/javascript'>\n" +
  inline_asset(name) +
  "\n</script>")
  .html_safe
end

#inline_stylesheet_tag(name) ⇒ Object



16
17
18
19
20
21
# File 'app/helpers/rails_client_checker/checker_helper.rb', line 16

def inline_stylesheet_tag(name)
  ("<style>\n" +
  inline_asset(name) +
  "\n</style>")
  .html_safe
end