runcible 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -47,7 +47,7 @@ Alternatively, a single 'server' instance which can easily use all
47
47
  :user => "",
48
48
  :logger => ""
49
49
  })
50
- runcible.resources.repository.find(id)
50
+ my_runcible.resources.repository.find(id)
51
51
 
52
52
  Required Configuration:
53
53
 
data/lib/runcible/base.rb CHANGED
@@ -24,20 +24,26 @@
24
24
  require 'rest_client'
25
25
  require 'oauth'
26
26
  require 'json'
27
+ require 'thread'
27
28
 
28
29
 
29
30
  module Runcible
30
31
  class Base
31
32
 
32
33
  def initialize(config={})
34
+ @mutex = Mutex.new
33
35
  @config = config
34
36
  end
35
37
 
38
+ def lazy_config=(a_block)
39
+ @mutex.synchronize { @lazy_config = a_block }
40
+ end
41
+
36
42
  def config
37
- if defined?(@config)
43
+ @mutex.synchronize do
44
+ @config = @lazy_config.call if defined?(@lazy_config)
45
+ raise Runcible::ConfigurationUndefinedError, Runcible::ConfigurationUndefinedError.message unless @config
38
46
  @config
39
- else
40
- raise Runcible::ConfigurationUndefinedError, Runcible::ConfigurationUndefinedError.message
41
47
  end
42
48
  end
43
49
 
@@ -1,3 +1,3 @@
1
1
  module Runcible
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runcible
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
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-07-31 00:00:00.000000000 Z
12
+ date: 2013-08-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -131,38 +131,37 @@ extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - lib/runcible.rb
134
- - lib/runcible/models/yum_clone_distributor.rb
135
- - lib/runcible/models/distributor.rb
136
- - lib/runcible/models/export_distributor.rb
137
- - lib/runcible/models/iso_importer.rb
138
- - lib/runcible/models/yum_distributor.rb
139
- - lib/runcible/models/nodes_http_distributor.rb
134
+ - lib/runcible/instance.rb
140
135
  - lib/runcible/models/iso_distributor.rb
141
136
  - lib/runcible/models/yum_importer.rb
137
+ - lib/runcible/models/yum_distributor.rb
138
+ - lib/runcible/models/iso_importer.rb
142
139
  - lib/runcible/models/importer.rb
143
- - lib/runcible/extensions/package_category.rb
144
- - lib/runcible/extensions/errata.rb
145
- - lib/runcible/extensions/consumer_group.rb
146
- - lib/runcible/extensions/consumer.rb
147
- - lib/runcible/extensions/repository.rb
148
- - lib/runcible/extensions/rpm.rb
149
- - lib/runcible/extensions/unit.rb
150
- - lib/runcible/extensions/package_group.rb
151
- - lib/runcible/extensions/yum_repo_metadata_file.rb
152
- - lib/runcible/extensions/distribution.rb
140
+ - lib/runcible/models/export_distributor.rb
141
+ - lib/runcible/models/yum_clone_distributor.rb
142
+ - lib/runcible/models/distributor.rb
153
143
  - lib/runcible/resources/role.rb
144
+ - lib/runcible/resources/unit.rb
154
145
  - lib/runcible/resources/consumer_group.rb
155
- - lib/runcible/resources/consumer.rb
156
- - lib/runcible/resources/repository_schedule.rb
157
- - lib/runcible/resources/task.rb
158
- - lib/runcible/resources/event_notifier.rb
159
- - lib/runcible/resources/repository.rb
160
146
  - lib/runcible/resources/user.rb
161
- - lib/runcible/resources/unit.rb
147
+ - lib/runcible/resources/task.rb
162
148
  - lib/runcible/resources/repository_group.rb
163
- - lib/runcible/version.rb
164
- - lib/runcible/instance.rb
149
+ - lib/runcible/resources/repository.rb
150
+ - lib/runcible/resources/event_notifier.rb
151
+ - lib/runcible/resources/consumer.rb
152
+ - lib/runcible/resources/repository_schedule.rb
165
153
  - lib/runcible/base.rb
154
+ - lib/runcible/version.rb
155
+ - lib/runcible/extensions/unit.rb
156
+ - lib/runcible/extensions/consumer_group.rb
157
+ - lib/runcible/extensions/repository.rb
158
+ - lib/runcible/extensions/yum_repo_metadata_file.rb
159
+ - lib/runcible/extensions/package_category.rb
160
+ - lib/runcible/extensions/consumer.rb
161
+ - lib/runcible/extensions/package_group.rb
162
+ - lib/runcible/extensions/rpm.rb
163
+ - lib/runcible/extensions/distribution.rb
164
+ - lib/runcible/extensions/errata.rb
166
165
  - LICENSE
167
166
  - Rakefile
168
167
  - Gemfile
@@ -1,61 +0,0 @@
1
- # Copyright (c) 2013 Red Hat Inc.
2
- #
3
- # MIT License
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining
6
- # a copy of this software and associated documentation files (the
7
- # "Software"), to deal in the Software without restriction, including
8
- # without limitation the rights to use, copy, modify, merge, publish,
9
- # distribute, sublicense, and/or sell copies of the Software, and to
10
- # permit persons to whom the Software is furnished to do so, subject to
11
- # the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be
14
- # included in all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- require 'active_support/json'
25
- require 'securerandom'
26
-
27
- module Runcible
28
- module Models
29
- class NodesHttpDistributor < Distributor
30
- #required
31
- attr_accessor "http", "https"
32
-
33
- # Instantiates a export distributor
34
- #
35
- # @param [boolean] http serve the contents over http
36
- # @param [boolean] https serve the contents over https
37
- # @return [Runcible::Extensions::ExportDistributor]
38
- def initialize()
39
- # Pulp seems to expect the ID to be export_distributor, not a random
40
- super({:id => type_id})
41
- end
42
-
43
- # Distributor Type id
44
- #
45
- # @return [string]
46
- def self.type_id
47
- 'nodes_http_distributor'
48
- end
49
-
50
- # generate the pulp config for the export distributor
51
- #
52
- # @return [Hash]
53
- def config
54
- to_ret = as_json
55
- to_ret.delete('auto_publish')
56
- to_ret.delete('id')
57
- to_ret
58
- end
59
- end
60
- end
61
- end