janky-flow 0.0.0 → 0.0.1

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.
@@ -1,11 +1,17 @@
1
1
  module Janky
2
- class App < Sinatra::Base
2
+ module Flow
3
+ class App < Sinatra::Base
4
+
5
+ get %r{\/\*\/([-_\+\.a-zA-z0-9\/]+)} do |branch_name|
6
+ authorize_index
7
+ @builds = Build.queued.where(:branch_id => Branch.where(:name => branch_name)).first(50)
8
+ mustache :index
9
+ end
3
10
 
4
- get %r{\/\*\/([-_\+\.a-zA-z0-9\/]+)} do |branch_name|
5
- authorize_index
6
- @builds = Build.queued.where(:branch_id => Branch.where(:name => branch_name)).first(50)
7
- mustache :index
8
11
  end
12
+ end
9
13
 
14
+ class App
15
+ use Janky::Flow::App
10
16
  end
11
17
  end
@@ -1,24 +1,35 @@
1
1
  module Janky
2
- class Hubot < Sinatra::Base
2
+ module Flow
3
+ class Hubot < Sinatra::Base
3
4
 
4
- get %r{\/\*\/([-_\+\.a-zA-z0-9\/]+)} do |branch_name|
5
- branch_summary branch_name
6
- end
5
+ get '/help' do
6
+ fail "downstream app not set" unless @app.respond_to? :call
7
+ status, headers, body = @app.call env
8
+ @response.status = status
9
+ @response.body = body.body[0].sub! "ci status\n", "\\0ci status */develop\n"
10
+ @response.headers.merge! headers.reject { |k| k == 'Content-Length' }
11
+ nil
12
+ end
7
13
 
8
- def branch_summary(branch_name)
9
- content_type "text/plain"
10
- repos = Repository.all(:include => [:branches, :commits, :builds]).map do |repo|
11
- branch = repo.branch_for(branch_name)
14
+ get %r{\/\*\/([-_\+\.a-zA-z0-9\/]+)} do |branch_name|
15
+ content_type "text/plain"
16
+ repos = Repository.all(:include => [:branches, :commits, :builds]).map do |repo|
17
+ branch = repo.branch_for(branch_name)
12
18
 
13
- "%-17s %-13s %-10s %40s" % [
14
- repo.name,
15
- branch.status,
16
- repo.campfire_room,
17
- repo.uri
18
- ]
19
+ "%-17s %-13s %-10s %40s" % [
20
+ repo.name,
21
+ branch.status,
22
+ repo.campfire_room,
23
+ repo.uri
24
+ ]
25
+ end
26
+ repos.join("\n")
19
27
  end
20
- repos.join("\n")
28
+
21
29
  end
30
+ end
22
31
 
32
+ class Hubot
33
+ use Janky::Flow::Hubot
23
34
  end
24
35
  end
@@ -1,5 +1,5 @@
1
1
  module Janky
2
2
  module Flow
3
- VERSION = "0.0.0"
3
+ VERSION = "0.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: janky-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-07 00:00:00.000000000 Z
12
+ date: 2013-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: janky
@@ -38,7 +38,7 @@ files:
38
38
  - lib/janky/flow/app.rb
39
39
  - lib/janky/flow/hubot.rb
40
40
  - lib/janky/flow/version.rb
41
- homepage: http://rubygems.org/gems/janky-flow
41
+ homepage: https://github.com/mal/janky-flow
42
42
  licenses:
43
43
  - MIT
44
44
  post_install_message: