microstation 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +23 -0
- data/.gemtest +0 -0
- data/.rspec +2 -0
- data/Gemfile +17 -0
- data/History.txt +6 -0
- data/Manifest.txt +60 -0
- data/README.txt +75 -0
- data/Rakefile +30 -0
- data/bin/dgn2pdf +37 -0
- data/lib/microstation.rb +88 -0
- data/lib/microstation/app.rb +286 -0
- data/lib/microstation/attributes.rb +35 -0
- data/lib/microstation/cad_input_queue.rb +25 -0
- data/lib/microstation/configuration.rb +57 -0
- data/lib/microstation/dir.rb +252 -0
- data/lib/microstation/drawing.rb +189 -0
- data/lib/microstation/enumerator.rb +29 -0
- data/lib/microstation/ext/pathname.rb +25 -0
- data/lib/microstation/extensions/hash.rb +27 -0
- data/lib/microstation/pdf_support.rb +40 -0
- data/lib/microstation/properties.rb +57 -0
- data/lib/microstation/scan/color.rb +38 -0
- data/lib/microstation/scan/criteria.rb +85 -0
- data/lib/microstation/scan/klass.rb +43 -0
- data/lib/microstation/scan/level.rb +38 -0
- data/lib/microstation/scan/line_style.rb +45 -0
- data/lib/microstation/scan/line_weight.rb +33 -0
- data/lib/microstation/scan/subtype.rb +40 -0
- data/lib/microstation/scan/type.rb +109 -0
- data/lib/microstation/scanner.rb +24 -0
- data/lib/microstation/tag.rb +58 -0
- data/lib/microstation/tag_set.rb +280 -0
- data/lib/microstation/template.rb +84 -0
- data/lib/microstation/text.rb +54 -0
- data/lib/microstation/text_node.rb +74 -0
- data/lib/microstation/ts/attribute.rb +139 -0
- data/lib/microstation/ts/instance.rb +112 -0
- data/lib/microstation/types.rb +91 -0
- data/lib/microstation/wrap.rb +214 -0
- data/plot/pdf-bw.plt +164 -0
- data/plot/pdf.plt +163 -0
- data/plot/png.plt +383 -0
- data/plot/tiff.plt +384 -0
- data/plot/wmbw.tbl +66 -0
- data/plot/wmcolor.tbl +62 -0
- data/spec/app_spec.rb +267 -0
- data/spec/configuration_spec.rb +122 -0
- data/spec/drawing_spec.rb +247 -0
- data/spec/drawings/new_drawing.dgn +0 -0
- data/spec/drawings/test.dgn +0 -0
- data/spec/drawings/test1.dgn +0 -0
- data/spec/drawings/testfile.pdf +0 -0
- data/spec/enumerator_spec.rb +60 -0
- data/spec/microstation_spec.rb +36 -0
- data/spec/scanner_spec.rb +155 -0
- data/spec/spec_app.rb +11 -0
- data/spec/spec_helper.rb +31 -0
- data/spec/tag_set_spec.rb +123 -0
- data/spec/text_node_spec.rb +92 -0
- data/spec/text_spec.rb +62 -0
- metadata +241 -0
data/spec/text_spec.rb
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__) , 'spec_helper')
|
2
|
+
|
3
|
+
describe "Microstation:Text and Microstation::TextNode" do
|
4
|
+
|
5
|
+
|
6
|
+
context "given a text node initialized by a scan" do
|
7
|
+
|
8
|
+
before(:all) do
|
9
|
+
@app = Microstation::App.new
|
10
|
+
@drawing = open_existing_drawing(@app)
|
11
|
+
@criteria = @app.create_scanner do |scan|
|
12
|
+
scan.include_textual
|
13
|
+
end
|
14
|
+
@text_scan = @drawing.scan(@criteria)
|
15
|
+
@text_enum = @text_scan.to_enum
|
16
|
+
@text = @text_enum.find{|t| t.class == Microstation::Text}
|
17
|
+
end
|
18
|
+
|
19
|
+
after(:all) do
|
20
|
+
@app.quit
|
21
|
+
end
|
22
|
+
|
23
|
+
let(:app) { @app}
|
24
|
+
let(:drawing) {@drawing}
|
25
|
+
let(:text) { @text}
|
26
|
+
|
27
|
+
it "should be an instance of text" do
|
28
|
+
text.should be_instance_of Microstation::Text
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should forward all the methods to underlying text" do
|
32
|
+
val = text.to_s
|
33
|
+
text.reverse.should == val.reverse
|
34
|
+
text.to_s.should == val
|
35
|
+
puts "text: #{text}"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should forward all the Microstation commands to ole_obj" do
|
39
|
+
pending
|
40
|
+
text.IsTextElement.should be_true
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should update the drawing if the text is changed" do
|
44
|
+
pending
|
45
|
+
id = text.microstation_id
|
46
|
+
debugger
|
47
|
+
puts "id: #{id}"
|
48
|
+
puts "id class #{id.class}"
|
49
|
+
val = text.to_s
|
50
|
+
text.reverse!
|
51
|
+
drawing_text = app.find_by_id(id)
|
52
|
+
drawing_text.to_s.should == val.reverse
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
|
metadata
ADDED
@@ -0,0 +1,241 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: microstation
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dominic Sisneros
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: methadone
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.0.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.0.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: liquid
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>'
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.0.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>'
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.0.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: virtus
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>'
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.0.0
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>'
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.0.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: minitest
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '4.6'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '4.6'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rdoc
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '3.10'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '3.10'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rspec
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>'
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 0.0.0
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>'
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.0.0
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: pry-nav
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>'
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.0.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>'
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.0.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: hoe
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ~>
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '3.5'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ~>
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '3.5'
|
142
|
+
description: ! 'this is a gem that wraps Bentley Microstation using the WIN32OLE
|
143
|
+
|
144
|
+
library.'
|
145
|
+
email:
|
146
|
+
- dsisnero@gmail.com
|
147
|
+
executables:
|
148
|
+
- dgn2pdf
|
149
|
+
extensions: []
|
150
|
+
extra_rdoc_files:
|
151
|
+
- History.txt
|
152
|
+
- Manifest.txt
|
153
|
+
- README.txt
|
154
|
+
files:
|
155
|
+
- .autotest
|
156
|
+
- .rspec
|
157
|
+
- Gemfile
|
158
|
+
- History.txt
|
159
|
+
- Manifest.txt
|
160
|
+
- README.txt
|
161
|
+
- Rakefile
|
162
|
+
- bin/dgn2pdf
|
163
|
+
- lib/microstation.rb
|
164
|
+
- lib/microstation/app.rb
|
165
|
+
- lib/microstation/attributes.rb
|
166
|
+
- lib/microstation/cad_input_queue.rb
|
167
|
+
- lib/microstation/configuration.rb
|
168
|
+
- lib/microstation/dir.rb
|
169
|
+
- lib/microstation/drawing.rb
|
170
|
+
- lib/microstation/enumerator.rb
|
171
|
+
- lib/microstation/ext/pathname.rb
|
172
|
+
- lib/microstation/extensions/hash.rb
|
173
|
+
- lib/microstation/pdf_support.rb
|
174
|
+
- lib/microstation/properties.rb
|
175
|
+
- lib/microstation/scan/color.rb
|
176
|
+
- lib/microstation/scan/criteria.rb
|
177
|
+
- lib/microstation/scan/klass.rb
|
178
|
+
- lib/microstation/scan/level.rb
|
179
|
+
- lib/microstation/scan/line_style.rb
|
180
|
+
- lib/microstation/scan/line_weight.rb
|
181
|
+
- lib/microstation/scan/subtype.rb
|
182
|
+
- lib/microstation/scan/type.rb
|
183
|
+
- lib/microstation/scanner.rb
|
184
|
+
- lib/microstation/tag.rb
|
185
|
+
- lib/microstation/tag_set.rb
|
186
|
+
- lib/microstation/template.rb
|
187
|
+
- lib/microstation/text.rb
|
188
|
+
- lib/microstation/text_node.rb
|
189
|
+
- lib/microstation/ts/attribute.rb
|
190
|
+
- lib/microstation/ts/instance.rb
|
191
|
+
- lib/microstation/types.rb
|
192
|
+
- lib/microstation/wrap.rb
|
193
|
+
- plot/pdf-bw.plt
|
194
|
+
- plot/pdf.plt
|
195
|
+
- plot/png.plt
|
196
|
+
- plot/tiff.plt
|
197
|
+
- plot/wmbw.tbl
|
198
|
+
- plot/wmcolor.tbl
|
199
|
+
- spec/app_spec.rb
|
200
|
+
- spec/configuration_spec.rb
|
201
|
+
- spec/drawing_spec.rb
|
202
|
+
- spec/drawings/new_drawing.dgn
|
203
|
+
- spec/drawings/test.dgn
|
204
|
+
- spec/drawings/test1.dgn
|
205
|
+
- spec/drawings/testfile.pdf
|
206
|
+
- spec/enumerator_spec.rb
|
207
|
+
- spec/microstation_spec.rb
|
208
|
+
- spec/scanner_spec.rb
|
209
|
+
- spec/spec_app.rb
|
210
|
+
- spec/spec_helper.rb
|
211
|
+
- spec/tag_set_spec.rb
|
212
|
+
- spec/text_node_spec.rb
|
213
|
+
- spec/text_spec.rb
|
214
|
+
- .gemtest
|
215
|
+
homepage: http://github.com/dsisnero/microstation
|
216
|
+
licenses: []
|
217
|
+
post_install_message:
|
218
|
+
rdoc_options:
|
219
|
+
- --main
|
220
|
+
- README.txt
|
221
|
+
require_paths:
|
222
|
+
- lib
|
223
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
224
|
+
none: false
|
225
|
+
requirements:
|
226
|
+
- - ! '>='
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '0'
|
229
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
230
|
+
none: false
|
231
|
+
requirements:
|
232
|
+
- - ! '>='
|
233
|
+
- !ruby/object:Gem::Version
|
234
|
+
version: '0'
|
235
|
+
requirements: []
|
236
|
+
rubyforge_project: microstation
|
237
|
+
rubygems_version: 1.8.25
|
238
|
+
signing_key:
|
239
|
+
specification_version: 3
|
240
|
+
summary: this is a gem that wraps Bentley Microstation using the WIN32OLE library.
|
241
|
+
test_files: []
|