dxf_io 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acd6e7e421e794fc455849a0bef5891546f156f0
4
- data.tar.gz: 05ed5c94483547c11977cb46fe5aef576500326f
3
+ metadata.gz: 3c8a0ab7bf7046b03692dddfc2e848c91fc19b99
4
+ data.tar.gz: 789ff4681c9ac19bbdd0a586e1e76125d7e31193
5
5
  SHA512:
6
- metadata.gz: d4ab61f9f327ca682d0f5960b9e17150f9444176bd5e09182877f75acbf0fcc1f14d667f986dfd12a9885654b3dd93bcc72465d6cb673f43d0b7304c05b103cb
7
- data.tar.gz: af51a521f4325f2901fda5916c405801cf655ceb02f56e4f88bec4d4ae0de6aeb79fc3f6b5df04d6d847a7563a49b28be6505b73dd50cfe9b300c14308b94052
6
+ metadata.gz: 4b55ff2b036d89b5065a2617112f48ef72525d4a83b5e33f96f24c1c214fffbb7318e087e53d2a1b40e80ac33129d5bdd1815ffa164f95d13d6a8fb89c971731
7
+ data.tar.gz: e69372d8c0de9591f923a48b11cd9d5ab31506a42b7aecbca8d6249c2341d44b8883a47fd92a594c59fd20b4ffdf1c9e4f06442a1c0f3236df39102ef4f9f8f6
@@ -2,6 +2,9 @@ module DxfIO
2
2
  module Entity
3
3
  extend ActiveSupport::Autoload
4
4
 
5
+ autoload :Support
6
+ autoload :Other
7
+
5
8
  autoload :Ellipse
6
9
  autoload :Polyline
7
10
  autoload :Arc
@@ -14,8 +17,5 @@ module DxfIO
14
17
  autoload :Text
15
18
  autoload :Mtext
16
19
  autoload :Spline
17
-
18
- autoload :Other
19
- autoload :Support
20
20
  end
21
21
  end
@@ -2,6 +2,12 @@ module DxfIO
2
2
  module Entity
3
3
  class Dimension < Other
4
4
 
5
+ ADDITIONAL_X_COORDINATE_GROUP_NUMS = (12..16).to_a.freeze
6
+ ADDITIONAL_Y_COORDINATE_GROUP_NUMS = (22..26).to_a.freeze
7
+ ADDITIONAL_Z_COORDINATE_GROUP_NUMS = (32..36).to_a.freeze
8
+ ADDITIONAL_START_POINT_GROUP_NUMS = (ADDITIONAL_X_COORDINATE_GROUP_NUMS +
9
+ ADDITIONAL_Y_COORDINATE_GROUP_NUMS).freeze
10
+
5
11
  protected
6
12
 
7
13
  def initialize(groups, representation_hash)
@@ -9,6 +15,22 @@ module DxfIO
9
15
  super(groups)
10
16
  end
11
17
 
18
+ private
19
+
20
+ # checking types of coordinate
21
+
22
+ def start_point?(group)
23
+ ADDITIONAL_START_POINT_GROUP_NUMS.include?(group.keys.first) || super
24
+ end
25
+
26
+ def x_coordinate?(group)
27
+ ADDITIONAL_X_COORDINATE_GROUP_NUMS.include?(group.keys.first) || super
28
+ end
29
+
30
+ def y_coordinate?(group)
31
+ ADDITIONAL_Y_COORDINATE_GROUP_NUMS.include?(group.keys.first) || super
32
+ end
33
+
12
34
  end
13
35
  end
14
36
  end
@@ -217,7 +217,7 @@ module DxfIO
217
217
 
218
218
  # reject invalid sequences of coordinate groups
219
219
  def validate_point_groups(groups)
220
- groups[1..-1].each.with_index.inject([]) do |result, (group, index)|
220
+ groups[1..-1].to_a.each.with_index.inject([]) do |result, (group, index)|
221
221
  if y_coordinate?(group)
222
222
  if x_coordinate?(groups[index]) &&
223
223
  ( (start_point?(group) && start_point?(groups[index])) ||
@@ -1,3 +1,3 @@
1
1
  module DxfIO
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dxf_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Zabrovskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-28 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport