bait 0.5.11 → 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +14 -10
- data/VERSION +1 -1
- data/bait.gemspec +1 -0
- data/lib/bait.rb +9 -0
- data/lib/bait/build.rb +14 -1
- data/lib/bait/integrator.rb +1 -0
- data/spec/lib/bait/build_spec.rb +6 -0
- data/spec/lib/bait/integrator_spec.rb +7 -1
- data/spec/lib/bait_spec.rb +6 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 492066aede4bd771d097e7e7ce1b79d39fa984f5
|
4
|
+
data.tar.gz: f65eeda693dba6014995642e487b13916e94d2b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 337809e4233657b7aa490f1bf7097e993d886f8fd692b1c7e826c8f335d5a94c4808a7e1461861e8f0c4165ecd95ee1a52876d9fb6bdaa34761a2735e3caa9f5
|
7
|
+
data.tar.gz: d6ec7ba50ca490f5f93f5fdd887915eea4bbcd3719d910bfe2c77cb4ec70f9bed7b4a64cd0e8e3e0b56c5019bc25c90a0e5b0541492ceec6913c2637e42b1651
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bait (0.5.
|
4
|
+
bait (0.5.12)
|
5
5
|
git
|
6
6
|
haml
|
7
7
|
moneta
|
8
8
|
sinatra
|
9
9
|
sinatra-contrib
|
10
10
|
sucker_punch
|
11
|
+
term-ansicolor
|
11
12
|
thin
|
12
13
|
toystore
|
13
14
|
|
@@ -21,10 +22,10 @@ GEM
|
|
21
22
|
i18n (~> 0.6, >= 0.6.4)
|
22
23
|
multi_json (~> 1.0)
|
23
24
|
adapter (0.7.0)
|
24
|
-
backports (3.3.
|
25
|
+
backports (3.3.4)
|
25
26
|
builder (3.0.4)
|
26
|
-
celluloid (0.
|
27
|
-
timers (
|
27
|
+
celluloid (0.15.1)
|
28
|
+
timers (~> 1.1.0)
|
28
29
|
coderay (1.0.9)
|
29
30
|
coffee-script (2.2.0)
|
30
31
|
coffee-script-source
|
@@ -57,7 +58,7 @@ GEM
|
|
57
58
|
lumberjack (1.0.4)
|
58
59
|
method_source (0.8.1)
|
59
60
|
mime-types (1.23)
|
60
|
-
moneta (0.7.
|
61
|
+
moneta (0.7.20)
|
61
62
|
multi_json (1.7.7)
|
62
63
|
pry (0.9.12.2)
|
63
64
|
coderay (~> 1.0.5)
|
@@ -97,16 +98,18 @@ GEM
|
|
97
98
|
mime-types
|
98
99
|
sass
|
99
100
|
sinatra
|
100
|
-
sinatra-contrib (1.4.
|
101
|
+
sinatra-contrib (1.4.1)
|
101
102
|
backports (>= 2.0)
|
102
|
-
|
103
|
+
multi_json
|
103
104
|
rack-protection
|
104
105
|
rack-test
|
105
|
-
sinatra (~> 1.4.
|
106
|
+
sinatra (~> 1.4.0)
|
106
107
|
tilt (~> 1.3)
|
107
108
|
slop (3.4.6)
|
108
|
-
sucker_punch (1.0.
|
109
|
-
celluloid (~> 0.
|
109
|
+
sucker_punch (1.0.2)
|
110
|
+
celluloid (~> 0.15.1)
|
111
|
+
term-ansicolor (1.2.2)
|
112
|
+
tins (~> 0.8)
|
110
113
|
thin (1.5.1)
|
111
114
|
daemons (>= 1.0.9)
|
112
115
|
eventmachine (>= 0.12.6)
|
@@ -114,6 +117,7 @@ GEM
|
|
114
117
|
thor (0.18.1)
|
115
118
|
tilt (1.4.1)
|
116
119
|
timers (1.1.0)
|
120
|
+
tins (0.11.0)
|
117
121
|
toystore (0.13.2)
|
118
122
|
activemodel (~> 3.0)
|
119
123
|
activesupport (~> 3.0)
|
data/VERSION
CHANGED
data/bait.gemspec
CHANGED
data/lib/bait.rb
CHANGED
@@ -3,6 +3,11 @@ require 'moneta'
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'bait/assets'
|
5
5
|
require 'pathname'
|
6
|
+
require 'term/ansicolor'
|
7
|
+
|
8
|
+
class String
|
9
|
+
include Term::ANSIColor
|
10
|
+
end
|
6
11
|
|
7
12
|
module Bait
|
8
13
|
class << self
|
@@ -43,6 +48,10 @@ module Bait
|
|
43
48
|
def public
|
44
49
|
Pathname.new(File.join(File.dirname(__FILE__), 'bait', 'public'))
|
45
50
|
end
|
51
|
+
|
52
|
+
def console
|
53
|
+
STDOUT
|
54
|
+
end
|
46
55
|
end
|
47
56
|
end
|
48
57
|
|
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
|
19
|
+
attribute :ref, String, default: "master"
|
20
20
|
attribute :owner_name, String
|
21
21
|
attribute :owner_email, String
|
22
22
|
attribute :name, String
|
@@ -36,6 +36,19 @@ module Bait
|
|
36
36
|
self.cleanup!
|
37
37
|
end
|
38
38
|
|
39
|
+
def summary
|
40
|
+
branch = self.ref ? self.ref.split('/').last : "n/a"
|
41
|
+
output = %{#{self.name} (#{branch}) #{self.status}}
|
42
|
+
case self.status
|
43
|
+
when "passed"
|
44
|
+
output.green
|
45
|
+
when "failed"
|
46
|
+
output.red
|
47
|
+
else
|
48
|
+
output
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
39
52
|
def phases
|
40
53
|
YAML.load_file(File.join(self.bait_dir, "config.yml"))
|
41
54
|
end
|
data/lib/bait/integrator.rb
CHANGED
data/spec/lib/bait/build_spec.rb
CHANGED
@@ -6,6 +6,9 @@ def expect_event(*args)
|
|
6
6
|
end
|
7
7
|
|
8
8
|
describe Bait::Integrator do
|
9
|
+
before do
|
10
|
+
Bait.console.stub(:puts)
|
11
|
+
end
|
9
12
|
let(:build) { Bait::Build.create(name: "bait", clone_url:repo_path) }
|
10
13
|
let(:worker) { Bait::Integrator.new }
|
11
14
|
|
@@ -23,8 +26,11 @@ describe Bait::Integrator do
|
|
23
26
|
expect_event(:status, build.id, 'phase: coffeelint.rb')
|
24
27
|
expect_event(:output, build.id, kind_of(String)).exactly(2).times
|
25
28
|
expect_event(:status, build.id, 'passed').exactly(2).times
|
26
|
-
worker.perform build.id
|
27
29
|
end
|
30
|
+
it "writes summary output to the console" do
|
31
|
+
Bait.console.should_receive(:puts).with "\e[32mbait (master) passed\e[0m"
|
32
|
+
end
|
33
|
+
after { worker.perform build.id }
|
28
34
|
end
|
29
35
|
|
30
36
|
context "a script is missing" do
|
data/spec/lib/bait_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keyvan Fatehi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -234,6 +234,20 @@ dependencies:
|
|
234
234
|
- - '>='
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: term-ansicolor
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - '>='
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :runtime
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - '>='
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
237
251
|
description: Accepts github push event webhook to clone and execute .bait/test.sh
|
238
252
|
email:
|
239
253
|
- keyvan@digitalfilmtree.com
|