yast-rake 0.2.33 → 0.2.34

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: aaa008190c1fafe2ba6626b4122791f3f8a1836d3cea7a0a062b3fcd28fea0a9
4
- data.tar.gz: 59bfc610ce26b37f11d40d0e525342d1a78c27680b11a4cf0450d44aa5e1a3a7
3
+ metadata.gz: cf7eceae62dd270be7aa3d585c849f167de79e3fc0d2c19227115a9a31369c2c
4
+ data.tar.gz: 8d1a2b6238bb073661dcc3094fff41b29fb48d1f44725b897e7dc432bb8eb425
5
5
  SHA512:
6
- metadata.gz: 9acd95cd06cc8e22f902b03d7f1fef22a563a87d3272aa2b330ab825887bb6e89b69245bbda0f72e387b3fbc062231cf9923defeb884ab4574b10179f7c4f920
7
- data.tar.gz: 9bae5c07747905387532cb44bb08c214af492f59358d65b4cbcdc3d9271450dabb9ac3dbbbcec5b7f45c166f63a1199bda141d5fac9efdfa86dc2703d65cc675
6
+ metadata.gz: dcde1b6fcd4e201951b0394478e01f0025ec6b0cca159da600bfe2076ef04c5b4df4da4574b0a49724966269d5473f32428e8267a87b88fa83d374a44755df00
7
+ data.tar.gz: e7711375a60035a0e7505f52c1481943d8208102a9b7c1164610beeef91c4c64db5137c55ed12904666f8fe747a3df94cc996566ef3f0aa305351bb016366799
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.33
1
+ 0.2.34
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -76,13 +78,13 @@ task :install do
76
78
  config.install_locations.each_pair do |glob, install_to|
77
79
  FileUtils.mkdir_p(install_to, verbose: true) unless File.directory?(install_to)
78
80
  Dir[glob].each do |source|
79
- begin
80
- # do not use FileUtils.cp_r as it have different behavior if target
81
- # exists and we copy a symlink
82
- sh "cp -r '#{source}' '#{install_to}'"
83
- rescue => e
84
- raise "Cannot install file #{source} to #{install_to}: #{e.message}"
85
- end
81
+
82
+ # do not use FileUtils.cp_r as it have different behavior if target
83
+ # exists and we copy a symlink
84
+ sh "cp -r '#{source}' '#{install_to}'"
85
+ rescue StandardError => e
86
+ raise "Cannot install file #{source} to #{install_to}: #{e.message}"
87
+
86
88
  end
87
89
  end
88
90
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -27,16 +29,16 @@ end
27
29
  namespace :check do
28
30
  # print failed lines and a hint to STDERR
29
31
  def report_pot_errors(lines)
30
- $stderr.puts "Failed lines:"
31
- $stderr.puts "-" * 30
32
- $stderr.puts lines
33
- $stderr.puts "-" * 30
32
+ warn "Failed lines:"
33
+ warn "-" * 30
34
+ warn lines
35
+ warn "-" * 30
34
36
  $stderr.puts
35
- $stderr.puts "Note: \#{foo} substitution in translatable strings does" \
37
+ warn "Note: \#{foo} substitution in translatable strings does" \
36
38
  " not work properly, use"
37
- $stderr.puts " _(\"foo %{bar} baz\") % { :bar => bar }"
38
- $stderr.puts "or"
39
- $stderr.puts " _(\"foo %s baz\") % bar"
39
+ warn " _(\"foo %{bar} baz\") % { :bar => bar }"
40
+ warn "or"
41
+ warn " _(\"foo %s baz\") % bar"
40
42
  $stderr.puts
41
43
  end
42
44
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -13,6 +15,20 @@
13
15
  #
14
16
  #++
15
17
 
18
+ def rubocop_bin
19
+ return @rubocop_bin if @rubocop_bin
20
+ return @rubocop_bin = ENV["RUBOCOP_BIN"] if ENV["RUBOCOP_BIN"]
21
+
22
+ version = File.read(".rubocop.yml").include?("rubocop-0.71.0") ? "0.71.0" : "0.41.2"
23
+ binary = `/usr/sbin/update-alternatives --list rubocop | grep '#{version}'`.strip
24
+ if !system("which #{binary}")
25
+ raise "cannot find proper version of rubocop binary in " \
26
+ "'/usr/sbin/update-alternatives --list rubocop'." \
27
+ "If rubocop is installed via gem, define its binary name via env variable RUBOCOP_BIN."
28
+ end
29
+ @rubocop_bin = binary
30
+ end
31
+
16
32
  # run Rubocop in parallel
17
33
  # @param params [String] optional Rubocop parameters
18
34
  def run_rubocop(params = "")
@@ -26,8 +42,8 @@ def run_rubocop(params = "")
26
42
  # a) use -P with number of processors to run the commands in parallel
27
43
  # b) use -n to set the maximum number of files per process, this number
28
44
  # is computed to equally distribute the files across the workers
29
- sh "rubocop -L | sort -R | xargs -P`nproc` -n$(expr `rubocop -L | wc -l` / " \
30
- "`nproc` + 1) rubocop #{params}"
45
+ sh "#{rubocop_bin} -L | sort -R | xargs -P`nproc` -n$(expr `#{rubocop_bin} -L | wc -l` / " \
46
+ "`nproc` + 1) #{rubocop_bin} #{params}"
31
47
  end
32
48
 
33
49
  namespace :check do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -32,8 +34,9 @@ task :run, :client do |_t, args|
32
34
  clients = Dir["**/src/clients/*.rb"]
33
35
  client = clients.reduce do |min, n|
34
36
  next n if min.nil?
37
+
35
38
  # use client with shortest name by default
36
- min.size > n.size ? n : min
39
+ (min.size > n.size) ? n : min
37
40
  end
38
41
  end
39
42
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -33,8 +35,8 @@ require "rake/tasklib"
33
35
  module Yast
34
36
  # Defines a spellcheck rake task
35
37
  class SpellcheckTask < Rake::TaskLib
36
- GLOBAL_SPELL_CONFIG_FILE = File.expand_path("../spell.yml", __FILE__)
37
- CUSTOM_SPELL_CONFIG_FILE = ".spell.yml".freeze
38
+ GLOBAL_SPELL_CONFIG_FILE = File.expand_path("spell.yml", __dir__)
39
+ CUSTOM_SPELL_CONFIG_FILE = ".spell.yml"
38
40
 
39
41
  # define the Rake task in the constructor
40
42
  def initialize
@@ -65,11 +67,12 @@ module Yast
65
67
  # @return [Aspell] the speller object
66
68
  def speller
67
69
  return @speller if @speller
70
+
68
71
  # raspell is an optional dependency, handle the missing case nicely
69
72
  begin
70
73
  require "raspell"
71
74
  rescue LoadError
72
- $stderr.puts "ERROR: Ruby gem \"raspell\" is not installed."
75
+ warn "ERROR: Ruby gem \"raspell\" is not installed."
73
76
  exit 1
74
77
  end
75
78
 
@@ -105,9 +108,9 @@ module Yast
105
108
  duplicates = dict1 & dict2
106
109
  return if duplicates.empty?
107
110
 
108
- $stderr.puts "Warning: Found dictionary duplicates in the local dictionary " \
111
+ warn "Warning: Found dictionary duplicates in the local dictionary " \
109
112
  "(#{CUSTOM_SPELL_CONFIG_FILE}):\n"
110
- duplicates.each { |duplicate| $stderr.puts " #{duplicate}" }
113
+ duplicates.each { |duplicate| warn " #{duplicate}" }
111
114
  $stderr.puts
112
115
  end
113
116
 
@@ -161,6 +164,7 @@ module Yast
161
164
  def misspelled_on_line(text)
162
165
  switch_block_tag if block_line?(text)
163
166
  return [] if inside_block
167
+
164
168
  speller.list_misspelled([text]) - config["dictionary"]
165
169
  end
166
170
 
@@ -179,7 +183,7 @@ module Yast
179
183
  if files_to_check.all? { |file| check_file(file) }
180
184
  puts "Spelling OK."
181
185
  else
182
- $stderr.puts "Spellcheck failed! (Fix it or add the words to " \
186
+ warn "Spellcheck failed! (Fix it or add the words to " \
183
187
  "'#{CUSTOM_SPELL_CONFIG_FILE}' file if it is OK.)"
184
188
  exit 1
185
189
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -36,6 +38,8 @@ def run_parallel_tests(files)
36
38
  Coveralls::RakeTask.new
37
39
  Rake::Task["coveralls:push"].invoke
38
40
  end
41
+
42
+ nil
39
43
  end
40
44
 
41
45
  def run_sequential_tests(files)
@@ -56,7 +60,7 @@ namespace :test do
56
60
  run_parallel_tests(files)
57
61
  else
58
62
  if parallel_tests_wanted?
59
- $stderr.puts "WARNING: parallel tests enabled, but 'parallel_rspec' is" \
63
+ warn "WARNING: parallel tests enabled, but 'parallel_rspec' is" \
60
64
  " not installed, falling back to the standard 'rspec' runner."
61
65
  end
62
66
  run_sequential_tests(files)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -36,7 +38,7 @@ Yast::Tasks.configuration do |conf|
36
38
  end
37
39
 
38
40
  # load own tasks
39
- task_path = File.expand_path("../../tasks", __FILE__)
41
+ task_path = File.expand_path("../tasks", __dir__)
40
42
  Dir["#{task_path}/*.rake"].each do |f|
41
43
  load f
42
44
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Yast rake
3
5
  #
@@ -23,7 +25,7 @@ module Yast
23
25
  # Yast::Task module contains helper methods
24
26
  module Tasks
25
27
  # Targets definition
26
- TARGETS_FILE = File.expand_path("../../../data/targets.yml", __FILE__)
28
+ TARGETS_FILE = File.expand_path("../../data/targets.yml", __dir__)
27
29
 
28
30
  def self.configuration(&block)
29
31
  ::Packaging.configuration(&block)
@@ -34,7 +36,7 @@ module Yast
34
36
  # use the first *.spec file found, assume all spec files
35
37
  # contain the same version
36
38
  File.readlines(Dir.glob("package/*.spec").first)
37
- .grep(/^\s*Version:\s*/).first.sub("Version:", "").strip
39
+ .grep(/^\s*Version:\s*/).first.sub("Version:", "").strip
38
40
  end
39
41
 
40
42
  def self.submit_to(target, file = TARGETS_FILE)
@@ -43,6 +45,7 @@ module Yast
43
45
  if config.nil?
44
46
  raise "No configuration found for #{target}. Known values: #{targets.keys.join(", ")}"
45
47
  end
48
+
46
49
  Yast::Tasks.configuration do |conf|
47
50
  config.each do |meth, val|
48
51
  conf.public_send("#{meth}=", val)
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yast-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.33
4
+ version: 0.2.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Reidinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-20 00:00:00.000000000 Z
11
+ date: 2019-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: packaging_rake_tasks
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 1.1.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 1.1.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: packaging_rake_tasks
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.4
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.1.4
40
+ version: '0'
41
41
  description: |
42
42
  Rake tasks that support work-flow of Yast developer. It allows packaging repo,
43
43
  send it to build service, create submit request to target repo or run client
@@ -80,7 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  requirements: []
83
- rubygems_version: 3.0.3
83
+ rubyforge_project:
84
+ rubygems_version: 2.7.3
84
85
  signing_key:
85
86
  specification_version: 4
86
87
  summary: Rake tasks providing basic work-flow for Yast development