<commit_before>module Spree
  module ActiveSaleEventsHelper
    
    def sale_event_timer(event = nil, layout = nil)
      return I18n.t('spree.active_sale.event.can_not_be_nil') if (event == nil) || (event.class.name != "Spree::ActiveSaleEvent")
      layout ||= '{dn} DAYS {hnn}{sep}{mnn}{sep}{snn}'
      content_tag(:span, I18n.t('spree.active_sale.event.ending_message'), :class => 'sale_event_message') + " " + content_tag(:span, event.end_date.strftime('%Y-%m-%dT%H:%M:%S'), "data-timer" => event.end_date.strftime('%Y-%m-%dT%H:%M:%S'), "data-layout" => layout, :class => 'sale_event_message')
    end

    def method_missing(method_name, *args, &block)
      if image_style = image_style_from_method_name_for_sale(method_name)
        define_sale_image_method(image_style)
        self.send(method_name, *args)
      else
        super
      end
    end

    def sale_image_available?(sale_event)
      !sale_event.sale_images.empty? || sale_event.eventable_image_available?
    end

    private

    # Returns style of image or nil
    def image_style_from_method_name_for_sale(method_name)
      if style = method_name.to_s.sub(/_event_image$/, '')
        possible_styles = Spree::SaleImage.attachment_definitions[:attachment][:styles]<commit_msg>changing css timer<commit_after>module Spree
  module ActiveSaleEventsHelper
    
    def sale_event_timer(event = nil, layout = nil)
      return I18n.t('spree.active_sale.event.can_not_be_nil') if (event == nil) || (event.class.name != "Spree::ActiveSaleEvent")
      layout ||= '{dn} DAYS {hnn}{sep}{mnn}{sep}{snn}'
      content_tag(:span, I18n.t('spree.active_sale.event.ending_message'), :class => 'sale_event_message') + " " + content_tag(:span, event.end_date.strftime('%Y-%m-%dT%H:%M:%S'), "data-timer" => event.end_date.strftime('%Y-%m-%dT%H:%M:%S'), "data-layout" => layout, :class => 'sale_event_message_timer')
    end

    def method_missing(method_name, *args, &block)
      if image_style = image_style_from_method_name_for_sale(method_name)
        define_sale_image_method(image_style)
        self.send(method_name, *args)
      else
        super
      end
    end

    def sale_image_available?(sale_event)
      !sale_event.sale_images.empty? || sale_event.eventable_image_available?
    end

    private

    # Returns style of image or nil
    def image_style_from_method_name_for_sale(method_name)
      if style = method_name.to_s.sub(/_event_image$/, '')
        possible_styles = Spree::SaleImage.attachment_definitions[:attachment][:styles]
{'fraction_non_alphanumeric': 0.13929560743965175, 'fraction_numerical': 0.0031658092599920855, 'mean_word_length': 4.212371134020619, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '2971043', 'n_tokens_mistral': 904, 'n_tokens_neox': 867, 'n_words': 133}