<commit_before><%
  cal = Icalendar::Calendar.new

  #アイテムの投入
  @user_products.map{|up| up.product}.each do |product|
    #時刻
    start_date = Time.at(product.release_date.to_i)
    end_date = Time.at(start_date.to_i + 24*3600)

    #タイトル
    title = product.title
    title += "(発売日未確定)" unless product.a_release_date_fixed

    #リンク先
    detail_url = url_for(
      :controller => :products,
      :action => :show,
      :id => product.ean,
      :only_path => false
    )

    #解説文
    product_desc = []
    product_desc.push("#{author_label(product.category)}: #{product.authors.join('/')}") unless product.authors.empty?
    product_desc.push("#{maker_label(product.category)}: #{product.manufacturer}")

    url = url_for(
      :controller => :products,
      :action => :to_amazon,
      :id => product.ean,
      :only_path => false
    )
    product_desc.push("Amazon.co.jp: #{url}") unless product.a_title.nil?

    url = url_for(
      :controller => :products,
      :action => :to_rakuten,
      :id => product.ean,
      :only_path => false
    )
    product_desc.push("楽天ブックス: #{url}") unless product.r_title.nil?

    product_desc = product_desc.join('\n')

    cal.event do |event|
      event.uid = "dokusho-#{product.id}@#{request.domain}"
      event.dtstart = Icalendar::Values::Date.new(start_date.strftime('%Y%m%d'))
      event.dtend = Icalendar::Values::Date.new(end_date.strftime('%Y%m%d'))
      event.summary = title<commit_msg>ics出力時にundefined method が出る問題を修正<commit_after><%
  cal = Icalendar::Calendar.new

  #アイテムの投入
  @user_products.map{|up| up.product}.each do |product|
    #時刻
    start_date = Time.at(product.release_date.to_i)
    end_date = Time.at(start_date.to_i + 24*3600)

    #タイトル
    title = product.title
    title += "(発売日未確定)" unless product.a_release_date_fixed

    #リンク先
    detail_url = url_for(
      :controller => :products,
      :action => :show,
      :id => product.ean,
      :only_path => false
    )

    #解説文
    product_desc = []
    product_desc.push("#{author_label(product.category)}: #{product.authors.join('/')}") unless product.authors.blank?
    product_desc.push("#{maker_label(product.category)}: #{product.manufacturer}")

    url = url_for(
      :controller => :products,
      :action => :to_amazon,
      :id => product.ean,
      :only_path => false
    )
    product_desc.push("Amazon.co.jp: #{url}") unless product.a_title.nil?

    url = url_for(
      :controller => :products,
      :action => :to_rakuten,
      :id => product.ean,
      :only_path => false
    )
    product_desc.push("楽天ブックス: #{url}") unless product.r_title.nil?

    product_desc = product_desc.join('\n')

    cal.event do |event|
      event.uid = "dokusho-#{product.id}@#{request.domain}"
      event.dtstart = Icalendar::Values::Date.new(start_date.strftime('%Y%m%d'))
      event.dtend = Icalendar::Values::Date.new(end_date.strftime('%Y%m%d'))
      event.summary = title
{'fraction_non_alphanumeric': 0.16286201022146507, 'fraction_numerical': 0.0040885860306643955, 'mean_word_length': 3.1645390070921984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '1854687', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1075, 'n_words': 163}