<commit_before>packager = ShippingMaterials::Packager.new

orders = Orders.where(state: 'placed')

packager.package orders do
  packing_slip :pdf, template: 'path/to/template',
                     layout:   'path/to/layout'

  sort(:line_items) {
    rule { type == 'Vinyl' }
    rule { type == 'CD' }
    rule { type == 'Cassette' }

    after_each_by_attr_desc(:quantity)
  }

  sort {
    rule { line_items.detect {|li| li.type == 'vinyl' } }
  }

  group 'canada_standard_shipping' do
    filter { country == 'CA' && shipping_method == 'std' }

    csv(extenstion: 'txt', headers: true) {
      row code:     'Q',
          order_id: :id,
          hello:    :hello

      row line_items: [ 'H', :id, :name, :price, :quantity ]
    }

    sort {

    }
  end
end<commit_msg>Flesh out example file (but only a little)<commit_after>ShippingMaterials.config do |config|
  config.save_path = MyProject::Config[:asset_storage_location]
end

packager = ShippingMaterials::Packager.new

orders = Orders.where(state: 'placed')

packager.package orders do
  packing_slip :pdf, template: 'path/to/template',
                     layout:   'path/to/layout'

  sort(:line_items) {
    rule { type == 'Vinyl' }
    rule { type == 'CD' }
    rule { type == 'Cassette' }

    after_each(:quantity)
  }

  sort {
    rule { line_items.detect {|li| li.type == 'vinyl' } }
  }

  group 'canada_standard_shipping' do
    filter { country == 'CA' && shipping_method == 'std' }

    csv(extenstion: 'txt', headers: true) do
      row code:     'Q',
          order_id: :id,
          hello:    :hello

      row line_items: [ 'H', :id, :name, :price, :quantity ]
    end
  end
end
{'fraction_non_alphanumeric': 0.14302884615384615, 'fraction_numerical': 0.0, 'mean_word_length': 2.659340659340659, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3783791', 'n_tokens_mistral': 603, 'n_tokens_neox': 564, 'n_words': 133}