Sha256: 0372fd29e3d91de494cfb50c7e340dd6289d8930c5a9534ae97bc8a5be231360

Contents?: true

Size: 1.72 KB

Versions: 3

Compression:

Stored size: 1.72 KB

Contents

# YAML Template for Datashift Import/Export Configuration
#  Defaults, overrides etc are keyed by CLASS and the OPERATOR
<%= @key -%>:
  <%= @klass -%>:
    defaults:
      <%= "#<operator>: <value>" if(@defaults.empty?) %>
  <% @defaults.each do |k, v| -%>
      <%= "#{k}: #{v}" %>
  <% end %>

    overrides:
  <% if(@overrides.empty?) %>
      <%= "#<operator>: <value>" if(@overrides.empty?) %>
  <% end %>
  <% @overrides.each do |k, v| -%>
      <% k %>: <% v %>
  <% end -%>

    # Expects a tuple (list with 2 entries), the rule and the replacement
    substitutions:
  <% if(@substitutions.empty?) %>
      <%= "#- rule"  %>
      <%= "#- replacement" %>
  <% end %>
  <% @substitutions.each do |k, v| -%>
      <% k %>:
        - <% v.first %>
        - <% v.last %>
  <% end -%>

    prefixes:
      <%= "#<operator>: <value>" if(@prefixs.empty?) %>
  <% @prefixs.each do |k, v| -%>
      <%= k %>: <%= v %>
  <% end -%>

    postfixes:
  <%= "    #<operator>: <value>" if(@postfixs.empty?) %>
  <% @postfixs.each do |k, v| -%>
      <%= k %>: <%= v %>
  <% end -%>

  <% unless(@headers.empty?) %>
    # Mappings between inbound column names and internal names
    # are only required when datashift cannot guess the mapping itself
    # It will automatically map headings like :
    #  'Product properties' or 'Product_Properties', 'product Properties' etc to product_properties
    #
    # Heading is optional - Custom/internal operators can be provided called on a per row basis
    #
    nodes:
    <% @headers.each_with_index do |s, i| %>
      - <%= s %>:
          # heading:
          #   source: <%= s %>
          #   presentation: <%= s %>
          # operator
          # operator_type: (defaults to :method)
    <% end %>
  <% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datashift-0.40.4 lib/datashift/templates/import_export_config.erb
datashift-0.40.3 lib/datashift/templates/import_export_config.erb
datashift-0.40.1 lib/datashift/templates/import_export_config.erb