jamie-bluebox 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,3 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ notifications:
5
+ irc:
6
+ channels:
7
+ - "irc.freenode.org#jamie-ci"
8
+ use_notice: true
9
+ skip_join: true
data/README.md CHANGED
@@ -1,12 +1,15 @@
1
1
  # Jamie::Driver::Bluebox
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/jamie-ci/jamie-bluebox.png)](https://travis-ci.org/jamie-ci/jamie-bluebox)
4
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/jamie-ci/jamie-bluebox)
5
+
3
6
  TODO: Write a gem description
4
7
 
5
8
  ## Installation
6
9
 
7
10
  Add this line to your application's Gemfile:
8
11
 
9
- gem 'jamie-driver-bluebox'
12
+ gem 'jamie-bluebox'
10
13
 
11
14
  And then execute:
12
15
 
@@ -14,7 +17,7 @@ And then execute:
14
17
 
15
18
  Or install it yourself as:
16
19
 
17
- $ gem install jamie-driver-bluebox
20
+ $ gem install jamie-bluebox
18
21
 
19
22
  ## Usage
20
23
 
data/Rakefile CHANGED
@@ -7,4 +7,10 @@ Cane::RakeTask.new
7
7
 
8
8
  Tailor::RakeTask.new
9
9
 
10
- task :default => [ :cane, :tailor ]
10
+ desc "Display LOC stats"
11
+ task :stats do
12
+ puts "\n## Production Code Stats"
13
+ sh "countloc -r lib/jamie"
14
+ end
15
+
16
+ task :default => [ :cane, :tailor, :stats ]
@@ -18,11 +18,12 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
- gem.add_dependency 'jamie'
21
+ gem.add_dependency 'jamie', '~> 0.1.0.alpha19'
22
22
  gem.add_dependency 'fog'
23
23
 
24
24
  gem.add_development_dependency 'yard'
25
25
  gem.add_development_dependency 'maruku'
26
26
  gem.add_development_dependency 'cane'
27
27
  gem.add_development_dependency 'tailor'
28
+ gem.add_development_dependency 'countloc'
28
29
  end
@@ -1,4 +1,20 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
+ #
5
+ # Copyright (C) 2012, Fletcher Nichol
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
2
18
 
3
19
  require 'benchmark'
4
20
  require 'fog'
@@ -10,6 +26,8 @@ module Jamie
10
26
  module Driver
11
27
 
12
28
  # Blue Box blocks API driver for Jamie.
29
+ #
30
+ # @author Fletcher Nichol <fnichol@nichol.ca>
13
31
  class Bluebox < Jamie::Driver::SSHBase
14
32
 
15
33
  default_config 'flavor_id', '94fd37a7-2606-47f7-84d5-9000deda52ae'
@@ -18,24 +36,23 @@ module Jamie
18
36
  default_config 'username', 'jamie'
19
37
  default_config 'port', '22'
20
38
 
21
- def create(instance, state)
22
- server = create_server(instance)
39
+ def create(state)
40
+ server = create_server
23
41
  state['block_id'] = server.id
24
42
  state['hostname'] = server.ips.first['address']
25
43
 
26
- elapsed = Benchmark.measure do
27
- server.wait_for { print "."; ready? } ; print "(server ready)"
28
- wait_for_sshd(state['hostname']) ; print "(ssh read)\n"
29
- end
30
- puts " Created #{instance.name} in #{elapsed.real} seconds."
44
+ info("Blocks instance <#{state['block_id']}> created.")
45
+ server.wait_for { print "."; ready? } ; print "(server ready)"
46
+ wait_for_sshd(state['hostname']) ; print "(ssh ready)\n"
31
47
  rescue Fog::Errors::Error, Excon::Errors::Error => ex
32
48
  raise ActionFailed, ex.message
33
49
  end
34
50
 
35
- def destroy(instance, state)
51
+ def destroy(state)
36
52
  return if state['block_id'].nil?
37
53
 
38
54
  connection.destroy_block(state['block_id'])
55
+ info("Blocks instance <#{state['block_id']}> destroyed.")
39
56
  state.delete('block_id')
40
57
  state.delete('hostname')
41
58
  rescue Fog::Errors::Error, Excon::Errors::Error => ex
@@ -52,7 +69,7 @@ module Jamie
52
69
  )
53
70
  end
54
71
 
55
- def create_server(instance)
72
+ def create_server
56
73
  connection.servers.create(
57
74
  :flavor_id => config['flavor_id'],
58
75
  :image_id => config['image_id'],
@@ -1,7 +1,25 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
+ #
5
+ # Copyright (C) 2012, Fletcher Nichol
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
2
18
 
3
19
  module Jamie
20
+
4
21
  module Driver
5
- BLUEBOX_VERSION = "0.1.0"
22
+
23
+ BLUEBOX_VERSION = "0.2.0"
6
24
  end
7
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jamie-bluebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-27 00:00:00.000000000 Z
12
+ date: 2013-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jamie
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: 0.1.0.alpha19
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: '0'
29
+ version: 0.1.0.alpha19
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: fog
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +107,22 @@ dependencies:
107
107
  - - ! '>='
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: countloc
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
110
126
  description: Jamie::Driver::Bluebox - A Blue Box block API driver for Jamie
111
127
  email:
112
128
  - fnichol@nichol.ca
@@ -137,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
153
  version: '0'
138
154
  segments:
139
155
  - 0
140
- hash: -2248373637053170227
156
+ hash: -3973715276646231474
141
157
  required_rubygems_version: !ruby/object:Gem::Requirement
142
158
  none: false
143
159
  requirements:
@@ -146,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
162
  version: '0'
147
163
  segments:
148
164
  - 0
149
- hash: -2248373637053170227
165
+ hash: -3973715276646231474
150
166
  requirements: []
151
167
  rubyforge_project:
152
168
  rubygems_version: 1.8.24