Sha256: 757f65db885a62283f0efd809946cb7a62db5bc300fe62092fc2bec5051ff9cb
Contents?: true
Size: 1.46 KB
Versions: 18
Compression:
Stored size: 1.46 KB
Contents
# -*- encoding : utf-8 -*- class Card; module Set; module All; module AllCsv; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/02_basic_types/set/all/all_csv.rb ~~~~~~~~~~~ require 'csv' format :csv do def get_inclusion_defaults nested_card { view: :core } end def default_item_view @depth == 0 ? :csv_row : :name end view :csv_row do |args| array = _render_raw.scan( /\{\{[^\}]*\}\}/ ).map do |inc| process_content( inc ).strip end CSV.generate_line(array).strip #strip is because search already joins with newlines end view :missing do |args| '' end view :csv_title_row do |args| #NOTE: assumes all cards have the same structure! begin card1 = search_results.first parsed_content = Card::Content.new card1.raw_content, self unless String === parsed_content.__getobj__ titles = parsed_content.map do |chunk| next if chunk.class != Card::Chunk::Include opts = chunk.options if ['name','link'].member? opts[:view] opts[:view] else opts[:inc_name].to_name.tag end end.compact.map {|title| title.to_s.upcase } CSV.generate_line titles else '' end rescue '' end end end # ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/02_basic_types/set/all/all_csv.rb ~~~~~~~~~~~ end;end;end;end;
Version data entries
18 entries across 18 versions & 1 rubygems