dockly 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/dockly.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.add_dependency 'docker-api', '~> 1.5.2'
19
19
  gem.add_dependency 'dockly-util'
20
20
  gem.add_dependency 'excon'
21
- gem.add_dependency 'fog', '~> 1.14.0'
21
+ gem.add_dependency 'fog', '~> 1.18.0'
22
22
  gem.add_dependency 'foreman'
23
23
  gem.add_dependency 'fpm', '~> 0.4.42'
24
24
  gem.add_dependency 'grit'
data/lib/dockly.rb CHANGED
@@ -16,12 +16,33 @@ require 'dockly/util/tar'
16
16
  require 'dockly/util/git'
17
17
 
18
18
  module Dockly
19
- def setup(file = 'dockly.rb')
20
- git_sha rescue 'unknown'
21
- Dockly::Deb.instances
22
- Dockly::Docker.instances
23
- Dockly::Foreman.instances
24
- instance_eval(IO.read(file), file)
19
+ attr_reader :instance, :git_sha
20
+ attr_writer :load_file
21
+
22
+ LOAD_FILE = 'dockly.rb'
23
+
24
+ def load_file
25
+ @load_file || LOAD_FILE
26
+ end
27
+
28
+ def inst
29
+ @instance ||= load_inst
30
+ end
31
+
32
+ def load_inst
33
+ setup.tap do |state|
34
+ if File.exists?(load_file)
35
+ instance_eval(IO.read(load_file), load_file)
36
+ end
37
+ end
38
+ end
39
+
40
+ def setup
41
+ {
42
+ :debs => Dockly::Deb.instances,
43
+ :dockers => Dockly::Docker.instances,
44
+ :foremans => Dockly::Foreman.instances
45
+ }
25
46
  end
26
47
 
27
48
  {
@@ -30,7 +51,17 @@ module Dockly
30
51
  :foreman => Dockly::Foreman
31
52
  }.each do |method, klass|
32
53
  define_method(method) do |sym, &block|
33
- klass.new!(:name => sym, &block)
54
+ if block.nil?
55
+ inst[:"#{method}s"][sym]
56
+ else
57
+ klass.new!(:name => sym, &block)
58
+ end
59
+ end
60
+ end
61
+
62
+ [:debs, :dockers, :foremans].each do |method|
63
+ define_method(method) do
64
+ inst[method]
34
65
  end
35
66
  end
36
67
 
@@ -38,7 +69,9 @@ module Dockly
38
69
  @git_sha ||= Dockly::Util::Git.git_sha
39
70
  end
40
71
 
41
- module_function :setup, :deb, :docker, :foreman, :git_sha
72
+ module_function :inst, :load_inst, :setup, :load_file, :load_file=,
73
+ :deb, :docker, :foreman, :git_sha,
74
+ :debs, :dockers, :foremans
42
75
  end
43
76
 
44
77
  require 'dockly/rake_task'
data/lib/dockly/cli.rb CHANGED
@@ -7,7 +7,7 @@ class Dockly::AbstractCommand < Clamp::Command
7
7
 
8
8
  def execute
9
9
  if File.exist?(file)
10
- Dockly.setup(file)
10
+ Dockly.load_file = file
11
11
  else
12
12
  raise 'Could not find a dockly file!'
13
13
  end
@@ -20,7 +20,7 @@ class Dockly::BuildCommand < Dockly::AbstractCommand
20
20
 
21
21
  def execute
22
22
  super
23
- if package = Dockly::Deb.instances[package_name.to_sym]
23
+ if package = Dockly.debs[package_name.to_sym]
24
24
  if force? || !package.exists?
25
25
  package.build
26
26
  else
@@ -33,7 +33,7 @@ end
33
33
  class Dockly::ListCommand < Dockly::AbstractCommand
34
34
  def execute
35
35
  super
36
- Dockly::Deb.instances.each_with_index do |(name, package), index|
36
+ Dockly.debs.each_with_index do |(name, package), index|
37
37
  puts "#{index + 1}. #{name}"
38
38
  end
39
39
  end
@@ -3,10 +3,6 @@ require 'dockly'
3
3
 
4
4
  $rake_task_logger = Dockly::Util::Logger.new('[dockly rake_task]', STDOUT, false)
5
5
 
6
- if File.exist?('dockly.rb')
7
- Dockly.setup
8
- end
9
-
10
6
  class Rake::DebTask < Rake::Task
11
7
  def needed?
12
8
  raise "Package does not exist" if package.nil?
@@ -30,7 +26,7 @@ namespace :dockly do
30
26
  end
31
27
 
32
28
  namespace :deb do
33
- Dockly::Deb.instances.values.each do |inst|
29
+ Dockly.debs.values.each do |inst|
34
30
  deb inst.name => 'dockly:load' do |name|
35
31
  Thread.current[:rake_task] = name
36
32
  inst.build
@@ -1,3 +1,3 @@
1
1
  module Dockly
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Swipely, Inc.
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-11-06 00:00:00.000000000 Z
12
+ date: 2013-11-07 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: clamp
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: docker-api
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,62 +46,71 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: dockly-util
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: excon
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: fog
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
75
- version: 1.14.0
85
+ version: 1.18.0
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ~>
81
92
  - !ruby/object:Gem::Version
82
- version: 1.14.0
93
+ version: 1.18.0
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: foreman
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - '>='
99
+ - - ! '>='
88
100
  - !ruby/object:Gem::Version
89
101
  version: '0'
90
102
  type: :runtime
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - '>='
107
+ - - ! '>='
95
108
  - !ruby/object:Gem::Version
96
109
  version: '0'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: fpm
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ~>
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - ~>
109
124
  - !ruby/object:Gem::Version
@@ -111,99 +126,113 @@ dependencies:
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: grit
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
- - - '>='
131
+ - - ! '>='
116
132
  - !ruby/object:Gem::Version
117
133
  version: '0'
118
134
  type: :runtime
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
- - - '>='
139
+ - - ! '>='
123
140
  - !ruby/object:Gem::Version
124
141
  version: '0'
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: cane
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
- - - '>='
147
+ - - ! '>='
130
148
  - !ruby/object:Gem::Version
131
149
  version: '0'
132
150
  type: :development
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
- - - '>='
155
+ - - ! '>='
137
156
  - !ruby/object:Gem::Version
138
157
  version: '0'
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: pry
141
160
  requirement: !ruby/object:Gem::Requirement
161
+ none: false
142
162
  requirements:
143
- - - '>='
163
+ - - ! '>='
144
164
  - !ruby/object:Gem::Version
145
165
  version: '0'
146
166
  type: :development
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
149
170
  requirements:
150
- - - '>='
171
+ - - ! '>='
151
172
  - !ruby/object:Gem::Version
152
173
  version: '0'
153
174
  - !ruby/object:Gem::Dependency
154
175
  name: rake
155
176
  requirement: !ruby/object:Gem::Requirement
177
+ none: false
156
178
  requirements:
157
- - - '>='
179
+ - - ! '>='
158
180
  - !ruby/object:Gem::Version
159
181
  version: '0'
160
182
  type: :development
161
183
  prerelease: false
162
184
  version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
163
186
  requirements:
164
- - - '>='
187
+ - - ! '>='
165
188
  - !ruby/object:Gem::Version
166
189
  version: '0'
167
190
  - !ruby/object:Gem::Dependency
168
191
  name: rspec
169
192
  requirement: !ruby/object:Gem::Requirement
193
+ none: false
170
194
  requirements:
171
- - - '>='
195
+ - - ! '>='
172
196
  - !ruby/object:Gem::Version
173
197
  version: '0'
174
198
  type: :development
175
199
  prerelease: false
176
200
  version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
177
202
  requirements:
178
- - - '>='
203
+ - - ! '>='
179
204
  - !ruby/object:Gem::Version
180
205
  version: '0'
181
206
  - !ruby/object:Gem::Dependency
182
207
  name: vcr
183
208
  requirement: !ruby/object:Gem::Requirement
209
+ none: false
184
210
  requirements:
185
- - - '>='
211
+ - - ! '>='
186
212
  - !ruby/object:Gem::Version
187
213
  version: '0'
188
214
  type: :development
189
215
  prerelease: false
190
216
  version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
191
218
  requirements:
192
- - - '>='
219
+ - - ! '>='
193
220
  - !ruby/object:Gem::Version
194
221
  version: '0'
195
222
  - !ruby/object:Gem::Dependency
196
223
  name: webmock
197
224
  requirement: !ruby/object:Gem::Requirement
225
+ none: false
198
226
  requirements:
199
- - - '>='
227
+ - - ! '>='
200
228
  - !ruby/object:Gem::Version
201
229
  version: '0'
202
230
  type: :development
203
231
  prerelease: false
204
232
  version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
205
234
  requirements:
206
- - - '>='
235
+ - - ! '>='
207
236
  - !ruby/object:Gem::Version
208
237
  version: '0'
209
238
  description: Packaging made easy
@@ -258,26 +287,27 @@ files:
258
287
  homepage: https://github.com/swipely/dockly
259
288
  licenses:
260
289
  - MIT
261
- metadata: {}
262
290
  post_install_message:
263
291
  rdoc_options: []
264
292
  require_paths:
265
293
  - lib
266
294
  required_ruby_version: !ruby/object:Gem::Requirement
295
+ none: false
267
296
  requirements:
268
- - - '>='
297
+ - - ! '>='
269
298
  - !ruby/object:Gem::Version
270
299
  version: '0'
271
300
  required_rubygems_version: !ruby/object:Gem::Requirement
301
+ none: false
272
302
  requirements:
273
- - - '>='
303
+ - - ! '>='
274
304
  - !ruby/object:Gem::Version
275
305
  version: '0'
276
306
  requirements: []
277
307
  rubyforge_project:
278
- rubygems_version: 2.0.3
308
+ rubygems_version: 1.8.23
279
309
  signing_key:
280
- specification_version: 4
310
+ specification_version: 3
281
311
  summary: Packaging made easy
282
312
  test_files:
283
313
  - spec/dockly/aws_spec.rb
@@ -295,3 +325,4 @@ test_files:
295
325
  - spec/fixtures/test-2.tar.gz
296
326
  - spec/spec_helper.rb
297
327
  - spec/support/vcr.rb
328
+ has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: fe48214f959251a622ec6458e33b73c9c75b4ac7
4
- data.tar.gz: 3788dea01e592c04e702b8892e3b638dfcec2dc1
5
- SHA512:
6
- metadata.gz: fcfb39baac628840756bc4f944570bf8b7be9713d3a627841ade18601971b1395848943538b8c48f3a4dcd610423adb03eb84552c887e658aab6fcc3a559de9b
7
- data.tar.gz: d9075e08f45a02cfbb101b9e1ef590f43b8e9f7ea0de29aa59f51aa1e9739692b7ad62426e32549f70dd66100a7fc4c547e3e4fafa5c227a848ea1a334bcb11f