chake 0.2.2 → 0.2.3

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: e3f230a2853147575f1d743e3cc54e39153bdff2
4
- data.tar.gz: 5f83cda5a8619054fee7d05055db00a45e492568
3
+ metadata.gz: fb57e3e260528eaf17a91083a19f87a4285637ec
4
+ data.tar.gz: 1a322072a748b118893ef5848fd7bb8d67f55b84
5
5
  SHA512:
6
- metadata.gz: bad942fb4f796cca7160f12ad2e692daa4f7c2005ef3a7aecc5ac1cec3b3a0bf322a81b2f6af4689df92446f7a3aa513c9a7474d252527c58e1a2824388841f1
7
- data.tar.gz: 4e7fc7bceb84d26ee6ab29ee4c8075b3f8e3087537aa65f56e4880cc63671ecc2aaa708b48577014bf2c7228d33d7279921f6ef62d10e7b5fd39c4d69ebffe03
6
+ metadata.gz: db1227f01c1dc35ec10633fd7c17ebe0ba50b9e4bffecc73d80b8624a772fcc87f93bd8d7fc11f42e9feae5bb4d6dd189ff58e057c5c64e42fa9e6325243f92d
7
+ data.tar.gz: 48cd44d3be61043676425b479366c281d133c4741b4193923cd60a43f9870fd8c516b6c9b4127a4f3cd9031b5f30fa564bc39f2734cc765a3c3bfdbc772c014d
data/ChangeLog.md ADDED
@@ -0,0 +1,5 @@
1
+ # 0.2.3
2
+
3
+ * No functional changes
4
+ * Small changes to make chake compatible with Debian 7, and most of the
5
+ RPM-based distributions
data/Rakefile CHANGED
@@ -1,7 +1,85 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- task :default do
3
+ task :test do
4
4
  sh 'rspec', '--color'
5
5
  end
6
6
 
7
- task :release => :default
7
+ pkg = Gem::Specification.load('chake.gemspec')
8
+
9
+ task :build do
10
+ chdir 'pkg' do
11
+ sh 'gem2tgz', "#{pkg.name}-#{pkg.version}.gem"
12
+ end
13
+ end
14
+
15
+ desc 'Create Debian source package'
16
+ task 'build:debsrc' => [:build] do
17
+ dirname = "#{pkg.name}-#{pkg.version}"
18
+ chdir 'pkg' do
19
+ sh 'gem2deb', '--no-wnpp-check', '-s', '-p', pkg.name, "#{dirname}.gem"
20
+ chdir dirname do
21
+ sh 'dpkg-buildpackage', '-S', '-us', '-uc'
22
+ end
23
+ end
24
+ end
25
+
26
+ desc 'Create source RPM package'
27
+ task 'build:rpmsrc' => [:build, 'pkg/chake.spec']
28
+
29
+ file 'pkg/chake.spec' => 'chake.spec.erb' do |t|
30
+ require 'erb'
31
+ pkg = Gem::Specification.load('chake.gemspec')
32
+ template = ERB.new(File.read('chake.spec.erb'))
33
+ File.open(t.name, 'w') do |f|
34
+ f.puts(template.result(binding))
35
+ end
36
+ puts "Generated #{t.name}"
37
+ end
38
+
39
+ task 'build:all' => ['build:debsrc', 'build:rpmsrc']
40
+
41
+ task :obs => 'build:all' do
42
+ if !File.exist?('tmp/obs/home:terceiro:chake/chake')
43
+ mkdir_p 'tmp/obs'
44
+ chdir 'tmp/obs' do
45
+ sh 'osc', 'checkout', 'home:terceiro:chake', 'chake'
46
+ end
47
+ end
48
+
49
+ # remove old files
50
+ chdir 'tmp/obs/home:terceiro:chake/chake' do
51
+ Dir.glob('*').each do |f|
52
+ sh 'osc', 'remove', '--force', f
53
+ end
54
+ end
55
+
56
+ # copy over new files
57
+ [
58
+ "pkg/#{pkg.name}-#{pkg.version}.tar.gz",
59
+ "pkg/#{pkg.name}.spec",
60
+ "pkg/#{pkg.name}_#{pkg.version}.orig.tar.gz",
61
+ "pkg/#{pkg.name}_#{pkg.version}-1.debian.tar.xz",
62
+ "pkg/#{pkg.name}_#{pkg.version}-1.dsc",
63
+ ].each do |f|
64
+ sh 'cp', '--dereference', f, 'tmp/obs/home:terceiro:chake/chake'
65
+ end
66
+
67
+ # push new files to the repository
68
+ chdir 'tmp/obs/home:terceiro:chake/chake' do
69
+ Dir.glob('*').each do |f|
70
+ sh 'osc', 'add', f
71
+ end
72
+ sh 'osc', 'commit', '--message', "#{pkg.name}, version #{pkg.version}"
73
+ end
74
+
75
+ end
76
+
77
+ desc 'lists changes since last release'
78
+ task :changelog do
79
+ last_tag = `git tag | sort -V`.split.last
80
+ sh 'git', 'shortlog', last_tag + '..'
81
+ end
82
+
83
+ task :release => [:test, :obs]
84
+
85
+ task :default => :test
data/chake.spec.erb ADDED
@@ -0,0 +1,46 @@
1
+ %define name <%= pkg.name %>
2
+ %define version <%= pkg.version %>
3
+ %define unmangled_version <%= pkg.version %>
4
+ %define release 1
5
+
6
+ Summary: <%= pkg.summary %>
7
+ Name: %{name}
8
+ Version: %{version}
9
+ Release: %{release}
10
+ Source0: %{name}-%{unmangled_version}.tar.gz
11
+ License: <%= pkg.license %>
12
+ Group: Development/Tools
13
+ Prefix: %{_prefix}
14
+ Vendor: <%= pkg.authors.first %> <<%= pkg.email.first %>>
15
+ Url: <%= pkg.homepage %>
16
+ BuildArch: noarch
17
+ BuildRequires: ruby, rubygem-rake, rubygem-bundler
18
+ Requires: ruby, rubygem-rake
19
+
20
+ %define gemdir <%= Gem.dir %>
21
+ %define gembuilddir %{buildroot}%{gemdir}
22
+
23
+ %description
24
+ <%= pkg.description %>
25
+
26
+ %prep
27
+ %setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version}
28
+
29
+ %build
30
+
31
+ %install
32
+ %{__rm} -rf %{buildroot}
33
+ mkdir -p %{gembuilddir}
34
+ rake build
35
+ gem install --local --install-dir %{gembuilddir} --force pkg/*.gem
36
+ mkdir -p %{buildroot}/%{_bindir}
37
+ mv %{gembuilddir}/bin/* %{buildroot}/%{_bindir}
38
+ rmdir %{gembuilddir}/bin
39
+
40
+ %clean
41
+ rm -rf $RPM_BUILD_ROOT
42
+
43
+ %files
44
+ /usr/lib/chake
45
+ %{_bindir}/*
46
+
data/lib/chake/node.rb CHANGED
@@ -26,7 +26,7 @@ module Chake
26
26
 
27
27
  @backend_name = uri.scheme
28
28
 
29
- @hostname = uri.hostname
29
+ @hostname = uri.host
30
30
  @username = uri.user || Etc.getpwuid.name
31
31
  @path = uri.path || "/var/tmp/chef.#{username}"
32
32
  @data = data
data/lib/chake/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chake
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Chake::Backend::Ssh do
4
4
 
5
- include_examples "Chake::Backend", Chake::Backend::Ssh, ->() { }
5
+ include_examples "Chake::Backend", Chake::Backend::Ssh
6
6
 
7
7
  let(:node) { Chake::Node.new('ssh://myuser@myhost/srv/chef') }
8
8
 
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  require 'chake/node'
2
2
  require 'chake/backend'
3
3
 
4
+ require 'rspec/version'
5
+ if RSpec::Version::STRING < '2.14'
6
+ puts "Skipping tests, need RSpec >= 2.14"
7
+ exit
8
+ end
4
9
 
5
10
  shared_examples "Chake::Backend" do |backend_class|
6
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chake
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
  - Antonio Terceiro
@@ -63,12 +63,14 @@ extensions: []
63
63
  extra_rdoc_files: []
64
64
  files:
65
65
  - ".gitignore"
66
+ - ChangeLog.md
66
67
  - Gemfile
67
68
  - LICENSE.txt
68
69
  - README.md
69
70
  - Rakefile
70
71
  - bin/chake
71
72
  - chake.gemspec
73
+ - chake.spec.erb
72
74
  - examples/test/Rakefile
73
75
  - examples/test/config.rb
74
76
  - examples/test/cookbooks/example/files/host-homer/test.asc