asker-tool 2.5.3 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2778b9791cbe75e5ad0c0a0b31161ccb7c439e30361c5f0df4b468edd5f3b326
4
- data.tar.gz: 9d5eaff6548c67073b246da034468402f0c34e4e494c0bb5256805eed661a512
3
+ metadata.gz: e2f9eaec9a8bb085529b1b131f6e7184b769796f452096c7e9813da191425a70
4
+ data.tar.gz: 25d938ce101b69c2171de314270207d17d1783008968fb0be7c21f228070c44f
5
5
  SHA512:
6
- metadata.gz: ac1889c5e960b2cb2d879ec46506fd9adbd7cbcf122ac8047b9d72306e16ecc3636cbddab63f79ece8d0ab235f59da86fef821537e8a7125cee6a36b23603a60
7
- data.tar.gz: 31ecb2d5d68d4f630d5ab71712d72177f7b9eebcf0c1546015c0fc9d29ac1202ec69d6d26c38bcc6a4e3c74b4f1db722394f63d3519e15d2da2fc25e330a092e
6
+ metadata.gz: f62278acb1f78b567aae35e41256d36ff76503fd3c46939f2f0f83a414b3b817ddb515d79ee9cb557352555683cc1918af02001ada4d2f44343a0be9850cc7d6
7
+ data.tar.gz: d27246c82c93285ff411ff73fd3d265e7503efce6c9037f2462147103c24e15db728553363f565043dc5443b78d3d3e73ac114f27d0ef66245ff72e333d85ee1
@@ -1,8 +1,8 @@
1
- # frozen_string_literal: true
2
1
 
3
- require 'rainbow'
4
- require 'colorize'
5
- require_relative 'check_table'
2
+ # require 'rainbow'
3
+ require "debug"
4
+ require "colorize"
5
+ require_relative "check_table"
6
6
 
7
7
  class CheckHamlData
8
8
  include CheckTable
@@ -117,9 +117,10 @@ class CheckHamlData
117
117
  if find_parent(index) != :map
118
118
  @outputs[index][:state] = :err
119
119
  @outputs[index][:msg] = 'Parent(map) not found!'
120
- elsif line != ' %concept'
120
+ elsif !line.match(/^\s\s%concept\s*$/)
121
+ binding.break
121
122
  @outputs[index][:state] = :err
122
- @outputs[index][:msg] = 'Write 2 spaces before %concept'
123
+ @outputs[index][:msg] = 'Write 2 spaces before %concept, and no text after'
123
124
  end
124
125
  end
125
126
 
@@ -134,6 +135,7 @@ class CheckHamlData
134
135
  @outputs[index][:state] = :err
135
136
  @outputs[index][:msg] = 'Parent(concept) not found!'
136
137
  elsif !line.start_with? ' %names'
138
+ elsif !line.match(/^\s\s\s\s%names\s/)
137
139
  @outputs[index][:state] = :err
138
140
  @outputs[index][:msg] = 'Write 4 spaces before %names'
139
141
  end
@@ -149,7 +151,7 @@ class CheckHamlData
149
151
  if find_parent(index) != :concept
150
152
  @outputs[index][:state] = :err
151
153
  @outputs[index][:msg] = 'Parent(concept) not found!'
152
- elsif !line.start_with? ' %tags'
154
+ elsif !line.match(/^\s\s\s\s%tags\s/)
153
155
  @outputs[index][:state] = :err
154
156
  @outputs[index][:msg] = 'Write 4 spaces before %tags'
155
157
  end
@@ -165,7 +167,7 @@ class CheckHamlData
165
167
  if find_parent(index) != :concept
166
168
  @outputs[index][:state] = :err
167
169
  @outputs[index][:msg] = 'Parent(concept) not found!'
168
- elsif !line.start_with? ' %def'
170
+ elsif !line.match(/^\s\s\s\s%def\s/)
169
171
  @outputs[index][:state] = :err
170
172
  @outputs[index][:msg] = 'Write 4 spaces before %def'
171
173
  end
@@ -181,9 +183,9 @@ class CheckHamlData
181
183
  if find_parent(index) != :map
182
184
  @outputs[index][:state] = :err
183
185
  @outputs[index][:msg] = 'Parent(map) not found!'
184
- elsif line != ' %code'
186
+ elsif !line.match(/^\s\s%code\s*$/)
185
187
  @outputs[index][:state] = :err
186
- @outputs[index][:msg] = 'Write 2 spaces before %code'
188
+ @outputs[index][:msg] = 'Write 2 spaces before %code, and no text after'
187
189
  end
188
190
  end
189
191
 
@@ -197,7 +199,7 @@ class CheckHamlData
197
199
  if find_parent(index) != :code
198
200
  @outputs[index][:state] = :err
199
201
  @outputs[index][:msg] = 'Parent(code) not found!'
200
- elsif !line.start_with? ' %type'
202
+ elsif !line.match(/^\s\s\s\s%type\s/)
201
203
  @outputs[index][:state] = :err
202
204
  @outputs[index][:msg] = 'Write 4 spaces before %type'
203
205
  end
@@ -213,7 +215,7 @@ class CheckHamlData
213
215
  if find_parent(index) != :code
214
216
  @outputs[index][:state] = :err
215
217
  @outputs[index][:msg] = 'Parent(code) not found!'
216
- elsif !line.start_with? ' %path'
218
+ elsif !line.match(/^\s\s\s\s%path\s/)
217
219
  @outputs[index][:state] = :err
218
220
  @outputs[index][:msg] = 'Write 4 spaces before %type'
219
221
  end
@@ -229,9 +231,9 @@ class CheckHamlData
229
231
  if find_parent(index) != :code
230
232
  @outputs[index][:state] = :err
231
233
  @outputs[index][:msg] = 'Parent(code) not found!'
232
- elsif !line.start_with? ' %features'
234
+ elsif !line.match(/^\s\s\s\s%features\s*$/)
233
235
  @outputs[index][:state] = :err
234
- @outputs[index][:msg] = 'Write 4 spaces before %features'
236
+ @outputs[index][:msg] = 'Write 4 spaces before %features, and no text after'
235
237
  end
236
238
  end
237
239
 
@@ -11,7 +11,7 @@ module CheckTable
11
11
  if find_parent(index) != :concept
12
12
  @outputs[index][:state] = :err
13
13
  @outputs[index][:msg] = 'Parent(concept) not found!'
14
- elsif !line.start_with? ' %table'
14
+ elsif !line.match(/^\s\s\s\s%table\s*/)
15
15
  @outputs[index][:state] = :err
16
16
  @outputs[index][:msg] = 'Write 4 spaces before %table'
17
17
  end
@@ -25,12 +25,6 @@ module CheckTable
25
25
  @outputs[index][:state] = :err
26
26
  @outputs[index][:msg] = "fields must be next to : (Without spaces)"
27
27
  end
28
-
29
- # TODO
30
- #else not /\s+%table{\s?fields:\s?'[A-Za-z,áéíóú]*'\s?}/.match(line)
31
- # @outputs[index][:state] = :err
32
- # @outputs[index][:msg] = 'Table#fields malformed!'
33
- #end
34
28
  end
35
29
 
36
30
  def check_row(line, index)
@@ -109,7 +103,7 @@ module CheckTable
109
103
  if find_parent(index) != :table
110
104
  @outputs[index][:state] = :err
111
105
  @outputs[index][:msg] = 'Parent(concept) not found!'
112
- elsif !line.start_with? ' %template'
106
+ elsif !line.match(/^\s\s\s\s\s\s%template\s*/)
113
107
  @outputs[index][:state] = :err
114
108
  @outputs[index][:msg] = 'Write 6 spaces before %template'
115
109
  end
data/lib/asker/version.rb CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  class Asker
3
- VERSION = '2.5.3'
4
- NAME = 'asker'
5
- GEM = 'asker-tool'
6
- CONFIGFILE = 'asker.ini'
3
+ VERSION = "2.5.4"
4
+ NAME = "asker"
5
+ GEM = "asker-tool"
6
+ CONFIGFILE = "asker.ini"
7
7
  HOMEPAGE = "https://github.com/teuton-software/#{NAME}"
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asker-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.3
4
+ version: 2.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-25 00:00:00.000000000 Z
11
+ date: 2022-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml