microstation 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +26 -29
  3. data/Rakefile +45 -45
  4. data/bin/dgn2pdf +5 -6
  5. data/bin/dgn_template +23 -25
  6. data/bin/pw_print +11 -13
  7. data/cad_files/drawing_no_block.dgn +0 -0
  8. data/cad_files/drawing_with_3_block.dgn +0 -0
  9. data/cad_files/drawing_with_block.dgn +0 -0
  10. data/cad_files/drawing_with_text.dgn +0 -0
  11. data/lib/microstation/app.rb +91 -87
  12. data/lib/microstation/cad_input_queue.rb +10 -20
  13. data/lib/microstation/cell.rb +6 -18
  14. data/lib/microstation/changer.rb +3 -3
  15. data/lib/microstation/configuration.rb +33 -50
  16. data/lib/microstation/criteria_creation_t.rb +4 -8
  17. data/lib/microstation/dir.rb +27 -59
  18. data/lib/microstation/directory.rb +2 -7
  19. data/lib/microstation/drawing.rb +103 -102
  20. data/lib/microstation/element.rb +55 -68
  21. data/lib/microstation/enumerator.rb +4 -9
  22. data/lib/microstation/errors.rb +0 -5
  23. data/lib/microstation/event_handler.rb +1 -5
  24. data/lib/microstation/ext/pathname.rb +12 -14
  25. data/lib/microstation/ext/win32ole.rb +0 -2
  26. data/lib/microstation/extensions/faa.rb +12 -34
  27. data/lib/microstation/file_tests.rb +15 -50
  28. data/lib/microstation/functions.rb +10 -20
  29. data/lib/microstation/graphics.rb +6 -13
  30. data/lib/microstation/line.rb +2 -6
  31. data/lib/microstation/model.rb +11 -20
  32. data/lib/microstation/model_trait.rb +40 -40
  33. data/lib/microstation/ole_cad_input_message.rb +25 -34
  34. data/lib/microstation/ole_helper.rb +58 -66
  35. data/lib/microstation/pdf_support.rb +7 -16
  36. data/lib/microstation/point3d.rb +17 -30
  37. data/lib/microstation/primitive_command_interface.rb +8 -14
  38. data/lib/microstation/properties.rb +29 -17
  39. data/lib/microstation/property_handler.rb +6 -8
  40. data/lib/microstation/scan/color.rb +1 -8
  41. data/lib/microstation/scan/criteria.rb +17 -33
  42. data/lib/microstation/scan/klass.rb +8 -12
  43. data/lib/microstation/scan/level.rb +2 -9
  44. data/lib/microstation/scan/line_style.rb +4 -12
  45. data/lib/microstation/scan/line_weight.rb +1 -3
  46. data/lib/microstation/scan/range.rb +2 -8
  47. data/lib/microstation/scan/scan_trait.rb +48 -51
  48. data/lib/microstation/scan/subtype.rb +0 -10
  49. data/lib/microstation/scan/type.rb +9 -15
  50. data/lib/microstation/scan_trait.rb +13 -20
  51. data/lib/microstation/scanner.rb +1 -11
  52. data/lib/microstation/tag.rb +12 -21
  53. data/lib/microstation/tag_set.rb +52 -71
  54. data/lib/microstation/tag_set_trait.rb +6 -10
  55. data/lib/microstation/tagged_element.rb +16 -28
  56. data/lib/microstation/template.rb +15 -14
  57. data/lib/microstation/template_info.rb +35 -49
  58. data/lib/microstation/template_runner.rb +14 -22
  59. data/lib/microstation/text.rb +15 -19
  60. data/lib/microstation/text_node.rb +17 -26
  61. data/lib/microstation/ts/attribute.rb +16 -20
  62. data/lib/microstation/ts/instance.rb +28 -38
  63. data/lib/microstation/ts/tagset_trait.rb +5 -12
  64. data/lib/microstation/types.rb +0 -3
  65. data/lib/microstation/version.rb +1 -3
  66. data/lib/microstation/wrap.rb +3 -10
  67. data/lib/microstation.rb +53 -68
  68. data/spec/microstation/app_spec.rb +49 -46
  69. data/spec/microstation/configuration_spec.rb +45 -43
  70. data/spec/microstation/drawing_spec.rb +103 -101
  71. data/spec/microstation/functions_spec.rb +18 -12
  72. data/spec/microstation/tag_set_spec.rb +57 -55
  73. data/spec/microstation/template_spec.rb +41 -42
  74. data/spec/microstation/text_node_spec.rb +16 -14
  75. data/spec/microstation/text_spec.rb +10 -8
  76. data/spec/microstation_spec.rb +18 -17
  77. data/spec/spec_helper.rb +18 -18
  78. metadata +26 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6dade49110e3215b4d4da3cbfa9619bd36cfbfa16088dd3705039cfbd16da86e
4
- data.tar.gz: 1c6afd4b5f1a4a33391687890d5a0872d69aba663fda2c36b3b2c8076d616529
3
+ metadata.gz: '08c911e0e17cedddd9a1018c3c2bbc2a4f22c024ca32ff62fff40a5e6cc02323'
4
+ data.tar.gz: 355a5c4c036e05d6d61e7007f2496443da576b0eab0df91015be7300db2c8d56
5
5
  SHA512:
6
- metadata.gz: 8e5f646254acf1edcaf295d74ea9e0633388aba9429d494a9f8c6cae9ac9a83546c1c451b5ecbb4a6a87560a5cd95a32227b786cf24940ac19265d3cd1deefc9
7
- data.tar.gz: ca9aa2b552173135b1080f688632d5e8fc5cdac36b6845da2ce3676d1b20f141a2594a16aadbd03833814c88b49b0793ec7b6048153cbb339a1d9aa581df34b5
6
+ metadata.gz: 1ad154334ddc8e753fd1679fc118da5c33d9fbc7f80b615e2bfe2f1339bf60e6f06fe3a20d36a682f152223b4957644b99d278480f3754bfa3ff9d24d1fa5930
7
+ data.tar.gz: 59a804d7215d0d2dfb1808d0650d0f891f4105a1925b3f49ea66bdb0cb78e93bfa1570a2830c08ad9d24057bddd8e3245bee99ee49af6cd2604c598041b9973d
data/Gemfile CHANGED
@@ -1,36 +1,33 @@
1
- # frozen_string_literal: true
2
-
3
1
  # -*- ruby -*-
4
2
 
5
3
  # DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
6
4
 
7
- source 'https://rubygems.org/'
5
+ source "https://rubygems.org/"
6
+
7
+ gem "methadone", ">=0.0.0"
8
+ gem "liquid", ">0.0.0"
9
+ gem "gli", ">0.0.0"
10
+ gem "dry-monads", ">0.0.0"
8
11
 
9
- gem 'dry-monads', '>0.0.0'
10
- gem 'gli', '>0.0.0'
11
- gem 'liquid', '>0.0.0'
12
- gem 'methadone', '>=0.0.0'
12
+ gem "hoe-yard", ">=0.1.3", group: [:development, :test]
13
+ gem "minitest", ">0.0.0", group: [:development, :test]
14
+ gem "minitest-hooks", ">0.0", group: [:development, :test]
15
+ gem "aruba", ">0.0.0", group: [:development, :test]
16
+ gem "yard", ">=0.0", group: [:development, :test]
17
+ gem "guard-yard", ">=0.0", group: [:development, :test]
18
+ gem "hoe", "~>4", group: [:development, :test]
19
+ gem "hoe-bundler", ">0.0.0", group: [:development, :test]
20
+ gem "guard", ">0.0.0", group: [:development, :test]
21
+ gem "guard-minitest", ">0.0.0", group: [:development, :test]
22
+ gem "minitest-focus", ">0.0.0", group: [:development, :test]
23
+ gem "notiffany", ">0.0.0", group: [:development, :test]
24
+ gem "debug", ">0.0.0", group: [:development, :test]
25
+ gem "rb-readline", ">0.0.0", group: [:development, :test]
26
+ gem "win32console", ">0.0.0", group: [:development, :test]
27
+ gem "rb-notifu", ">0.0.0", group: [:development, :test]
28
+ gem "wdm", ">0.0.0", group: [:development, :test]
29
+ gem "solargraph", ">0.0.0", group: [:development, :test]
30
+ gem "standard", ">0.0.0", group: [:development, :test]
31
+ gem "solargraph-standardrb", ">0.0.0", group: [:development, :test]
13
32
 
14
- group :development, :test do
15
- gem 'aruba'
16
- gem 'guard'
17
- gem 'guard-minitest'
18
- gem 'guard-yard'
19
- gem 'hoe'
20
- gem 'hoe-bundler'
21
- gem 'hoe-yard'
22
- gem 'minitest'
23
- gem 'minitest-focus'
24
- gem 'minitest-hooks'
25
- gem 'notiffany'
26
- gem 'pry'
27
- gem 'pry-byebug'
28
- gem 'rb-notifu'
29
- gem 'rb-readline'
30
- gem 'solargraph'
31
- gem 'standard'
32
- gem 'wdm'
33
- gem 'win32console'
34
- gem 'yard'
35
- end
36
33
  # vim: syntax=ruby
data/Rakefile CHANGED
@@ -1,63 +1,63 @@
1
1
  # -*- ruby -*-
2
2
 
3
- require 'rubygems'
4
- require 'rake/clean'
5
- #require 'rake/testtask'
6
- require 'hoe'
7
- #require 'hoe/minitest'
8
- require 'minitest/test_task'
9
- require 'minitest'
10
- #require 'hoe/git'
3
+ require "rubygems"
4
+ require "rake/clean"
5
+ # require 'rake/testtask'
6
+ require "hoe"
7
+ # require 'hoe/minitest'
8
+ require "minitest"
9
+ require "minitest/test_task"
10
+ # require 'hoe/git'
11
11
 
12
12
  class Hoe
13
13
  def intuit_values(input)
14
-
15
14
  end
16
15
  end
17
16
 
18
- #require 'rake/testtask'
17
+ # require 'rake/testtask'
19
18
 
20
19
  CLEAN.include("**/#*.*#")
21
20
  Hoe.plugin :bundler
22
- #Hoe.plugin :minitest
21
+ # Hoe.plugin :minitest
23
22
  Hoe.plugin :git
24
23
  Hoe.plugin :yard
25
24
  # Hoe.plugin :rubyforge
26
- Hoe.spec 'microstation' do
27
- self.summary = 'A ruby gem to control and automate Bentley Microstation using win32ole'
28
- self.description = 'Wrapping of microstation using win32ole to automate and control from ruby'
29
- developer('Dominic Sisneros', 'dsisnero@gmail.com')
30
- clean_globs << '**/#*.*#'
25
+ Hoe.spec "microstation" do
26
+ self.summary = "A ruby gem to control and automate Bentley Microstation using win32ole"
27
+ self.description = "Wrapping of microstation using win32ole to automate and control from ruby"
28
+ developer("Dominic Sisneros", "dsisnero@gmail.com")
29
+ clean_globs << "**/#*.*#"
31
30
  # self.yard_markup = 'asciidoc'
32
- self.urls = {home: 'https://github.com/dsisnero/microstation'}
33
- dependency('methadone','>= 0.0.0')
34
- dependency('liquid', '> 0.0.0')
35
- dependency('gli', '> 0.0.0')
36
- dependency('dry-monads', '> 0.0.0')
31
+ self.urls = {home: "https://github.com/dsisnero/microstation"}
32
+ dependency("methadone", ">= 0.0.0")
33
+ dependency("liquid", "> 0.0.0")
34
+ dependency("gli", "> 0.0.0")
35
+ dependency("dry-monads", "> 0.0.0")
37
36
  # dependency('pry-nav', '>0.0.0',:dev)
38
37
 
39
- dependency('minitest', '>0.0.0', :dev)
40
- dependency('minitest-hooks','>0.0', :dev)
41
- dependency('aruba', '>0.0.0', :dev)
42
- dependency('yard','>= 0.0',:dev)
43
- dependency('hoe-yard','~> 0.1',:dev)
44
- dependency('guard-yard', '>= 0.0', :dev)
45
- dependency('hoe','~> 3.1', :dev)
46
- dependency('hoe-bundler', '> 0.0.0', :dev)
47
- dependency('guard', '> 0.0.0', :dev)
48
- dependency('guard-minitest', '> 0.0.0', :dev)
49
- dependency('minitest-focus', '> 0.0.0', :dev)
50
- dependency('notiffany', '> 0.0.0', :dev)
51
- dependency('pry', '> 0.0.0', :dev)
52
- dependency('aruba', '> 0.0.0', :dev)
53
- dependency('pry-byebug', '> 0.0.0', :dev)
54
- dependency('rb-readline', '>0.0.0', :dev)
55
- dependency('win32console', '>0.0.0', :dev)
56
- dependency('rb-notifu', '> 0.0.0', :dev)
57
- dependency('wdm', '> 0.0.0', :dev)
58
- dependency('solargraph' , '> 0.0.0', :dev)
38
+ dependency("minitest", ">0.0.0", :dev)
39
+ dependency("minitest-hooks", ">0.0", :dev)
40
+ dependency("aruba", ">0.0.0", :dev)
41
+ dependency("yard", ">= 0.0", :dev)
42
+ dependency("hoe-yard", "~> 0.1", :dev)
43
+ dependency("guard-yard", ">= 0.0", :dev)
44
+ dependency("hoe", "~> 4", :dev)
45
+ dependency("hoe-bundler", "> 0.0.0", :dev)
46
+ dependency("guard", "> 0.0.0", :dev)
47
+ dependency("guard-minitest", "> 0.0.0", :dev)
48
+ dependency("minitest-focus", "> 0.0.0", :dev)
49
+ dependency("notiffany", "> 0.0.0", :dev)
50
+ dependency("aruba", "> 0.0.0", :dev)
51
+ dependency("debug", "> 0.0.0", :dev)
52
+ dependency("rb-readline", ">0.0.0", :dev)
53
+ dependency("win32console", ">0.0.0", :dev)
54
+ dependency("rb-notifu", "> 0.0.0", :dev)
55
+ dependency("wdm", "> 0.0.0", :dev)
56
+ dependency("solargraph", "> 0.0.0", :dev)
57
+ dependency("standard", "> 0.0.0", :dev)
58
+ dependency("solargraph-standardrb", "> 0.0.0", :dev)
59
59
  # dependency('windows-pr', '>0.0.0')
60
- license('MIT')
60
+ license("MIT")
61
61
  # require 'pry';binding.pry
62
62
 
63
63
  # self.rubyforge_name = 'microstation' # if different than 'microstation'
@@ -66,7 +66,7 @@ end
66
66
 
67
67
 
68
68
  # vim: syntax=ruby
69
- Minitest::TestTask.create('test2') do |t|
70
- t.libs.push('specs')
71
- t.test_globs = 'spec/**/*_spec.rb'
69
+ Minitest::TestTask.create("test2") do |t|
70
+ t.libs.push("specs")
71
+ t.test_globs = "spec/**/*_spec.rb"
72
72
  end
data/bin/dgn2pdf CHANGED
@@ -1,15 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
- $LOAD_PATH.unshift('../lib')
3
- require 'optparse'
4
- require 'methadone'
5
- require 'microstation'
2
+ $LOAD_PATH.unshift("../lib")
3
+ require "optparse"
4
+ require "methadone"
5
+ require "microstation"
6
6
 
7
7
  class App
8
8
  include Methadone::Main
9
9
  include Methadone::CLILogging
10
10
 
11
11
  main do |directory, output_dir|
12
-
13
12
  directory_path = Pathname.new(directory).expand_path
14
13
  exit_now! "arg directory: #{directory_path} doesn't exist" unless directory_path.directory?
15
14
  Microstation.dgn2pdf(directory_path, output_dir)
@@ -24,7 +23,7 @@ class App
24
23
 
25
24
  description "Convert a directory of Microstation files (*.dgn) to pdf"
26
25
 
27
- on("-o","--output_dir","Output Dir")
26
+ on("-o", "--output_dir", "Output Dir")
28
27
 
29
28
 
30
29
  arg :directory
data/bin/dgn_template CHANGED
@@ -1,17 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
- require 'gli'
3
- $LOAD_PATH.unshift(File.join(__dir__, 'lib'))
2
+ require "gli"
3
+ $LOAD_PATH.unshift(File.join(__dir__, "lib"))
4
4
 
5
5
  begin # XXX: Remove this begin/rescue before distributing your app
6
- require 'microstation'
6
+ require "microstation"
7
7
  rescue LoadError
8
- STDERR.puts "In development, you need to use `bundle exec ruby -I lib bin/dgn_template` to run your app"
9
- STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
10
- STDERR.puts "Feel free to remove this message from bin/dgn_template now"
8
+ warn "In development, you need to use `bundle exec ruby -I lib bin/dgn_template` to run your app"
9
+ warn "At install-time, RubyGems will make sure lib, etc. are in the load path"
10
+ warn "Feel free to remove this message from bin/dgn_template now"
11
11
  exit 64
12
12
  end
13
13
 
14
-
15
14
  module Cli
16
15
  include GLI::App
17
16
 
@@ -32,44 +31,44 @@ module Cli
32
31
  # arg_name 'The name of the argument'
33
32
  # flag [:f,:flagname]
34
33
 
35
- desc 'create template description files to fill out'
34
+ desc "create template description files to fill out"
36
35
  long_desc "
37
36
  Given a directory, this will generate yaml files describing
38
37
  the fields and tagsets of dgn files in the directory
39
38
  "
40
39
 
41
- arg 'dir'
40
+ arg "dir"
42
41
  command :dump do |c|
43
42
  # c.desc ''
44
43
  # c.switch :s
45
44
 
46
- c.desc 'file to run dump on'
45
+ c.desc "file to run dump on"
47
46
  # c.default_value 'default'
48
- c.flag [:f, :filename]
49
- c.action do |global_options,options,args|
50
-
47
+ c.flag %i[f filename]
48
+ c.action do |_global_options, options, args|
51
49
  # Your command logic here
52
50
 
53
51
  # If you have any errors, just raise them
54
52
  # raise "that command made no sense"
55
- if file=options[:f]
53
+ if file = options[:f]
56
54
  puts "file dump ran with file option #{options[:f]}"
57
-
55
+
58
56
  Microstation.dump_template_info(file, visible: true)
59
57
  else
60
- help_now!('dir is required') if args.empty?
58
+ help_now!("dir is required") if args.empty?
59
+ require "debug"
60
+ binding.break
61
61
  Microstation.dump_template_info_for_dir args.first
62
62
  end
63
63
  end
64
64
  end
65
65
 
66
- desc 'Run the template description files'
66
+ desc "Run the template description files"
67
67
  arg :dir, :optional
68
68
  command :run do |c|
69
-
70
- c.desc 'file to run'
71
- c.flag [:f, :filename]
72
- c.action do |global_options,options,args|
69
+ c.desc "file to run"
70
+ c.flag %i[f filename]
71
+ c.action do |_global_options, options, args|
73
72
  if options[:f]
74
73
  puts "Running run on file #{options[:f]}"
75
74
 
@@ -81,7 +80,7 @@ the fields and tagsets of dgn files in the directory
81
80
  end
82
81
  end
83
82
 
84
- pre do |global,command,options,args|
83
+ pre do |_global, _command, _options, _args|
85
84
  # Pre logic here
86
85
  # Return true to proceed; false to abort and not call the
87
86
  # chosen command
@@ -90,18 +89,17 @@ the fields and tagsets of dgn files in the directory
90
89
  true
91
90
  end
92
91
 
93
- post do |global,command,options,args|
92
+ post do |global, command, options, args|
94
93
  # Post logic here
95
94
  # Use skips_post before a command to skip this
96
95
  # block on that command only
97
96
  end
98
97
 
99
- on_error do |exception|
98
+ on_error do |_exception|
100
99
  # Error logic here
101
100
  # return false to skip default error handling
102
101
  true
103
102
  end
104
103
 
105
104
  exit run(ARGV)
106
-
107
105
  end
data/bin/pw_print CHANGED
@@ -1,32 +1,30 @@
1
1
  #!/usr/bin/env ruby
2
- require 'optparse'
3
- require 'methadone'
2
+ require "optparse"
3
+ require "methadone"
4
4
 
5
- require 'microstation'
6
- require 'microstation/extensions/faa'
7
- require 'pry'
5
+ require "microstation"
6
+ require "microstation/extensions/faa"
7
+ require "pry"
8
8
 
9
9
  class PwApp
10
10
  include Methadone::Main
11
11
  include Methadone::CLILogging
12
12
 
13
13
  main do
14
- directory_path = Pathname( options['save-dir']).expand_path
14
+ directory_path = Pathname(options["save-dir"]).expand_path
15
15
  exit_now! "arg directory: #{directory_path} doesn't exist" unless directory_path.directory?
16
16
 
17
17
 
18
- app =Microstation.save_current_drawing(directory_path,exit: options['exit'])
19
- binding.pry unless options['exit']
20
-
21
-
18
+ app = Microstation.save_current_drawing(directory_path, exit: options["exit"])
19
+ binding.pry unless options["exit"]
22
20
  end
23
21
 
24
22
  description "Save the currently open projectwise drawing"
25
23
 
26
- options['save-dir'] = Pathname.getwd
27
- options['exit'] = true
24
+ options["save-dir"] = Pathname.getwd
25
+ options["exit"] = true
28
26
  on("-d DIR", "--save-dir", "Set the location of the save dir")
29
- on("-e", "--[no-]exit",TrueClass, "Close the Microstation instance")
27
+ on("-e", "--[no-]exit", TrueClass, "Close the Microstation instance")
30
28
 
31
29
  version Microstation::VERSION
32
30
 
Binary file
Binary file
Binary file
Binary file