<commit_before>require "placeholdit/version"

module Placeholdit
  module ViewHelpers
    def placeholdit_image_tag(size, opts={})

      size = "#{size}" unless size.is_a?(String)
      src = "http://placehold.it/#{size}"

      config = {
        :alt => (opts[:text] || "A placeholder image"),
        :class => "placeholder",
        :height => (size.split('x')[1] || size.split('x')[0]),
        :width => size.split('x')[0],
        :title => opts[:title]
      }.merge!(opts)

      # Placehold.it preferences
      if config[:background_color]
        src += "/#{remove_hex_pound(config[:background_color])}"
      end
      if config[:text_color]
        src += "/#{remove_hex_pound(config[:text_color])}"
      end
      if config[:text]
        src += "&text=#{config[:text]}"
      end

      image_tag = "<img src='#{src}' alt='#{config[:alt]}' class='#{config[:class]}' height='#{config[:height]}' width='#{config[:width]}'"
      image_tag += " title='#{config[:title]}'" if config[:title]
      image_tag += " style='#{config[:style]}'" if config[:style]
      image_tag += " />"
      return image_tag.html_safe if defined?(Rails)
      image_tag
    end
<commit_msg>Use https for the placeholdit url<commit_after>require "placeholdit/version"

module Placeholdit
  module ViewHelpers
    def placeholdit_image_tag(size, opts={})

      size = "#{size}" unless size.is_a?(String)
      src = "https://placehold.it/#{size}"

      config = {
        :alt => (opts[:text] || "A placeholder image"),
        :class => "placeholder",
        :height => (size.split('x')[1] || size.split('x')[0]),
        :width => size.split('x')[0],
        :title => opts[:title]
      }.merge!(opts)

      # Placehold.it preferences
      if config[:background_color]
        src += "/#{remove_hex_pound(config[:background_color])}"
      end
      if config[:text_color]
        src += "/#{remove_hex_pound(config[:text_color])}"
      end
      if config[:text]
        src += "&text=#{config[:text]}"
      end

      image_tag = "<img src='#{src}' alt='#{config[:alt]}' class='#{config[:class]}' height='#{config[:height]}' width='#{config[:width]}'"
      image_tag += " title='#{config[:title]}'" if config[:title]
      image_tag += " style='#{config[:style]}'" if config[:style]
      image_tag += " />"
      return image_tag.html_safe if defined?(Rails)
      image_tag
    end

{'fraction_non_alphanumeric': 0.19673503557974048, 'fraction_numerical': 0.0025115110925073253, 'mean_word_length': 3.0924657534246576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1412080', 'n_tokens_mistral': 766, 'n_tokens_neox': 785, 'n_words': 145}