yast-rake 0.1.2 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a09aae6b96cc31e9d1d23afd7920fe9e5072675b
4
+ data.tar.gz: 259e3bbf9a822b87990672b34d827c1e2f04afd2
5
+ SHA512:
6
+ metadata.gz: c53b13f02b671e21405c6f16985ab212d533a4695842cff79ef37f5e42c264028b13017fd560375089c76739499625792f97621266d32898872089dfa751af63
7
+ data.tar.gz: 549108747e776479965523e872f0062201a5eb6a5bd964ff70f3638ffaf0b37b96878e48e90833addb0f3b2db9645491e0cce24ce3cb899430084dcd49135785
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.5
data/lib/tasks/run.rake CHANGED
@@ -21,23 +21,24 @@ def set_y2dir
21
21
  end
22
22
 
23
23
  desc "Run given client"
24
- task :run, :client do |t,args|
24
+ task :run, :client do |t, args|
25
25
  args.with_defaults = { :client => nil }
26
- if args[:client]
27
- args[:client] = Dir["**/src/clients/#{args[:client]}.rb"].first
26
+ client = args[:client]
27
+ if client
28
+ client = Dir["**/src/clients/#{client}.rb"].first
28
29
  else
29
30
  clients = Dir["**/src/clients/*.rb"]
30
- args[:client] = clients.reduce do |min, n|
31
+ client = clients.reduce do |min, n|
31
32
  next n if min.nil?
32
33
  # use client with shortest name by default
33
34
  min.size > n.size ? n : min
34
35
  end
35
36
  end
36
37
 
37
- raise "No client found" unless args[:client]
38
+ raise "No client found" unless client
38
39
 
39
40
  set_y2dir
40
- sh "/sbin/yast2 #{args[:client]}"
41
+ sh "/sbin/yast2 #{client}"
41
42
  end
42
43
 
43
44
  desc "Runs console with preloaded module directories"
@@ -1,7 +1,7 @@
1
1
  namespace :test do
2
2
  desc "Runs unit tests."
3
3
  task "unit" do
4
- Dir["test/**/*_{spec,test}.rb"].each do |f|
4
+ Dir["**/test/**/*_{spec,test}.rb"].each do |f|
5
5
  sh "rspec --color --format doc '#{f}'"
6
6
  end
7
7
  end
@@ -17,19 +17,23 @@
17
17
  #++
18
18
  namespace :version do
19
19
  def version
20
- File.read("VERSION").strip
20
+ Yast::Tasks.spec_version
21
21
  end
22
22
 
23
- desc "Increase last part of version of file and propagate change with update_spec"
23
+ desc "Increase the last part of version in package/*.spec files"
24
24
  task :bump do
25
25
  version_parts = version.split(".")
26
26
  version_parts[-1] = (version_parts.last.to_i + 1).to_s
27
- File.write("VERSION", version_parts.join(".") + "\n")
28
- Rake::Task["version:update_spec"].execute
29
- end
27
+ new_version = version_parts.join(".")
28
+
29
+ puts "Updating version to #{new_version}"
30
+
31
+ # update all present *.spec files
32
+ Dir.glob("package/*.spec").each do |spec_file|
33
+ spec = File.read(spec_file)
34
+ spec.gsub!(/^\s*Version:.*$/, "Version: #{new_version}")
30
35
 
31
- desc "Propagate version from VERSION file to rpm spec file"
32
- task :update_spec do
33
- sh "sed -i 's/\\(^Version:[[:space:]]*\\)[0-9.]\\+/\\1#{version}/' package/*.spec"
36
+ File.write(spec_file, spec)
37
+ end
34
38
  end
35
39
  end
data/lib/yast/rake.rb CHANGED
@@ -23,6 +23,14 @@ module Yast
23
23
  def self.configuration &block
24
24
  ::Packaging.configuration &block
25
25
  end
26
+
27
+ # read the version from spec file
28
+ def self.spec_version
29
+ # use the first *.spec file found, assume all spec files
30
+ # contain the same version
31
+ File.readlines(Dir.glob("package/*.spec").first)
32
+ .grep(/^\s*Version:\s*/).first.sub("Version:", "").strip
33
+ end
26
34
  end
27
35
  end
28
36
 
@@ -31,8 +39,6 @@ end
31
39
  task = Rake::Task["package"]
32
40
  prerequisites = task.prerequisites
33
41
  prerequisites.delete("test")
34
- # ensure we have proper version in spec
35
- prerequisites.push("version:update_spec")
36
42
 
37
43
  task.enhance(prerequisites)
38
44
 
@@ -40,6 +46,7 @@ Yast::Tasks.configuration do |conf|
40
46
  conf.obs_project = "YaST:Head"
41
47
  conf.obs_sr_project = "openSUSE:Factory"
42
48
  conf.package_name = File.read("RPMNAME").strip if File.exists?("RPMNAME")
49
+ conf.version = Yast::Tasks.spec_version
43
50
  end
44
51
 
45
52
  # load own tasks
metadata CHANGED
@@ -1,56 +1,47 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yast-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Josef Reidinger
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-15 00:00:00.000000000 Z
11
+ date: 2014-01-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: packaging_rake_tasks
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.0.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: 1.0.0
46
- description: ! 'Rake tasks that support work-flow of Yast developer. It allows packaging
47
- repo,
48
-
41
+ description: |
42
+ Rake tasks that support work-flow of Yast developer. It allows packaging repo,
49
43
  send it to build service, create submit request to target repo or run client
50
-
51
44
  from git repo.
52
-
53
- '
54
45
  email: jreidinger@suse.cz
55
46
  executables: []
56
47
  extensions: []
@@ -65,27 +56,26 @@ files:
65
56
  homepage: http://github.org/openSUSE/yast-rake
66
57
  licenses:
67
58
  - LGPL v2.1
59
+ metadata: {}
68
60
  post_install_message:
69
61
  rdoc_options: []
70
62
  require_paths:
71
63
  - lib
72
64
  required_ruby_version: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  required_rubygems_version: !ruby/object:Gem::Requirement
79
- none: false
80
70
  requirements:
81
- - - ! '>='
71
+ - - '>='
82
72
  - !ruby/object:Gem::Version
83
73
  version: '0'
84
74
  requirements: []
85
75
  rubyforge_project:
86
- rubygems_version: 1.8.23
76
+ rubygems_version: 2.0.3
87
77
  signing_key:
88
- specification_version: 3
78
+ specification_version: 4
89
79
  summary: Rake tasks providing basic work-flow for Yast development
90
80
  test_files: []
91
81
  has_rdoc: