buildbox 0.2.1 → 0.2.2

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: d5f35ee004e331b0dc73aaa7810c3205fee9e94e
4
- data.tar.gz: e9c09f2b873eaa48ee5a796e0aa5e8fb0ff1b4c7
3
+ metadata.gz: f440103d7897a20e804e7a4a24b81699cd29e3b3
4
+ data.tar.gz: 1c70d6f1809989aba284dd197a9804bf84693e1e
5
5
  SHA512:
6
- metadata.gz: 9571f31377b47d64915fb3040d21f36c5d980c54acc9fa23c9ee5c3aa05b7c97b5cf80a6940a8be2981b99815d4477d4a362723f527a6100cafdd8c7431c0229
7
- data.tar.gz: 84841e7ad0466986a09a699582c74f6414a09be3affd6c1c0a110fb83727aac795a04a770236194660eb8bc8cf947f2e751281b12b89e12a659b57655a490f22
6
+ metadata.gz: 3fe2b5ab4c51c94ccd7efa13d69757decc2f48448ce206ef51f0ae4735090b05a947b257590bf21e1e6647f7a53b0bde114813afdd74abd729b7c7caaebd104c
7
+ data.tar.gz: f3a8445fe4b4af7aa8eaf8d16f8935980b051461de31638afbd2509f5e0979dc174cadabe2469d8c53c0fd53671bde7457601f516d80c129a2d3c4b55cb69497
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buildbox (0.2.1)
4
+ buildbox (0.2.2)
5
5
  celluloid (~> 0.14)
6
6
  faraday (~> 0.8)
7
7
  faraday_middleware (~> 0.9)
@@ -13,7 +13,7 @@ module Buildbox
13
13
  autoload :Script, "buildbox/script"
14
14
  autoload :Server, "buildbox/server"
15
15
  autoload :UTF8, "buildbox/utf8"
16
- autoload :Worker, "buildbox/worker"
16
+ autoload :Agent, "buildbox/agent"
17
17
  autoload :VERSION, "buildbox/version"
18
18
 
19
19
  def self.config
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'celluloid'
3
3
 
4
4
  module Buildbox
5
- class Worker
5
+ class Agent
6
6
  include Celluloid::Logger
7
7
 
8
8
  def initialize(access_token, api)
@@ -23,9 +23,9 @@ module Buildbox
23
23
  private
24
24
 
25
25
  def projects
26
- @api.worker(@access_token, hostname).projects
26
+ @api.agent(@access_token, hostname).projects
27
27
  rescue Faraday::Error::ClientError
28
- warn "Worker #{@access_token} doesn't exist"
28
+ warn "Agent #{@access_token} doesn't exist"
29
29
  [] # return empty array to avoid breakage
30
30
  end
31
31
 
@@ -14,8 +14,8 @@ module Buildbox
14
14
  get("user")
15
15
  end
16
16
 
17
- def worker(access_token, hostname)
18
- put("workers/#{access_token}", :hostname => hostname)
17
+ def agent(access_token, hostname)
18
+ put("agents/#{access_token}", :hostname => hostname)
19
19
  end
20
20
 
21
21
  def scheduled_builds(project)
@@ -18,20 +18,20 @@ module Buildbox
18
18
  end
19
19
  end
20
20
 
21
- @commands['worker:start'] = OptionParser.new do |opts|
22
- opts.banner = "Usage: buildbox worker:start"
21
+ @commands['agent:start'] = OptionParser.new do |opts|
22
+ opts.banner = "Usage: buildbox agent:start"
23
23
 
24
24
  opts.on("--help", "You're looking at it.") do
25
- puts @commands['worker:start']
25
+ puts @commands['agent:start']
26
26
  exit
27
27
  end
28
28
  end
29
29
 
30
- @commands['worker:add'] = OptionParser.new do |opts|
31
- opts.banner = "Usage: buildbox worker:add [token]"
30
+ @commands['agent:setup'] = OptionParser.new do |opts|
31
+ opts.banner = "Usage: buildbox setup:add [token]"
32
32
 
33
33
  opts.on("--help", "You're looking at it.") do
34
- puts @commands['worker:add']
34
+ puts @commands['setup:add']
35
35
  exit
36
36
  end
37
37
  end
@@ -59,20 +59,20 @@ module Buildbox
59
59
  exit
60
60
  end
61
61
 
62
- if command == "worker:start"
62
+ if command == "agent:start"
63
63
  Buildbox::Server.new.start
64
- elsif command == "worker:add"
64
+ elsif command == "setup:add"
65
65
  if @argv.length == 0
66
66
  puts "No token provided"
67
67
  exit 1
68
68
  end
69
69
 
70
70
  access_token = @argv.first
71
- worker_access_tokens = Buildbox.config.worker_access_tokens
72
- Buildbox.config.update(:worker_access_tokens => worker_access_tokens << access_token)
71
+ agent_access_tokens = Buildbox.config.agent_access_tokens
72
+ Buildbox.config.update(:agent_access_tokens => agent_access_tokens << access_token)
73
73
 
74
- puts "Successfully added worker access token"
75
- puts "You can now start the worker with: buildbox worker:start"
74
+ puts "Successfully added agent access token"
75
+ puts "You can now start the agent with: buildbox agent:start"
76
76
  elsif command == "auth:login"
77
77
  if @argv.length == 0
78
78
  puts "No api key provided"
@@ -86,7 +86,7 @@ module Buildbox
86
86
  Buildbox.config.update(:api_key => api_key)
87
87
 
88
88
  puts "Successfully added your api_key"
89
- puts "You can now add workers with: buildbox worker:add [worker_token]"
89
+ puts "You can now add agents with: buildbox setup:add [agent_token]"
90
90
  rescue
91
91
  puts "Could not authenticate your api_key"
92
92
  exit 1
@@ -111,7 +111,7 @@ module Buildbox
111
111
  def help
112
112
  <<HELP
113
113
 
114
- worker # worker management (setup, server)
114
+ agent # agent management (setup, server)
115
115
  version # display version
116
116
 
117
117
  HELP
@@ -4,13 +4,13 @@ require 'json'
4
4
 
5
5
  module Buildbox
6
6
  class Configuration < Hashie::Mash
7
- def worker_access_tokens
8
- env_workers = ENV['BUILDBOX_WORKERS']
7
+ def agent_access_tokens
8
+ env_agents = ENV['BUILDBOX_WORKERS']
9
9
 
10
- if env_workers.nil?
11
- self[:worker_access_tokens] || []
10
+ if env_agents.nil?
11
+ self[:agent_access_tokens] || []
12
12
  else
13
- env_workers.to_s.split(",")
13
+ env_agents.to_s.split(",")
14
14
  end
15
15
  end
16
16
 
@@ -12,8 +12,8 @@ module Buildbox
12
12
  @config.check
13
13
  @config.reload
14
14
 
15
- worker_access_tokens.each do |access_token|
16
- Buildbox::Worker.new(access_token, api).work
15
+ agent_access_tokens.each do |access_token|
16
+ Buildbox::Agent.new(access_token, api).work
17
17
  end
18
18
 
19
19
  @logger.info "Sleeping for #{INTERVAL} seconds"
@@ -27,8 +27,8 @@ module Buildbox
27
27
  @api ||= Buildbox::API.new
28
28
  end
29
29
 
30
- def worker_access_tokens
31
- @config.worker_access_tokens
30
+ def agent_access_tokens
31
+ @config.agent_access_tokens
32
32
  end
33
33
  end
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module Buildbox
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -0,0 +1,4 @@
1
+ require 'spec_helper'
2
+
3
+ describe Buildbox::Agent do
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Pitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-05 00:00:00.000000000 Z
11
+ date: 2013-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -98,6 +98,7 @@ files:
98
98
  - bin/buildbox
99
99
  - buildbox-ruby.gemspec
100
100
  - lib/buildbox.rb
101
+ - lib/buildbox/agent.rb
101
102
  - lib/buildbox/api.rb
102
103
  - lib/buildbox/build.rb
103
104
  - lib/buildbox/cli.rb
@@ -109,7 +110,7 @@ files:
109
110
  - lib/buildbox/server.rb
110
111
  - lib/buildbox/utf8.rb
111
112
  - lib/buildbox/version.rb
112
- - lib/buildbox/worker.rb
113
+ - spec/buildbox/buildbox/agent_spec.rb
113
114
  - spec/buildbox/buildbox/api_spec.rb
114
115
  - spec/buildbox/buildbox/build_spec.rb
115
116
  - spec/buildbox/buildbox/cli_spec.rb
@@ -121,7 +122,6 @@ files:
121
122
  - spec/buildbox/buildbox/server_spec.rb
122
123
  - spec/buildbox/buildbox/utf8_spec.rb
123
124
  - spec/buildbox/buildbox/version_spec.rb
124
- - spec/buildbox/buildbox/worker_spec.rb
125
125
  - spec/fixtures/repo.git/HEAD
126
126
  - spec/fixtures/repo.git/config
127
127
  - spec/fixtures/repo.git/description
@@ -172,6 +172,7 @@ signing_key:
172
172
  specification_version: 4
173
173
  summary: Ruby client for buildbox
174
174
  test_files:
175
+ - spec/buildbox/buildbox/agent_spec.rb
175
176
  - spec/buildbox/buildbox/api_spec.rb
176
177
  - spec/buildbox/buildbox/build_spec.rb
177
178
  - spec/buildbox/buildbox/cli_spec.rb
@@ -183,7 +184,6 @@ test_files:
183
184
  - spec/buildbox/buildbox/server_spec.rb
184
185
  - spec/buildbox/buildbox/utf8_spec.rb
185
186
  - spec/buildbox/buildbox/version_spec.rb
186
- - spec/buildbox/buildbox/worker_spec.rb
187
187
  - spec/fixtures/repo.git/HEAD
188
188
  - spec/fixtures/repo.git/config
189
189
  - spec/fixtures/repo.git/description
@@ -1,4 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Buildbox::Worker do
4
- end