plainprograms-merb_virtuozzo 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/merb_virtuozzo.rb +2 -1
- data/lib/merb_virtuozzo/mixins/sample_configurations_mixin.rb +44 -0
- data/merb_virtuozzo.gemspec +3 -3
- metadata +4 -2
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'echoe'
|
|
3
3
|
require 'merb-core'
|
4
4
|
require 'merb-core/tasks/merb'
|
5
5
|
|
6
|
-
Echoe.new('merb_virtuozzo', '0.
|
6
|
+
Echoe.new('merb_virtuozzo', '0.3.0') do |p|
|
7
7
|
p.description = "Merb plugin for working with Virtuozzo."
|
8
8
|
p.url = "http://github.com/plainprograms/merb_virtuozzo"
|
9
9
|
p.author = "James Thompson"
|
data/lib/merb_virtuozzo.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# make sure we're running inside Merb
|
2
2
|
if defined?(Merb::Plugins)
|
3
|
-
dependency 'virtuozzo', '~>0.
|
3
|
+
dependency 'virtuozzo', '~>0.6'
|
4
4
|
|
5
5
|
require File.join(File.dirname(__FILE__) / "merb_virtuozzo" / "merb_virtuozzo")
|
6
|
+
require File.join(File.dirname(__FILE__) / "merb_virtuozzo" / "mixins" / "sample_configurations_mixin")
|
6
7
|
|
7
8
|
Merb::BootLoader.before_app_loads do
|
8
9
|
# code that can be required before the application loads
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Merb
|
2
|
+
module Viruozzo
|
3
|
+
module Mixins
|
4
|
+
module SampleConfigurationsMixin
|
5
|
+
##
|
6
|
+
# Returns all available sample configurations. This method caches the
|
7
|
+
# results and does no automatic refresh. To force refreshing of the
|
8
|
+
# cache pass true as the sole argument.
|
9
|
+
#
|
10
|
+
# @param [Boolean] refresh whether to force a new SOAP call to be made
|
11
|
+
#
|
12
|
+
# @return [Array] sample configurations available for use
|
13
|
+
# @api public
|
14
|
+
def available_samples(refresh = false)
|
15
|
+
unless refresh
|
16
|
+
@available_confs ||= _get_available_samples
|
17
|
+
else
|
18
|
+
@available_confs = _get_available_samples
|
19
|
+
end
|
20
|
+
|
21
|
+
return @available_confs
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
##
|
27
|
+
# Does the work of retrieving available sample configurations.
|
28
|
+
#
|
29
|
+
# @return [Array] sample configurations available for use
|
30
|
+
# @api private
|
31
|
+
def _get_available_samples
|
32
|
+
res = Merb::Virtuozzo.connection.sample_configurations.get_sample_conf(nil)
|
33
|
+
|
34
|
+
confs = []
|
35
|
+
|
36
|
+
res.sample_conf.each { |c| confs << c }
|
37
|
+
|
38
|
+
return confs
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/merb_virtuozzo.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{merb_virtuozzo}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.3.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["James Thompson"]
|
9
9
|
s.date = %q{2008-11-18}
|
10
10
|
s.description = %q{Merb plugin for working with Virtuozzo.}
|
11
11
|
s.email = %q{james@plainprograms.com}
|
12
|
-
s.extra_rdoc_files = ["lib/merb_virtuozzo/merb_virtuozzo.rb", "lib/merb_virtuozzo/merbtasks.rb", "lib/merb_virtuozzo/virtuozzo.yml.sample", "lib/merb_virtuozzo.rb", "README.rdoc"]
|
13
|
-
s.files = ["lib/merb_virtuozzo/merb_virtuozzo.rb", "lib/merb_virtuozzo/merbtasks.rb", "lib/merb_virtuozzo/virtuozzo.yml.sample", "lib/merb_virtuozzo.rb", "Manifest", "
|
12
|
+
s.extra_rdoc_files = ["lib/merb_virtuozzo/merb_virtuozzo.rb", "lib/merb_virtuozzo/merbtasks.rb", "lib/merb_virtuozzo/mixins/sample_configurations_mixin.rb", "lib/merb_virtuozzo/virtuozzo.yml.sample", "lib/merb_virtuozzo.rb", "README.rdoc"]
|
13
|
+
s.files = ["lib/merb_virtuozzo/merb_virtuozzo.rb", "lib/merb_virtuozzo/merbtasks.rb", "lib/merb_virtuozzo/mixins/sample_configurations_mixin.rb", "lib/merb_virtuozzo/virtuozzo.yml.sample", "lib/merb_virtuozzo.rb", "Manifest", "Rakefile", "README.rdoc", "spec/spec_helper.rb", "spec/virtuozzo_spec.rb", "merb_virtuozzo.gemspec"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://github.com/plainprograms/merb_virtuozzo}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Merb_virtuozzo", "--main", "README.rdoc"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plainprograms-merb_virtuozzo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Thompson
|
@@ -48,20 +48,22 @@ extensions: []
|
|
48
48
|
extra_rdoc_files:
|
49
49
|
- lib/merb_virtuozzo/merb_virtuozzo.rb
|
50
50
|
- lib/merb_virtuozzo/merbtasks.rb
|
51
|
+
- lib/merb_virtuozzo/mixins/sample_configurations_mixin.rb
|
51
52
|
- lib/merb_virtuozzo/virtuozzo.yml.sample
|
52
53
|
- lib/merb_virtuozzo.rb
|
53
54
|
- README.rdoc
|
54
55
|
files:
|
55
56
|
- lib/merb_virtuozzo/merb_virtuozzo.rb
|
56
57
|
- lib/merb_virtuozzo/merbtasks.rb
|
58
|
+
- lib/merb_virtuozzo/mixins/sample_configurations_mixin.rb
|
57
59
|
- lib/merb_virtuozzo/virtuozzo.yml.sample
|
58
60
|
- lib/merb_virtuozzo.rb
|
59
61
|
- Manifest
|
60
|
-
- merb_virtuozzo.gemspec
|
61
62
|
- Rakefile
|
62
63
|
- README.rdoc
|
63
64
|
- spec/spec_helper.rb
|
64
65
|
- spec/virtuozzo_spec.rb
|
66
|
+
- merb_virtuozzo.gemspec
|
65
67
|
has_rdoc: true
|
66
68
|
homepage: http://github.com/plainprograms/merb_virtuozzo
|
67
69
|
post_install_message:
|