chake 0.10.1 → 0.10.2

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: a6c0ada57c6acd1ba0a23069a528397144d0e61c
4
- data.tar.gz: 030adffa33315100225ab10a63a7038e9f6fd512
3
+ metadata.gz: 8a066ad18b894e6b4a17a6e67ddeea63e4120f56
4
+ data.tar.gz: 00cfd9eadc606cd339292a23ad92a35b1d519a96
5
5
  SHA512:
6
- metadata.gz: 866152de25dbedae6edc9b3ad993b425a468c04dfaf9e8fa13bb2ba597128801fbdc46f33ea101919dd02ea2e99a4de98e9c663ae72a12cfe84780ee7b527eac
7
- data.tar.gz: 608ccff3b9143a48bb16ca44f9746964f10481389e42cc91cf566889d2fdf224956a0f164b73d6515a7c7d9fb09fee8ef7488f7d2ef50aaec7666687e41e3a88
6
+ metadata.gz: 3c4df34f504c93cbc041bd7a0eb8364b8f82163ac9a0fafe7dbf8f2980d2792a7d3d9eba727cd8709889564edc0ba4ea653e986b93628d56d8d26b07caf2d6d8
7
+ data.tar.gz: 1e7531dd97822ec1afce9e1fc2b56175c6f0547639ccd9c5924846cefd369ca40be35c6c549ce5cd1306231681166608409b44b01c2c258cc93c5be54c3eb77e
data/ChangeLog.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 0.10.2
2
+
3
+ * Fix check for modified files at the upload phase. Now chake will properly
4
+ avoiding rsync calls when there is no changed files since the latest upload.
5
+ * Fix generated RPM spec file. Will now properly build, install, and work under
6
+ both CentOS 7 and Fedora 22+.
7
+ * Collect test coverage statistics when running tests.
8
+ * Added dependency on simplecov
9
+
1
10
  # 0.10.1
2
11
 
3
12
  * actually implement support for custom ports in Node URL's. Despite being
data/Rakefile CHANGED
@@ -34,7 +34,11 @@ task 'deb:install' => 'build:debsrc'do
34
34
  end
35
35
 
36
36
  desc 'Create source RPM package'
37
- task 'build:rpmsrc' => ['build:tarball', 'pkg/chake.spec']
37
+ task 'build:rpmsrc' => ['build:tarball', 'pkg/chake.spec'] do
38
+ chdir 'pkg' do
39
+ sh 'rpmbuild --define "_topdir .rpmbuild" --define "_sourcedir $(pwd)" --define "_srcrpmdir $(pwd)" -bs chake.spec --nodeps'
40
+ end
41
+ end
38
42
 
39
43
  file 'pkg/chake.spec' => ['chake.spec.erb', 'lib/chake/version.rb'] do |t|
40
44
  require 'erb'
data/chake.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
22
22
  spec.add_development_dependency "rspec"
23
+ spec.add_development_dependency "simplecov"
23
24
 
24
25
  spec.add_dependency "rake"
25
26
  end
data/chake.spec.erb CHANGED
@@ -1,47 +1,41 @@
1
- %define name <%= pkg.name %>
2
- %define version <%= pkg.version %>
3
- %define unmangled_version <%= pkg.version %>
4
- %define release 1
1
+ %define gem_name <%= pkg.name %>
5
2
 
6
3
  Summary: <%= pkg.summary %>
7
- Name: %{name}
8
- Version: %{version}
9
- Release: %{release}
10
- Source0: %{name}-%{unmangled_version}.tar.gz
4
+ Name: <%= pkg.name %>
5
+ Version: <%= pkg.version %>
6
+ Release: 1
7
+ Source0: %{name}-%{version}.tar.gz
11
8
  License: <%= pkg.license %>
12
9
  Group: Development/Tools
13
10
  Prefix: %{_prefix}
14
11
  Vendor: <%= pkg.authors.first %> <<%= pkg.email.first %>>
15
12
  Url: <%= pkg.homepage %>
16
13
  BuildArch: noarch
17
- BuildRequires: ruby, rubygem-rake, rubygem-bundler
14
+ BuildRequires: ruby, rubygems-devel, rubygem-rake, rubygem-bundler
18
15
  Requires: ruby, rubygem-rake
19
16
 
20
- %define gemdir <%= Gem.dir %>
21
- %define gembuilddir %{buildroot}%{gemdir}
22
-
23
17
  %description
24
18
  <%= pkg.description %>
25
19
 
26
20
  %prep
27
- %setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version}
21
+ %setup -n %{name}-%{version}
28
22
 
29
23
  %build
30
24
 
31
- %install
32
25
  %{__rm} -rf %{buildroot}
33
- mkdir -p %{gembuilddir}
34
26
  sed -i -e 's#spec.files\s*=.*#spec.files = Dir.glob("**/*")#' %{name}.gemspec
35
- rake build
36
- gem install --local --install-dir %{gembuilddir} --force pkg/%{name}-%{version}.gem
37
- mkdir -p %{buildroot}/%{_bindir}
38
- mv %{gembuilddir}/bin/* %{buildroot}/%{_bindir}
39
- rmdir %{gembuilddir}/bin
27
+ rake bundler:build
28
+ %gem_install -n pkg/%{name}-%{version}.gem
29
+
30
+ %install
31
+ cp -a usr %{buildroot}/usr
40
32
 
41
33
  %clean
42
34
  rm -rf $RPM_BUILD_ROOT
43
35
 
44
36
  %files
45
- %{gemdir}
46
- %{_bindir}/*
47
-
37
+ %{gem_instdir}/
38
+ %exclude %{gem_cache}
39
+ %{gem_spec}
40
+ %{_bindir}/chake
41
+ %doc %{gem_docdir}
@@ -15,5 +15,5 @@ manifest = %w[
15
15
 
16
16
  desc 'removes everything'
17
17
  task :clean do
18
- rm_rf Dir.glob('*') - manifest
18
+ rm_rf Dir.glob('**/*') - manifest
19
19
  end
data/lib/chake.rb CHANGED
@@ -99,14 +99,23 @@ def if_files_changed(node, group_name, files)
99
99
  if files.empty?
100
100
  return
101
101
  end
102
- hash = IO.popen(['sha1sum', *files]).read
102
+ hash_io = IO.popen(['xargs', 'sha1sum'], 'w+')
103
+ files.sort.each { |f| hash_io.puts(f) }
104
+ hash_io.close_write
105
+ current_hash = hash_io.read
106
+
103
107
  hash_file = File.join($chake_tmpdir, node + '.' + group_name + '.sha1sum')
104
- if !File.exists?(hash_file) || File.read(hash_file) != hash
108
+ hash_on_disk = nil
109
+ if File.exists?(hash_file)
110
+ hash_on_disk = File.read(hash_file)
111
+ end
112
+
113
+ if current_hash != hash_on_disk
105
114
  yield
106
115
  end
107
116
  FileUtils.mkdir_p(File.dirname(hash_file))
108
117
  File.open(hash_file, 'w') do |f|
109
- f.write(hash)
118
+ f.write(current_hash)
110
119
  end
111
120
  end
112
121
 
@@ -179,7 +188,8 @@ $nodes.each do |node|
179
188
  rsync = node.rsync + ["-avp"] + ENV.fetch('CHAKE_RSYNC_OPTIONS', '').split
180
189
  rsync_logging = Rake.application.options.silent && '--quiet' || '--verbose'
181
190
 
182
- files = Dir.glob("**/*").select { |f| !File.directory?(f) } - encrypted.keys - encrypted.values
191
+ hash_files = Dir.glob(File.join($chake_tmpdir, '*.sha1sum'))
192
+ files = Dir.glob("**/*").select { |f| !File.directory?(f) } - encrypted.keys - encrypted.values - hash_files
183
193
  if_files_changed(hostname, 'plain', files) do
184
194
  sh *rsync, '--delete', rsync_logging, *rsync_excludes, './', node.rsync_dest
185
195
  end
data/lib/chake/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chake
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'simplecov'
2
+ SimpleCov.start
3
+
1
4
  require 'chake/node'
2
5
  require 'chake/backend'
3
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Terceiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-22 00:00:00.000000000 Z
11
+ date: 2015-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: simplecov
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement