stepmod-utils 0.3.4 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -11
  3. data/.github/workflows/release.yml +7 -5
  4. data/.hound.yml +5 -0
  5. data/.rubocop.yml +10 -0
  6. data/Gemfile +3 -3
  7. data/Rakefile +1 -1
  8. data/exe/stepmod-annotate-all +17 -11
  9. data/exe/stepmod-build-resource-docs-cache +8 -7
  10. data/exe/stepmod-convert-express-description +6 -4
  11. data/exe/stepmod-convert-express-resource +6 -4
  12. data/exe/stepmod-extract-terms +68 -30
  13. data/exe/stepmod-find-express-files +8 -7
  14. data/lib/stepmod/utils/bibdata.rb +31 -35
  15. data/lib/stepmod/utils/cleaner.rb +3 -3
  16. data/lib/stepmod/utils/concept.rb +107 -34
  17. data/lib/stepmod/utils/converters/a.rb +7 -10
  18. data/lib/stepmod/utils/converters/blockquote.rb +4 -4
  19. data/lib/stepmod/utils/converters/br.rb +1 -1
  20. data/lib/stepmod/utils/converters/bypass.rb +33 -33
  21. data/lib/stepmod/utils/converters/clause_ref.rb +3 -3
  22. data/lib/stepmod/utils/converters/code.rb +1 -1
  23. data/lib/stepmod/utils/converters/comment.rb +5 -3
  24. data/lib/stepmod/utils/converters/dd.rb +2 -2
  25. data/lib/stepmod/utils/converters/def.rb +19 -19
  26. data/lib/stepmod/utils/converters/drop.rb +2 -2
  27. data/lib/stepmod/utils/converters/dt.rb +2 -2
  28. data/lib/stepmod/utils/converters/em.rb +1 -1
  29. data/lib/stepmod/utils/converters/em_express_description.rb +1 -1
  30. data/lib/stepmod/utils/converters/eqn.rb +28 -26
  31. data/lib/stepmod/utils/converters/example.rb +5 -6
  32. data/lib/stepmod/utils/converters/express_g.rb +10 -9
  33. data/lib/stepmod/utils/converters/express_ref.rb +2 -2
  34. data/lib/stepmod/utils/converters/express_ref_express_description.rb +3 -2
  35. data/lib/stepmod/utils/converters/ext_description.rb +1 -1
  36. data/lib/stepmod/utils/converters/figure.rb +3 -3
  37. data/lib/stepmod/utils/converters/fund_cons.rb +1 -1
  38. data/lib/stepmod/utils/converters/head.rb +3 -2
  39. data/lib/stepmod/utils/converters/hr.rb +2 -2
  40. data/lib/stepmod/utils/converters/ignore.rb +3 -3
  41. data/lib/stepmod/utils/converters/introduction.rb +1 -1
  42. data/lib/stepmod/utils/converters/module_ref.rb +7 -7
  43. data/lib/stepmod/utils/converters/note.rb +5 -6
  44. data/lib/stepmod/utils/converters/ol.rb +7 -5
  45. data/lib/stepmod/utils/converters/p.rb +2 -2
  46. data/lib/stepmod/utils/converters/pass_through.rb +2 -2
  47. data/lib/stepmod/utils/converters/q.rb +1 -1
  48. data/lib/stepmod/utils/converters/schema.rb +1 -1
  49. data/lib/stepmod/utils/converters/stem.rb +1 -1
  50. data/lib/stepmod/utils/converters/stepmod_ext_description.rb +10 -6
  51. data/lib/stepmod/utils/converters/strong.rb +7 -4
  52. data/lib/stepmod/utils/converters/sub.rb +2 -2
  53. data/lib/stepmod/utils/converters/sup.rb +2 -2
  54. data/lib/stepmod/utils/converters/synonym.rb +2 -2
  55. data/lib/stepmod/utils/converters/table.rb +7 -9
  56. data/lib/stepmod/utils/converters/term.rb +27 -9
  57. data/lib/stepmod/utils/converters/text.rb +11 -13
  58. data/lib/stepmod/utils/converters/uof.rb +3 -4
  59. data/lib/stepmod/utils/html_to_asciimath.rb +91 -90
  60. data/lib/stepmod/utils/smrl_description_converter.rb +34 -33
  61. data/lib/stepmod/utils/smrl_resource_converter.rb +50 -49
  62. data/lib/stepmod/utils/stepmod_definition_converter.rb +39 -38
  63. data/lib/stepmod/utils/stepmod_file_annotator.rb +26 -19
  64. data/lib/stepmod/utils/terms_extractor.rb +138 -86
  65. data/lib/stepmod/utils/version.rb +1 -1
  66. data/stepmod-utils.gemspec +11 -6
  67. metadata +60 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 887612180cfe004fb244d41e7c553858ed441d5e4c60c8d27d06fb7ec3219cd2
4
- data.tar.gz: f7f25caa5652593b6eafcb792206614f2b053e56a0dd05801018e2217533b636
3
+ metadata.gz: 8838f07a6b887ff87b6067b7a82b02e605bfc97c81ed345642b68c9d8d4e6a5b
4
+ data.tar.gz: 213824aa6f2b832d941d6575005f7c43c60f5332a1c285f973efa05d52090b86
5
5
  SHA512:
6
- metadata.gz: 41057b14b1c6ab326dff8e402be3a74737e9479212a76577a9ef81738da9f542ab6cbd892723949b004a2a6ff6058525aed5de47b1fbe3859ac139a724028608
7
- data.tar.gz: 519d9daa5451c17f60e6e2e764405908bf7e3c9f6b7279dcef9ee2bb554c63a0535b1e63c3aaed178549413a2253e24a3687c86d1ad60c8fa569c65aed756647
6
+ metadata.gz: '088fe0671024dd6e5fb69960c379d52e25345546ba5f87b8167d37e26fd8315074ba7b7028757d610a1c18fffe560485cc65937157cad72a32445dfef836a415'
7
+ data.tar.gz: 176cde1360b6f3a229c05eb50fe606892d106101dab6e3e7c1aafb15467602d9650107151a58eb9f3ac56a2f93411ccd3131e749a3974c247f6c4cdc76f5e414
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
@@ -9,7 +9,7 @@ on:
9
9
  description: |
10
10
  Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
11
11
  required: true
12
- default: 'patch'
12
+ default: 'skip'
13
13
  push:
14
14
  tags: [ v* ]
15
15
 
@@ -22,21 +22,23 @@ jobs:
22
22
  - uses: ruby/setup-ruby@v1
23
23
  with:
24
24
  ruby-version: '2.6'
25
+ bundler-cache: true
25
26
 
26
27
  - run: gem install gem-release
27
28
 
28
- - if: ${{ github.event_name == 'workflow_dispatch' }}
29
- run: |
29
+ - run: |
30
30
  git config user.name github-actions
31
31
  git config user.email github-actions@github.com
32
- gem bump --version ${{ github.event.inputs.next_version }} --tag --push
32
+
33
+ - if: github.event_name == 'workflow_dispatch' && github.event.inputs.next_version != 'skip'
34
+ run: gem bump --version ${{ github.event.inputs.next_version }} --tag --push
33
35
 
34
36
  - name: publish to rubygems.org
35
37
  env:
36
38
  RUBYGEMS_API_KEY: ${{secrets.METANORMA_CI_RUBYGEMS_API_KEY}}
37
39
  run: |
38
40
  gem install gem-release
39
- cat > ~/.gem/credentials << EOF
41
+ envsubst << 'EOF' > ~/.gem/credentials
40
42
  ---
41
43
  :rubygems_api_key: ${RUBYGEMS_API_KEY}
42
44
  EOF
data/.hound.yml ADDED
@@ -0,0 +1,5 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ ruby:
4
+ enabled: true
5
+ config_file: .rubocop.yml
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ inherit_from:
4
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
5
+
6
+ # local repo-specific modifications
7
+ # ...
8
+
9
+ AllCops:
10
+ TargetRubyVersion: 2.5
data/Gemfile CHANGED
@@ -3,9 +3,9 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
7
7
 
8
+ gem "concurrent-ruby", "~> 1.1"
9
+ gem "pry"
8
10
  gem "rake", "~> 12.0"
9
11
  gem "rspec", "~> 3.0"
10
- gem "pry"
11
- gem "concurrent-ruby", "~> 1.1"
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -1,32 +1,38 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'concurrent'
4
- require 'stepmod/utils/stepmod_file_annotator'
3
+ require "concurrent"
4
+ require "stepmod/utils/stepmod_file_annotator"
5
5
 
6
6
  stepmod_dir = ARGV.first || Dir.pwd
7
7
 
8
8
  # build resource_docs cache
9
9
  resource_docs_cache_file = `mktemp`
10
- `"#{File.join(__dir__, 'stepmod-build-resource-docs-cache')}" "#{stepmod_dir}" > "#{resource_docs_cache_file}"`
10
+ `"#{File.join(__dir__,
11
+ "stepmod-build-resource-docs-cache")}" "#{stepmod_dir}" > "#{resource_docs_cache_file}"`
11
12
 
12
13
  # annotate each file
13
- files = `"#{File.join(__dir__, 'stepmod-find-express-files')}" "#{stepmod_dir}"`.strip.split("\n")
14
+ files = `"#{File.join(__dir__,
15
+ "stepmod-find-express-files")}" "#{stepmod_dir}"`.strip.split("\n")
14
16
  MAX_THREADS = [2, Concurrent.processor_count].max * 2
15
17
  MAX_QUEUE_SIZE = MAX_THREADS * 4
16
18
  # https://github.com/ruby-concurrency/concurrent-ruby/blob/master/docs-source/thread_pools.md
17
19
  pool = Concurrent::ThreadPoolExecutor.new(
18
- :min_threads => MAX_THREADS,
19
- :max_threads => MAX_THREADS,
20
- :max_queue => MAX_QUEUE_SIZE,
21
- :fallback_policy => :caller_runs
20
+ min_threads: MAX_THREADS,
21
+ max_threads: MAX_THREADS,
22
+ max_queue: MAX_QUEUE_SIZE,
23
+ fallback_policy: :caller_runs,
22
24
  )
23
25
  files.each_slice(MAX_QUEUE_SIZE) do |batch|
24
26
  puts("Queueing next batch")
25
27
  batch.each do |file|
26
28
  pool.post do
27
29
  puts("#{Thread.current.object_id}: Queued processing #{file}")
28
- annotated = Stepmod::Utils::StepmodFileAnnotator.new(express_file: file, resource_docs_cache_file: resource_docs_cache_file, stepmod_dir: stepmod_dir).call
29
- File.open(File.join(File.dirname(file), "#{File.basename(file, '.exp')}_annotated.exp"), 'w') do |file|
30
+ annotated = Stepmod::Utils::StepmodFileAnnotator.new(express_file: file,
31
+ resource_docs_cache_file: resource_docs_cache_file, stepmod_dir: stepmod_dir).call
32
+ File.open(
33
+ File.join(File.dirname(file),
34
+ "#{File.basename(file, '.exp')}_annotated.exp"), "w"
35
+ ) do |file|
30
36
  file.puts(annotated)
31
37
  end
32
38
  puts("#{Thread.current.object_id}: Done processing #{file}")
@@ -36,4 +42,4 @@ files.each_slice(MAX_QUEUE_SIZE) do |batch|
36
42
  end
37
43
 
38
44
  # cleanup
39
- `rm "#{resource_docs_cache_file}"`
45
+ `rm "#{resource_docs_cache_file}"`
@@ -1,19 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'nokogiri'
4
- require 'json'
3
+ require "nokogiri"
4
+ require "json"
5
5
 
6
6
  stepmod_dir = ARGV.first || Dir.pwd
7
7
 
8
8
  schemas = {}
9
- Dir.glob(File.join(stepmod_dir, 'data/resource_docs/*/resource.xml')).each do |resource_docs_file|
10
- match = resource_docs_file.match('data/resource_docs/([^/]+)/resource.xml')
9
+ Dir.glob(File.join(stepmod_dir,
10
+ "data/resource_docs/*/resource.xml")).each do |resource_docs_file|
11
+ match = resource_docs_file.match("data/resource_docs/([^/]+)/resource.xml")
11
12
  resource_docs_dir = match.captures[0]
12
13
 
13
14
  resource_docs = Nokogiri::XML(File.read(resource_docs_file)).root
14
- resource_docs.xpath('schema').each do |schema|
15
- schemas[schema['name']] = resource_docs_dir
15
+ resource_docs.xpath("schema").each do |schema|
16
+ schemas[schema["name"]] = resource_docs_dir
16
17
  end
17
18
  end
18
19
 
19
- puts JSON.pretty_generate(schemas)
20
+ puts JSON.pretty_generate(schemas)
@@ -11,12 +11,14 @@ $:.unshift File.expand_path("../../lib", bin_file)
11
11
  # Fixes https://github.com/rubygems/rubygems/issues/1420
12
12
  require "rubygems/specification"
13
13
 
14
- class Gem::Specification
15
- def this; self; end
14
+ module Gem
15
+ class Specification
16
+ def this; self; end
17
+ end
16
18
  end
17
19
 
18
- require 'bundler/setup'
19
- require 'stepmod/utils/smrl_description_converter'
20
+ require "bundler/setup"
21
+ require "stepmod/utils/smrl_description_converter"
20
22
 
21
23
  ReverseAdoc.config.unknown_tags = :bypass
22
24
 
@@ -11,12 +11,14 @@ $:.unshift File.expand_path("../../lib", bin_file)
11
11
  # Fixes https://github.com/rubygems/rubygems/issues/1420
12
12
  require "rubygems/specification"
13
13
 
14
- class Gem::Specification
15
- def this; self; end
14
+ module Gem
15
+ class Specification
16
+ def this; self; end
17
+ end
16
18
  end
17
19
 
18
- require 'bundler/setup'
19
- require 'stepmod/utils/smrl_resource_converter'
20
+ require "bundler/setup"
21
+ require "stepmod/utils/smrl_resource_converter"
20
22
 
21
23
  ReverseAdoc.config.unknown_tags = :bypass
22
24
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: UTF-8
3
3
 
4
- require 'pry'
4
+ require "pry"
5
5
  # resolve bin path, ignoring symlinks
6
6
  require "pathname"
7
7
  bin_file = Pathname.new(__FILE__).realpath
@@ -12,12 +12,14 @@ $:.unshift File.expand_path("../../lib", bin_file)
12
12
  # Fixes https://github.com/rubygems/rubygems/issues/1420
13
13
  require "rubygems/specification"
14
14
 
15
- class Gem::Specification
16
- def this; self; end
15
+ module Gem
16
+ class Specification
17
+ def this; self; end
18
+ end
17
19
  end
18
20
 
19
- require 'bundler/setup'
20
- require 'stepmod/utils/terms_extractor'
21
+ require "bundler/setup"
22
+ require "stepmod/utils/terms_extractor"
21
23
 
22
24
  stepmod_dir = ARGV.first || Dir.pwd
23
25
 
@@ -31,7 +33,7 @@ part_modules = Stepmod::Utils::TermsExtractor.call(stepmod_dir)
31
33
  def part_to_title(bibdata)
32
34
  case bibdata.part.to_i
33
35
  when 41
34
- "Part 41"
36
+ "Fundamentals of product description and support"
35
37
  when 42
36
38
  "Geometric and topological representation"
37
39
  when 43
@@ -39,7 +41,7 @@ def part_to_title(bibdata)
39
41
  when 44
40
42
  "Product structure, concept and configuration"
41
43
  when 45
42
- "Part 45"
44
+ "Material and other engineering properties"
43
45
  when 46
44
46
  "Visual presentation"
45
47
  when 47
@@ -51,37 +53,59 @@ def part_to_title(bibdata)
51
53
  end
52
54
  end
53
55
 
54
- def log message
56
+ IMAGE_REPLACEMENTS = {
57
+ 'image::eq01.gif[]' => 'stem:[H(A,B) = max {h(A, B), h(B,A)}]',
58
+ 'image::eq02.gif[]' => 'stem:[max_{a in A} { min_{b in B} d(a,b) }]',
59
+ 'image::vector_z_c.gif[]' => 'stem:[bar z_{c}]',
60
+ 'image::one_direction_repeat_factor_expression.gif[]' => 'stem:[I + k cdot R;  k = -1, 1]',
61
+ 'image::two_direction_repeat_factor_expression.gif[]' => 'stem:[I + k_1 cdot R_1 + k_2 cdot R_2;  k_1, k_2 = -1, 0, 1, k^2_1 + k^2_2 != 0]'
62
+ }
63
+
64
+ def replace_images(content)
65
+ IMAGE_REPLACEMENTS.each_pair do |k, v|
66
+ content.gsub!(k, v)
67
+ end
68
+
69
+ content
70
+ end
71
+
72
+ def log(message)
55
73
  puts "[stepmod-utils] #{message}"
56
74
  end
57
75
 
58
76
  part_concepts.each do |(bibdata, current_part_concepts)|
77
+ current_part_concepts = current_part_concepts.to_a.map do |n|
78
+ n.localizations["en"]
79
+ end
59
80
  fn = "03x-stepmod-#{bibdata.part}.adoc"
60
- File.open(fn, 'w') { |file|
81
+ File.open(fn, "w") do |file|
61
82
  file.puts("== #{part_to_title(bibdata)}\n\n")
62
- file.puts(current_part_concepts.map(&:to_mn_adoc).join("\n"))
63
- }
83
+ file.puts(replace_images(current_part_concepts.map(&:to_mn_adoc).join("\n")))
84
+ end
64
85
  log "INFO: written to: #{fn}"
65
86
  end
66
87
 
67
-
68
88
  part_resources.each do |(bibdata, current_part_resources)|
89
+ current_part_resources = current_part_resources.to_a.map do |n|
90
+ n.localizations["en"]
91
+ end
69
92
  fn = "04x-stepmod-entities-resources-#{bibdata.part}.adoc"
70
- File.open(fn, 'w') { |file|
93
+ File.open(fn, "w") do |file|
71
94
  file.puts("== #{part_to_title(bibdata)}\n\n")
72
- file.puts(current_part_resources.map(&:to_mn_adoc).join("\n"))
73
- }
95
+ file.puts(replace_images(current_part_resources.map(&:to_mn_adoc).join("\n")))
96
+ end
74
97
  log "INFO: written to: #{fn}"
75
98
  end
76
99
 
77
-
78
100
  part_modules.each do |(bibdata, part_modules_arm, part_modules_mim)|
79
101
  fn = "05x-stepmod-entities-modules-#{bibdata.part}.adoc"
80
- File.open(fn, 'w') { |file|
102
+ File.open(fn, "w") do |file|
81
103
  file.puts("")
82
104
  unless part_modules_arm.empty?
83
105
  schema_name = part_modules_arm.first.first
84
- concepts = part_modules_arm.first.last
106
+ concepts = part_modules_arm.first.last.to_a.map do |n|
107
+ n.localizations["en"]
108
+ end
85
109
 
86
110
  # puts "SCHEMA NAME ARM: #{schema_name}"
87
111
  file.puts("== #{schema_name}\n\n")
@@ -94,26 +118,40 @@ part_modules.each do |(bibdata, part_modules_arm, part_modules_mim)|
94
118
  schema_name = part_modules_mim.first.first
95
119
 
96
120
  # puts "SCHEMA NAME MIM: #{schema_name}"
97
- concepts = part_modules_mim.first.last
121
+ concepts = part_modules_mim.first.last.to_a.map do |n|
122
+ n.localizations["en"]
123
+ end
98
124
  file.puts("== #{schema_name}\n\n")
99
- file.puts(concepts.map(&:to_mn_adoc).join("\n"))
125
+ file.puts(replace_images(concepts.map(&:to_mn_adoc).join("\n")))
100
126
  end
101
-
102
- }
127
+ end
103
128
  log "INFO: written to: #{fn}"
104
129
  end
105
130
 
106
- File.open('031-stepmod-general.adoc', 'w') { |file|
107
- file.puts(general_concepts.map(&:to_mn_adoc).join("\n"))
108
- }
131
+ File.open("031-stepmod-general.adoc", "w") do |file|
132
+ file.puts(
133
+ replace_images(
134
+ general_concepts.to_a.map do |n|
135
+ n.localizations["en"]
136
+ end.map(&:to_mn_adoc).join("\n")
137
+ )
138
+ )
139
+ end
140
+
109
141
  log "INFO: written to: 031-stepmod-general.adoc"
110
142
 
111
- File.open('041-stepmod-entities-resources.adoc', 'w') { |file|
112
- file.puts(resource_concepts.map(&:to_mn_adoc).join("\n"))
113
- }
143
+ File.open("041-stepmod-entities-resources.adoc", "w") do |file|
144
+ file.puts(
145
+ replace_images(
146
+ resource_concepts.to_a.map do |n|
147
+ n.localizations["en"]
148
+ end.map(&:to_mn_adoc).join("\n")
149
+ )
150
+ )
151
+ end
114
152
  log "INFO: written to: 041-stepmod-entities-resources.adoc"
115
153
 
116
- File.open('991-generated-bibliography.adoc', 'w') { |file|
154
+ File.open("991-generated-bibliography.adoc", "w") do |file|
117
155
  file.puts(parsed_bibliography.map(&:to_mn_adoc).sort.uniq.join("\n"))
118
- }
156
+ end
119
157
  log "INFO: written to: 991-generated-bibliography.adoc"
@@ -1,23 +1,24 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'nokogiri'
3
+ require "nokogiri"
4
4
 
5
5
  stepmod_dir = ARGV.first || Dir.pwd
6
6
 
7
- index = Nokogiri::XML(File.read(File.join(stepmod_dir, 'repository_index.xml'))).root
7
+ index = Nokogiri::XML(File.read(File.join(stepmod_dir,
8
+ "repository_index.xml"))).root
8
9
 
9
10
  files = []
10
- index.xpath('modules/module').each do |item|
11
+ index.xpath("modules/module").each do |item|
11
12
  files << "#{stepmod_dir}/data/modules/#{item['name']}/arm.exp"
12
13
  files << "#{stepmod_dir}/data/modules/#{item['name']}/mim.exp"
13
14
  end
14
- index.xpath('resources/resource').each do |item|
15
+ index.xpath("resources/resource").each do |item|
15
16
  files << "#{stepmod_dir}/data/resources/#{item['name']}/#{item['name']}.exp"
16
17
  end
17
- index.xpath('business_object_models/business_object_model').each do |item|
18
+ index.xpath("business_object_models/business_object_model").each do |item|
18
19
  files << "#{stepmod_dir}/data/business_object_models/#{item['name']}/bom.exp"
19
20
  files << "#{stepmod_dir}/data/business_object_models/#{item['name']}/DomainModel.exp"
20
21
  end
21
22
 
22
- existing_files = files.filter{|file| File.exists?(file)}
23
- puts existing_files
23
+ existing_files = files.filter { |file| File.exists?(file) }
24
+ puts existing_files
@@ -1,8 +1,6 @@
1
1
  module Stepmod
2
2
  module Utils
3
-
4
3
  class Bibdata
5
-
6
4
  DOCNUMBER = 10303
7
5
 
8
6
  attr_accessor *%w(
@@ -15,23 +13,25 @@ module Stepmod
15
13
  # module, resource, application_protocol, business_object_model
16
14
  @type = document.name
17
15
 
18
- raise 'UnknownFileError' unless %w(module resource application_protocol business_object_model).include?(@type)
16
+ raise "UnknownFileError" unless %w(module resource
17
+ application_protocol business_object_model).include?(@type)
19
18
 
20
- @doctype = document['status']
21
- @part = document['part']
22
- @title_en = document['title'] ||
23
- document['name'].gsub('_', ' ').capitalize.gsub('2d','2D').gsub('3d','3D')
24
- @title_fr = document['name.french']
25
- @version = document['version']
26
- @language = document['language']
19
+ @doctype = document["status"]
20
+ @part = document["part"]
21
+ @title_en = document["title"] ||
22
+ document["name"].gsub("_", " ").capitalize.gsub("2d", "2D").gsub("3d",
23
+ "3D")
24
+ @title_fr = document["name.french"]
25
+ @version = document["version"]
26
+ @language = document["language"]
27
27
 
28
28
  # Some publication.year contains month...
29
- @pub_year = document['publication.year'].split('-').first
30
- @pub_date = document['publication.date']
29
+ @pub_year = document["publication.year"].split("-").first
30
+ @pub_date = document["publication.date"]
31
31
 
32
32
  # puts to_mn_adoc
33
33
 
34
- return self
34
+ self
35
35
  # <module
36
36
  # name="security_classification"
37
37
  # name.french="Classification des s&#233;curit&#233;s"
@@ -54,28 +54,27 @@ module Stepmod
54
54
  # rcs.revision="$Revision: 1.26 $"
55
55
  # development.folder="dvlp"
56
56
  # >
57
-
58
57
  end
59
58
 
60
59
  def docid
61
60
  no_date = case doctype
62
- when "IS"
63
- "ISO #{DOCNUMBER}-#{part}"
64
- when "WD"
65
- "ISO/WD #{DOCNUMBER}-#{part}"
66
- when "CD"
67
- "ISO/CD #{DOCNUMBER}-#{part}"
68
- when "DIS"
69
- "ISO/DIS #{DOCNUMBER}-#{part}"
70
- when "FDIS"
71
- "ISO/FDIS #{DOCNUMBER}-#{part}"
72
- when "TS"
73
- "ISO/TS #{DOCNUMBER}-#{part}"
74
- when "CD-TS"
75
- "ISO/CD TS #{DOCNUMBER}-#{part}"
76
- else
77
- "UNKNOWN DOCTYPE: (#{doctype})"
78
- end
61
+ when "IS"
62
+ "ISO #{DOCNUMBER}-#{part}"
63
+ when "WD"
64
+ "ISO/WD #{DOCNUMBER}-#{part}"
65
+ when "CD"
66
+ "ISO/CD #{DOCNUMBER}-#{part}"
67
+ when "DIS"
68
+ "ISO/DIS #{DOCNUMBER}-#{part}"
69
+ when "FDIS"
70
+ "ISO/FDIS #{DOCNUMBER}-#{part}"
71
+ when "TS"
72
+ "ISO/TS #{DOCNUMBER}-#{part}"
73
+ when "CD-TS"
74
+ "ISO/CD TS #{DOCNUMBER}-#{part}"
75
+ else
76
+ "UNKNOWN DOCTYPE: (#{doctype})"
77
+ end
79
78
 
80
79
  if pub_year
81
80
  "#{no_date}:#{pub_year}"
@@ -106,7 +105,7 @@ module Stepmod
106
105
  end
107
106
 
108
107
  def anchor
109
- docid.gsub('/', '-').gsub(' ', '_').gsub(':', '_')
108
+ docid.gsub("/", "-").gsub(" ", "_").gsub(":", "_")
110
109
  end
111
110
 
112
111
  def to_mn_adoc
@@ -116,9 +115,6 @@ module Stepmod
116
115
  "* [[[#{anchor},#{docid}]]]"
117
116
  end
118
117
  end
119
-
120
118
  end
121
-
122
119
  end
123
120
  end
124
-
@@ -1,11 +1,11 @@
1
- require 'reverse_adoc/cleaner'
1
+ require "reverse_adoc/cleaner"
2
2
 
3
3
  module Stepmod
4
4
  module Utils
5
5
  class Cleaner < ReverseAdoc::Cleaner
6
6
  def tidy(string)
7
- super.gsub(/^ +/, '')
7
+ super.gsub(/^ +/, "")
8
8
  end
9
9
  end
10
10
  end
11
- end
11
+ end