juici-interface 0.0.1.alpha1 → 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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/juicic +20 -3
  3. data/lib/juici/interface.rb +25 -1
  4. metadata +8 -10
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 332ed36b954edf48b64210f27c6d99358d7fb735
4
+ data.tar.gz: d00c3aa5da8103473811c44cdcd4bb60eea3623f
5
+ SHA512:
6
+ metadata.gz: 5bf8150018beed5f7d83db6eabb3da03bd0182bbaf4efd91e12eafa4d9e39b7e5520f4c1f0a4978cac0099a110d6abca6f946705d5cf78a9f9b77a9c2ce34dcf
7
+ data.tar.gz: 37ea56ee59578b00ca861861404426a5df90b2e07947f6e410d2e4c413a32ce3fd9274f5cbac9be134eead65b3882de2338dac10d4183a4c0ade2b570b72e980
data/bin/juicic CHANGED
@@ -5,15 +5,17 @@ require 'juici/interface'
5
5
 
6
6
  # TODO Refactor
7
7
  def main(args)
8
- action = args.shift.to_sym
9
- options = {}
8
+ action = (args.shift || "help").to_sym
9
+ options = {
10
+ callbacks: []
11
+ }
10
12
 
11
13
  until args.empty?
12
14
  case args.shift
13
15
  when "--command"
14
16
  command = args.shift
15
17
  options[:command] = if command == "-"
16
- File.read(command)
18
+ STDIN.read
17
19
  else
18
20
  command
19
21
  end
@@ -25,6 +27,8 @@ def main(args)
25
27
  options[:project] = args.shift
26
28
  when "--priority"
27
29
  options[:priority] = args.shift
30
+ when "--callback"
31
+ options[:callbacks] << args.shift
28
32
  end
29
33
  end
30
34
 
@@ -40,6 +44,19 @@ def build(opts)
40
44
  end
41
45
  end
42
46
 
47
+ def help(opts)
48
+ [
49
+ "Usage #{$0} <build|help>",
50
+ " build: --host <host>",
51
+ " : --title <title>",
52
+ " : --project <project>",
53
+ " : --priority <priority>",
54
+ " : --callback <callback>",
55
+ ].each do |line|
56
+ STDERR.puts(line)
57
+ end
58
+ end
59
+
43
60
  def _create_payload(opts)
44
61
  URI.encode_www_form({
45
62
  "project" => opts[:project],
@@ -6,8 +6,32 @@ module Juici
6
6
  WAIT = "waiting"
7
7
  end
8
8
 
9
- module Routes
9
+ module Routes extend self
10
10
  NEW_BUILD = '/builds/new'
11
+
12
+ def build_new
13
+ NEW_BUILD
14
+ end
15
+
16
+ def build_list(workspace)
17
+ "/builds/#{workspace}/list"
18
+ end
19
+
20
+ def build_rebuild(workspace, build)
21
+ "/builds/#{workspace}/rebuild/#{build}"
22
+ end
23
+
24
+ def build_edit(workspace, build)
25
+ "/builds/#{workspace}/edit/#{build}"
26
+ end
27
+
28
+ def build_show(workspace, build)
29
+ "/builds/#{workspace}/show/#{build}"
30
+ end
31
+
32
+ def build_trigger(workspace)
33
+ "/trigger/#{workspace}"
34
+ end
11
35
  end
12
36
 
13
37
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juici-interface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha1
5
- prerelease: 6
4
+ version: 0.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Richo Healey
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-16 00:00:00.000000000 Z
11
+ date: 2013-07-08 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Interface definition for JuiCI callbacks and API
15
14
  email:
@@ -23,26 +22,25 @@ files:
23
22
  - bin/juicic
24
23
  homepage: http://github.com/richo/juici
25
24
  licenses: []
25
+ metadata: {}
26
26
  post_install_message:
27
27
  rdoc_options: []
28
28
  require_paths:
29
29
  - lib
30
30
  required_ruby_version: !ruby/object:Gem::Requirement
31
- none: false
32
31
  requirements:
33
- - - ! '>='
32
+ - - '>='
34
33
  - !ruby/object:Gem::Version
35
34
  version: '0'
36
35
  required_rubygems_version: !ruby/object:Gem::Requirement
37
- none: false
38
36
  requirements:
39
- - - ! '>'
37
+ - - '>='
40
38
  - !ruby/object:Gem::Version
41
- version: 1.3.1
39
+ version: '0'
42
40
  requirements: []
43
41
  rubyforge_project:
44
- rubygems_version: 1.8.24
42
+ rubygems_version: 2.0.2
45
43
  signing_key:
46
- specification_version: 3
44
+ specification_version: 4
47
45
  summary: Interface definition for JuiCI callbacks and API
48
46
  test_files: []