bait 0.5.11 → 0.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4170b1d21309ee20fc7a772999bec815f71d86a9
4
- data.tar.gz: 80ccd784fc33b5f78c7e1617911582976faf92f6
3
+ metadata.gz: 492066aede4bd771d097e7e7ce1b79d39fa984f5
4
+ data.tar.gz: f65eeda693dba6014995642e487b13916e94d2b9
5
5
  SHA512:
6
- metadata.gz: d61b55886c78a74dc6b62dd203fffb8080dae8935b38ea780fe29e72b54d9e471cb9a4519f0a8cb33aa6c56139085ace08ed0c5d7afb9a39083aa352da53d5f8
7
- data.tar.gz: 7d46acac41537e5ce2e49e0dd82e1db96932d8c3dd4dfd7dd81db010d7dd7a702df8baf0da5f0cdd0b5ae7eaca0e60e2d5f3de615aac71aad8454c5d6a8a30ce
6
+ metadata.gz: 337809e4233657b7aa490f1bf7097e993d886f8fd692b1c7e826c8f335d5a94c4808a7e1461861e8f0c4165ecd95ee1a52876d9fb6bdaa34761a2735e3caa9f5
7
+ data.tar.gz: d6ec7ba50ca490f5f93f5fdd887915eea4bbcd3719d910bfe2c77cb4ec70f9bed7b4a64cd0e8e3e0b56c5019bc25c90a0e5b0541492ceec6913c2637e42b1651
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bait (0.5.11)
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.3)
25
+ backports (3.3.4)
25
26
  builder (3.0.4)
26
- celluloid (0.14.1)
27
- timers (>= 1.0.0)
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.19)
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.0)
101
+ sinatra-contrib (1.4.1)
101
102
  backports (>= 2.0)
102
- eventmachine
103
+ multi_json
103
104
  rack-protection
104
105
  rack-test
105
- sinatra (~> 1.4.2)
106
+ sinatra (~> 1.4.0)
106
107
  tilt (~> 1.3)
107
108
  slop (3.4.6)
108
- sucker_punch (1.0.1)
109
- celluloid (~> 0.14.1)
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
@@ -1,3 +1,3 @@
1
- 0.5.11
1
+ 0.5.12
2
2
 
3
3
 
@@ -35,4 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_runtime_dependency "haml"
36
36
  spec.add_runtime_dependency "thin"
37
37
  spec.add_runtime_dependency "sucker_punch"
38
+ spec.add_runtime_dependency "term-ansicolor"
38
39
  end
@@ -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
 
@@ -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
@@ -14,6 +14,7 @@ module Bait
14
14
  @build.phases.each do |script|
15
15
  @build.enter_phase script
16
16
  end
17
+ Bait.console.puts @build.summary
17
18
  end
18
19
  end
19
20
  end
@@ -150,4 +150,10 @@ describe Bait::Build do
150
150
  build.phases.should eq ["foo.py", "bar.php"]
151
151
  end
152
152
  end
153
+
154
+ describe "#summary" do
155
+ it "formats name, branch, and status" do
156
+ build.summary.should match /.+ \(.+\) .+/
157
+ end
158
+ end
153
159
  end
@@ -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
@@ -36,4 +36,10 @@ describe Bait do
36
36
  end
37
37
  end
38
38
  end
39
+
40
+ describe "#console" do
41
+ it "provides access to STDOUT" do
42
+ Bait.console.should eq STDOUT
43
+ end
44
+ end
39
45
  end
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.11
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-09-30 00:00:00.000000000 Z
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