bait 0.5.12 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/bait/build.rb +10 -4
- data/spec/lib/bait/build_spec.rb +16 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a24157c8fb0d4ac6c4a50da7cdb1ef2313e419f3
|
4
|
+
data.tar.gz: 2969c4f70dd268662a9e5df2e2f51576af67dbd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 373ad361ccb95aba49abbef635485b4086f5aad9e435ac6bdfe12e04d347e14570a26b96336b2460e1977d0610e895707063f68c457986786fe4ee4727db8b62
|
7
|
+
data.tar.gz: 7d8622aad172e9d261cee74822a727df08689c548649bc2f364d68981f996961c67d910dd4a898ae4af1ceaf11a5c3536ba4ac88e6605ce519c77b8237fa2d23
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
@@ -35,6 +35,7 @@ end
|
|
35
35
|
namespace :gem do
|
36
36
|
task :build do
|
37
37
|
`bundle install`
|
38
|
+
Rake::Task['assets:precompile'].invoke
|
38
39
|
Rake::Task['git:dirty'].invoke
|
39
40
|
if !git_master?
|
40
41
|
puts "I'll only build the gem on the master branch"
|
@@ -45,7 +46,6 @@ namespace :gem do
|
|
45
46
|
puts "Uhh.. you have failing specs -- not building the gem"
|
46
47
|
else
|
47
48
|
puts "Specs pass. you're ready"
|
48
|
-
Rake::Task['assets:precompile'].invoke
|
49
49
|
Rake::Task['git:dirty'].invoke
|
50
50
|
puts `gem build bait.gemspec`
|
51
51
|
puts "Done! You can gem push that now"
|
@@ -53,7 +53,7 @@ namespace :gem do
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
task :
|
56
|
+
task :publish => :build do
|
57
57
|
require "bait/version"
|
58
58
|
gem = "bait-#{Bait::VERSION}.gem"
|
59
59
|
if File.exists?(gem)
|
data/VERSION
CHANGED
data/lib/bait/build.rb
CHANGED
@@ -16,7 +16,7 @@ module Bait
|
|
16
16
|
Moneta.new(:YAML, :file => Bait.db_file('builds'))
|
17
17
|
|
18
18
|
attribute :simplecov, Boolean, default: false
|
19
|
-
attribute :ref, String, default: "master"
|
19
|
+
attribute :ref, String, default: "refs/heads/master"
|
20
20
|
attribute :owner_name, String
|
21
21
|
attribute :owner_email, String
|
22
22
|
attribute :name, String
|
@@ -36,9 +36,12 @@ module Bait
|
|
36
36
|
self.cleanup!
|
37
37
|
end
|
38
38
|
|
39
|
+
def branch
|
40
|
+
self.ref.gsub('refs/heads/', '')
|
41
|
+
end
|
42
|
+
|
39
43
|
def summary
|
40
|
-
|
41
|
-
output = %{#{self.name} (#{branch}) #{self.status}}
|
44
|
+
output = %{#{self.name} (#{self.branch}) #{self.status}}
|
42
45
|
case self.status
|
43
46
|
when "passed"
|
44
47
|
output.green
|
@@ -91,7 +94,10 @@ module Bait
|
|
91
94
|
FileUtils.mkdir_p sandbox_directory
|
92
95
|
end
|
93
96
|
begin
|
94
|
-
Git.clone(clone_url, name, :path => sandbox_directory)
|
97
|
+
g = Git.clone(clone_url, name, :path => sandbox_directory)
|
98
|
+
if g.branch.name != self.branch
|
99
|
+
g.checkout("origin/#{self.branch}")
|
100
|
+
end
|
95
101
|
rescue => ex
|
96
102
|
msg = "Failed to clone #{clone_url}"
|
97
103
|
self.output << "#{msg}\n\n#{ex.message}\n\n#{ex.backtrace.join("\n")}"
|
data/spec/lib/bait/build_spec.rb
CHANGED
@@ -82,9 +82,17 @@ describe Bait::Build do
|
|
82
82
|
|
83
83
|
describe "#clone!" do
|
84
84
|
context 'valid clone url' do
|
85
|
-
before
|
85
|
+
before do
|
86
|
+
build.clone_url = repo_path
|
87
|
+
build.clone!
|
88
|
+
end
|
86
89
|
specify { build.output.should_not match /Failed to clone/ }
|
87
90
|
specify { build.should be_cloned }
|
91
|
+
it "should be on the correct branch" do
|
92
|
+
g = Git.open File.join(build.sandbox_directory, build.name)
|
93
|
+
g.branch.name.should eq build.branch
|
94
|
+
build.ref.should include build.branch
|
95
|
+
end
|
88
96
|
end
|
89
97
|
context "invalid clone url" do
|
90
98
|
before { build.clone_url = "invalid" ; build.clone! }
|
@@ -156,4 +164,11 @@ describe Bait::Build do
|
|
156
164
|
build.summary.should match /.+ \(.+\) .+/
|
157
165
|
end
|
158
166
|
end
|
167
|
+
|
168
|
+
describe "#branch" do
|
169
|
+
it "removes the refs/heads portion and returns only the branch name" do
|
170
|
+
build.ref = "refs/heads/foo/bar/baz"
|
171
|
+
build.branch.should eq "foo/bar/baz"
|
172
|
+
end
|
173
|
+
end
|
159
174
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bait
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keyvan Fatehi
|
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
329
|
version: '0'
|
330
330
|
requirements: []
|
331
331
|
rubyforge_project:
|
332
|
-
rubygems_version: 2.0.
|
332
|
+
rubygems_version: 2.0.5
|
333
333
|
signing_key:
|
334
334
|
specification_version: 4
|
335
335
|
summary: build and integration test service
|