Gem Version Ubuntu Build Status OSX Build Status Windows Build Status Code Climate Pull Requests Commits since latest

Purpose

The stepmod-utils Ruby gem provides a number of tools to work with the STEPmod repository.

CVS to Git migration procedures

Installation

gem install stepmod-utils

Or include it in your gemspec.

Usage

# Extracts from current directory
$ stepmod-extract-terms

# Extracts from specified stepmod/ or stepmod/data/ directory
$ stepmod-extract-terms {stepmod-data-directory}

Then these files will be created:

  • 031-generated-terms.adoc all terms extracted

  • 991-generated-bibliography.adoc all bibliographic sources where the terms come from

Conversion of STEPmod descriptions.xml into adoc

$ stepmod-convert-express-description /path/to/the/stepmod/descriptions.xml

Example output:

(*"application_context_schema"

*)
(*"application_context_schema.exchange_identification_context_select"
 The *exchange\_identification\_context\_select* type allows for the designation of the data types express_ref:[management_resources_schema:ir_express:management_resources_schema.identification_assignment] and express_ref:[person_organization_schema:ir_express:person_organization_schema.organization] .
*)
(*"application_context_schema.application_context"
 An *application\_context*, as defined in ISO 10303-1, is a context in which product data is defined and has meaning. An *application\_context* represents various types of information that relate to product data and may affect the meaning and usage of that data.
*)
(*"application_context_schema.application_context.application"

the express_ref:[support_resource_schema:ir_express:support_resource_schema.label] by which the *application\_context* is known.

[NOTE]
--
The meaning of this attribute can be defined in the annotated EXPRESS schemas that use or specialize this entity, or in an agreement of common understanding between the partners sharing this information.
--

*)

Conversion of STEPmod resource.xml into adoc

Given resource.xml file contents:

<schema name="contract_schema" number="8369" version="3">
  <introduction>
    The subject of the <b>contract_schema</b> is the description of contract agreements.
  </introduction>
  <fund_cons>
    Contract information may be attached to any aspect of a product data.
  </fund_cons>
  <express-g>
    <imgfile file="contract_schemaexpg1.xml"/>
    <imgfile file="contract_schemaexpg2.xml"/>
  </express-g>
</schema>

Command:

$ stepmod-convert-express-resource resource.xml

Will give output:

== Introduction

The subject of the *contract_schema* is the description of contract agreements.

== Fundamental concerns

Contract information may be attached to any aspect of a product data.

expg_image:contract_schemaexpg1.xml[]
expg_image:contract_schemaexpg2.xml[]

CVS revision detection

If the STEPmod repository is a CVS repository, it will display the working and repository revisions as comments.

Warning
CVS revision detection can be slow! Be patient.

Sample output:

[stepmod-utils] INFO: STEPmod directory set to ../x/stepmod/.
[stepmod-utils] INFO: STEPmod directory is a CVS repository and will detect revisions.
[stepmod-utils] INFO: [CVS] Detecting file revisions can be slow, please be patient!
[stepmod-utils] INFO: Detecting paths...
[stepmod-utils] INFO: Processing XML file data/business_object_models/managed_model_based_3d_engineering/business_object_model.xml
[stepmod-utils] INFO: Detecting CVS revision...
[stepmod-utils] INFO: CVS working rev (1.148), repo rev (1.148)
[stepmod-utils] INFO: Completed processing XML file data/business_object_models/managed_model_based_3d_engineering/business_object_model.xml
[stepmod-utils] INFO: Processing XML file data/business_object_models/managed_model_based_3d_engineering_domain/business_object_model.xml
[stepmod-utils] INFO: Detecting CVS revision...
[stepmod-utils] INFO: CVS working rev (1.31), repo rev (1.31)
[stepmod-utils] INFO: Completed processing XML file data/business_object_models/managed_model_based_3d_engineering_domain/business_object_model.xml
...
 stepmod/data/business_object_models/managed_model_based_3d_engineering_domain/business_object_model.xml
[stepmod-utils] INFO: written to: 031-generated-terms.adoc
[stepmod-utils] INFO: written to: 991-generated-bibliography.adoc

Non-CVS repository

If the STEPmod repository is not a CVS repository, or if the cvs executable cannot be found, term extract will still work.

Sample output:

[stepmod-utils] INFO: STEPmod directory set to ../iso-10303-stepmod.
[stepmod-utils] INFO: STEPmod directory is not a CVS repository, skipping revision detection.
[stepmod-utils] INFO: Detecting paths...
[stepmod-utils] INFO: Processing XML file data/application_protocols/boundary_representation_for_iso_14306_open_jt/application_protocol.xml
[stepmod-utils] INFO: skipped ISO/CD 10303-243 as it is not IS, DIS or TS
[stepmod-utils] INFO: Processing XML file data/application_protocols/configuration_control_3d_design_ed2/application_protocol.xml
[stepmod-utils] INFO: Completed processing XML file data/application_protocols/configuration_control_3d_design_ed2/application_protocol.xml
[stepmod-utils] INFO: Processing XML file data/application_protocols/electronic_assembly_interconnect_and_packaging_design/application_protocol.xml
[stepmod-utils] INFO: skipped ISO/CD 10303-210:2019 as it is not IS, DIS or TS
[stepmod-utils] INFO: Processing XML file data/application_protocols/functional_data_and_their_schematic_representation_for_process_plant/application_protocol.xml
[stepmod-utils] INFO: Completed processing XML file data/application_protocols/functional_data_and_their_schematic_representation_for_process_plant/application_protocol.xml
...