hwp_script_to_latex 1.5.0 → 1.6.0

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
  SHA256:
3
- metadata.gz: 5e948d02ae83f17c99fa96f38d16c3d0b257e7aa0f7ba4cea964fc300bb24975
4
- data.tar.gz: '0825cfac358661df69d6cfa0f487a89428129ffa60c1af6f8e4b182162ea5e8f'
3
+ metadata.gz: 32a41ac96bd22ccf4b84bb5357393c41a90f019552d632bf517fb439a63e85cc
4
+ data.tar.gz: 530c735e69215928b64ead1b51435612542b5e314ae604a7a0d52b7b50c930d1
5
5
  SHA512:
6
- metadata.gz: 35732e0afd39f4818ce2aab81458fa7366202631bea5800391df1954ba0f850d7631f57276273126ef6b293269d44239ffde63e155804629f100962b21ab7432
7
- data.tar.gz: f7647a86a3de1f04b9e503b0b34300824c29f2ce535c7b109aec3bfe1600ff37fa9edb7a504f96d11cda322697b9a9a0249587d4ff459d0b51c1825e045f3adc
6
+ metadata.gz: 28b7d4bca5aa7247e3bd1b2cd0eaada2953866adf704c96364a3bbdcf15dadec5baeb5a427dac847a0a6262fa2a386e46b910cb6c1fb6cdf67b611a2b25fc1c1
7
+ data.tar.gz: c83282171a475294c75fbd7f54ae5e31732a1bf762eac52611476fb2b010c403cc6a554b66be7e423c8bf4f4f9ef2ec467436bedaa2cc67cc5a9d059b49b16a5
@@ -14,10 +14,7 @@ module HwpScriptToLatex
14
14
  end
15
15
 
16
16
  def validate(script)
17
- result = {
18
- warnings: [],
19
- errors: []
20
- }
17
+ errors = []
21
18
 
22
19
  # Default Command
23
20
  @default_commands.each do |command|
@@ -25,9 +22,10 @@ module HwpScriptToLatex
25
22
 
26
23
  match_data = script.match(parameter_bracket_regex)
27
24
  if match_data
28
- result[:errors] << {
25
+ errors << {
29
26
  name: :command_parameter_need_bracket,
30
- message: "명령어 파라미터에 중괄호가 누락되었습니다."
27
+ message: "명령어 파라미터에 중괄호가 누락되었습니다.",
28
+ detail: script
31
29
  }
32
30
  end
33
31
  end
@@ -36,9 +34,10 @@ module HwpScriptToLatex
36
34
  parameter_bracket_regex = %r(((?<!\s|})\s*(?i:over|atop))|((?i:over|atop)\s*(?!\s|{)))
37
35
  match_data = script.match(parameter_bracket_regex)
38
36
  if match_data
39
- result[:errors] << {
37
+ errors << {
40
38
  name: :fraction_command_parameter_need_bracket,
41
- message: "분수 명령어 파라미터에 중괄호가 누락되었습니다."
39
+ message: "분수 명령어 파라미터에 중괄호가 누락되었습니다.",
40
+ detail: script
42
41
  }
43
42
  end
44
43
 
@@ -46,9 +45,10 @@ module HwpScriptToLatex
46
45
  parameter_bracket_regex = %r(((?i:sqrt|root)\s*([^\s{]+))|((?i:sqrt|root)\s*([^\s]+)\s*of\s*([^\s{])))
47
46
  match_data = script.match(parameter_bracket_regex)
48
47
  if match_data
49
- result[:errors] << {
48
+ errors << {
50
49
  name: :sqrt_command_parameter_need_bracket,
51
- message: "루트 명령어 파라미터에 중괄호가 누락되었습니다."
50
+ message: "루트 명령어 파라미터에 중괄호가 누락되었습니다.",
51
+ detail: script
52
52
  }
53
53
  end
54
54
 
@@ -60,9 +60,10 @@ module HwpScriptToLatex
60
60
  close_bracket_count = script.scan(close_bracket_regex).length
61
61
 
62
62
  if open_bracket_count != close_bracket_count
63
- result[:errors] << {
63
+ errors << {
64
64
  name: :invalid_bracket_pair,
65
- message: "중괄호 개수가 맞지 않습니다."
65
+ message: "중괄호 개수가 맞지 않습니다.",
66
+ detail: script
66
67
  }
67
68
  end
68
69
 
@@ -72,13 +73,14 @@ module HwpScriptToLatex
72
73
  close_parentheses_count = script.scan(close_parentheses_regex).length
73
74
 
74
75
  if open_parentheses_count != close_parentheses_count
75
- result[:errors] << {
76
+ errors << {
76
77
  name: :invalid_parentheses_pair,
77
- message: "소괄호 개수가 맞지 않습니다."
78
+ message: "소괄호 개수가 맞지 않습니다.",
79
+ detail: script
78
80
  }
79
81
  end
80
82
 
81
- return result
83
+ return errors
82
84
  end
83
85
  end
84
86
  end
@@ -1,3 +1,3 @@
1
1
  module HwpScriptToLatex
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hwp_script_to_latex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bluesh55