yast-rake 0.2.2 → 0.2.3

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
  SHA1:
3
- metadata.gz: 6064a1a8380fe02784d5f7009d4c700aa8d7980c
4
- data.tar.gz: 12db5b4793732221de0f81a7e94941e66d7d825d
3
+ metadata.gz: 987f4cd3885cd4cfeffc8ffdcbd6dea09e239385
4
+ data.tar.gz: e15456ac4b3f2efcd5bc842da7ece0af231a62d9
5
5
  SHA512:
6
- metadata.gz: aeb3e3082628dc89e9c39c794f2eaba7914ff167de09d33fbed35289beb22027a39b9f95f309d3f8163cd4018e1af431e0e35755804a12634aa44e3a09b56e3e
7
- data.tar.gz: eba47c56dda60084cd00e3dc6e447c289250d0554a6f384176c1179a928bc7564243b0c9acfb4aa8f96860e0e19a9a160d969cfdff931c021a18988a6f4f5fa6
6
+ metadata.gz: 10510fff5bdb332e5ed86bfa457d73a1372977204ceec9da0fb47a5be7315bfbc7e45997b68125507ff7cf3fccfd02698de37474333c09e76bce36c9252e2117
7
+ data.tar.gz: ba9315a1341830700b547e32f1795b417cbc55b3f2c69bdaa9f830980c3bef901ac67880b7b104c565ec94e4f2416bba1b750863833e91fff09a17e9a431a248
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -23,15 +23,14 @@ module Packaging
23
23
  class Configuration
24
24
  attr_writer :install_locations
25
25
 
26
- DESTDIR = ENV['DESTDIR'] || '/'
27
- YAST_DIR = DESTDIR + '/usr/share/YaST2/'
28
- YAST_LIB_DIR = DESTDIR + '/usr/lib/YaST2/'
29
- YAST_DESKTOP_DIR = DESTDIR + '/usr/share/applications/YaST2/'
30
- AUTOYAST_RNC_DIR = YAST_DIR + 'schema/autoyast/rnc/'
31
- FILLUP_DIR = DESTDIR + '/var/adm/fillup-templates/'
26
+ DESTDIR = ENV["DESTDIR"] || "/"
27
+ YAST_DIR = DESTDIR + "/usr/share/YaST2/"
28
+ YAST_LIB_DIR = DESTDIR + "/usr/lib/YaST2/"
29
+ YAST_DESKTOP_DIR = DESTDIR + "/usr/share/applications/YaST2/"
30
+ AUTOYAST_RNC_DIR = YAST_DIR + "schema/autoyast/rnc/"
31
+ FILLUP_DIR = DESTDIR + "/var/adm/fillup-templates/"
32
32
 
33
-
34
- #specific directory that contain dynamic part of package name
33
+ # specific directory that contain dynamic part of package name
35
34
  def install_doc_dir
36
35
  DESTDIR + "/usr/share/doc/packages/#{package_name}/"
37
36
  end
@@ -52,7 +51,7 @@ module Packaging
52
51
  "**/src/autoyast[_-]rnc/*" => AUTOYAST_RNC_DIR,
53
52
  "**/src/fillup/*" => FILLUP_DIR,
54
53
  "**/src/desktop/*.desktop" => YAST_DESKTOP_DIR,
55
- "{README*,COPYING,CONTRIBUTING.md}" => install_doc_dir,
54
+ "{README*,COPYING,CONTRIBUTING.md}" => install_doc_dir
56
55
  }
57
56
  end
58
57
  end
@@ -62,7 +61,7 @@ desc "Install to system"
62
61
  task :install do
63
62
  config = ::Packaging::Configuration.instance
64
63
  config.install_locations.each_pair do |glob, install_to|
65
- FileUtils.mkdir_p(install_to, :verbose => true) unless File.directory?(install_to)
64
+ FileUtils.mkdir_p(install_to, verbose: true) unless File.directory?(install_to)
66
65
  Dir[glob].each do |source|
67
66
  begin
68
67
  # do not use FileUtils.cp_r as it have different behavior if target
data/lib/tasks/pot.rake CHANGED
@@ -52,14 +52,14 @@ namespace :check do
52
52
 
53
53
  desc "Check translatable strings for common mistakes"
54
54
  # depends on the global "pot" task defined above
55
- task :pot => :"rake:pot" do
55
+ task pot: :"rake:pot" do
56
56
  Dir["*.pot"].each do |pot|
57
57
  puts "Checking #{pot}..."
58
58
  lines = File.readlines(pot)
59
59
  # remove comments
60
- lines.reject!{ |line| line.match(/^#/) }
60
+ lines.reject! { |line| line.match(/^#/) }
61
61
  # Ruby substitution present?
62
- lines.select!{ |line| line.include?('#{') }
62
+ lines.select! { |line| line.include?("\#{") }
63
63
 
64
64
  clean_pot_lines(lines)
65
65
 
data/lib/tasks/run.rake CHANGED
@@ -21,8 +21,8 @@ def set_y2dir
21
21
  end
22
22
 
23
23
  desc "Run given client"
24
- task :run, :client do |t, args|
25
- args.with_defaults = { :client => nil }
24
+ task :run, :client do |_t, args|
25
+ args.with_defaults = { client: nil }
26
26
  client = args[:client]
27
27
  if client
28
28
  client = Dir["**/src/clients/#{client}.rb"].first
@@ -27,8 +27,8 @@
27
27
  # The custom dictionaries are defined at the "dictionary" key.
28
28
  #
29
29
 
30
- require 'rake'
31
- require 'rake/tasklib'
30
+ require "rake"
31
+ require "rake/tasklib"
32
32
 
33
33
  module Yast
34
34
  # Defines a spellcheck rake task
@@ -44,7 +44,6 @@ module Yast
44
44
  run_task
45
45
  end
46
46
  end
47
-
48
47
  end
49
48
 
50
49
  private
@@ -86,8 +85,8 @@ module Yast
86
85
  # evaluate the files to check
87
86
  # @return [Array<String>] list of files
88
87
  def files_to_check
89
- files = config["check"].reduce([]) {|acc, glob| acc + Dir[glob]}
90
- config["ignore"].reduce(files) {|acc, glob| acc - Dir[glob]}
88
+ files = config["check"].reduce([]) { |a, e| a + Dir[e] }
89
+ config["ignore"].reduce(files) { |a, e| a - Dir[e] }
91
90
  end
92
91
 
93
92
  # read a Yaml config file
@@ -108,7 +107,7 @@ module Yast
108
107
 
109
108
  $stderr.puts "Warning: Found dictionary duplicates in the local dictionary " \
110
109
  "(#{CUSTOM_SPELL_CONFIG_FILE}):\n"
111
- duplicates.each {|duplicate| $stderr.puts " #{duplicate}" }
110
+ duplicates.each { |duplicate| $stderr.puts " #{duplicate}" }
112
111
  $stderr.puts
113
112
  end
114
113
 
@@ -145,7 +144,7 @@ module Yast
145
144
  next if misspelled.empty?
146
145
 
147
146
  success = false
148
- misspelled.each {|word| text.gsub!(word, Rainbow(word).red)} if colorize?
147
+ misspelled.each { |word| text.gsub!(word, Rainbow(word).red) } if colorize?
149
148
  puts "#{file}:#{index + 1}: \"#{text}\""
150
149
 
151
150
  misspelled.each { |word| puts " #{word.inspect} => #{speller.suggest(word)}" }
@@ -165,6 +164,5 @@ module Yast
165
164
  exit 1
166
165
  end
167
166
  end
168
-
169
167
  end
170
168
  end
data/lib/yast/rake.rb CHANGED
@@ -17,11 +17,12 @@
17
17
  #++
18
18
  require "packaging"
19
19
 
20
- #create wrapper to Packaging Configuration
20
+ # create wrapper to Packaging Configuration
21
21
  module Yast
22
+ # Yast::Task module contains helper methods
22
23
  module Tasks
23
- def self.configuration &block
24
- ::Packaging.configuration &block
24
+ def self.configuration(&block)
25
+ ::Packaging.configuration(&block)
25
26
  end
26
27
 
27
28
  # read the version from spec file
@@ -45,7 +46,7 @@ task.enhance(prerequisites)
45
46
  Yast::Tasks.configuration do |conf|
46
47
  conf.obs_project = "YaST:Head"
47
48
  conf.obs_sr_project = "openSUSE:Factory"
48
- conf.package_name = File.read("RPMNAME").strip if File.exists?("RPMNAME")
49
+ conf.package_name = File.read("RPMNAME").strip if File.exist?("RPMNAME")
49
50
  conf.version = Yast::Tasks.spec_version if !Dir.glob("package/*.spec").empty?
50
51
  conf.skip_license_check << /spell.dict$/ # skip license check for spelling dictionaries
51
52
  end
@@ -56,3 +57,9 @@ Dir["#{task_path}/*.rake"].each do |f|
56
57
  load f
57
58
  end
58
59
 
60
+ # optionally load the tasks from yast-rake-ci if it is installed
61
+ begin
62
+ require "yast/rake_ci"
63
+ rescue LoadError
64
+ puts "INFO: Gem yast-rake-ci not installed, extra tasks not loaded" if verbose == true
65
+ end
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.2
4
+ version: 0.2.3
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-04-24 00:00:00.000000000 Z
11
+ date: 2015-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake