yast-rake 0.2.5 → 0.2.6

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: 0fe0b76bd49d29bd581db9fbcb22306d564dae70
4
- data.tar.gz: 126886684aadad90708b460942254499108a72f8
3
+ metadata.gz: 602cb3ffa09897e935c19856b481fee257028d6c
4
+ data.tar.gz: 38d79c6e7e3d89f1cbd6a12b51723406eed6c9b4
5
5
  SHA512:
6
- metadata.gz: d063dfbab2aba4a9180ce1eb9264e24d698608c553faf2128299b2b8b49ebcbb085d11cf87b158abdf346c96bde668a45e67cd7e5b124e5920f115413b46b7b9
7
- data.tar.gz: dde72987de805818b78396879421d8a7dc08317800febe398e90cfdec81f2c3cc9e85289595743d3e3178b8abb2817bb1dc74a575af687fe4e054057ffbcb1f3
6
+ metadata.gz: 2405491a1b62927cda131b1ca48f8fe92bd473db6b2b5377d3ee248fe19861cb5e8f4a15e5ddb4bb2b93e86c172d9b525e894429946b5fc52462bacb46f82356
7
+ data.tar.gz: 5950d128d9bb248a932676351c4a874fab4292be6fedf1ec1d5537126d439c051dda5ef92333f1d18ef4f6d0c2785785a9631a06fd4631f7f4e8b7a9f816a078
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
@@ -17,7 +17,7 @@
17
17
  obs_api: "https://api.suse.de/"
18
18
  obs_project: "Devel:YaST:Head"
19
19
  obs_sr_project: "SUSE:SLE-12-SP2:GA"
20
- obs_target: "SLE-12-SP1"
20
+ obs_target: "SLE-12-SP2-GA"
21
21
  :factory:
22
22
  obs_project: "YaST:Head"
23
23
  obs_sr_project: "openSUSE:Factory"
@@ -140,20 +140,40 @@ module Yast
140
140
 
141
141
  success = true
142
142
  lines.each_with_index do |text, index|
143
- misspelled = speller.list_misspelled([text]) - config["dictionary"]
143
+ misspelled = misspelled_on_line(text)
144
144
  next if misspelled.empty?
145
145
 
146
146
  success = false
147
- misspelled.each { |word| text.gsub!(word, Rainbow(word).red) } if colorize?
148
- puts "#{file}:#{index + 1}: \"#{text}\""
149
-
150
- misspelled.each { |word| puts " #{word.inspect} => #{speller.suggest(word)}" }
151
- puts
147
+ print_misspelled(misspelled, index, text)
152
148
  end
153
149
 
154
150
  success
155
151
  end
156
152
 
153
+ def print_misspelled(list, index, text)
154
+ list.each { |word| text.gsub!(word, Rainbow(word).red) } if colorize?
155
+ puts "#{file}:#{index + 1}: \"#{text}\""
156
+
157
+ list.each { |word| puts " #{word.inspect} => #{speller.suggest(word)}" }
158
+ puts
159
+ end
160
+
161
+ def misspelled_on_line(text)
162
+ switch_block_tag if block_line?(text)
163
+ return [] if inside_block
164
+ speller.list_misspelled([text]) - config["dictionary"]
165
+ end
166
+
167
+ def block_line?(line)
168
+ line =~ /^\s*```/
169
+ end
170
+
171
+ def switch_block_tag
172
+ @inside_block = !@inside_block
173
+ end
174
+
175
+ attr_reader :inside_block
176
+
157
177
  # run the task
158
178
  def run_task
159
179
  if files_to_check.all? { |file| check_file(file) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yast-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Reidinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-04 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake