boxgrinder-core 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +14 -0
- data/Manifest +4 -1
- data/boxgrinder-core.gemspec +4 -4
- data/lib/boxgrinder-core.rb +0 -2
- data/lib/boxgrinder-core/helpers/appliance-config-helper.rb +13 -16
- data/lib/boxgrinder-core/helpers/appliance-helper.rb +64 -35
- data/lib/boxgrinder-core/helpers/exec-helper.rb +3 -0
- data/lib/boxgrinder-core/helpers/log-helper.rb +2 -3
- data/lib/boxgrinder-core/models/appliance-config.rb +6 -11
- data/lib/boxgrinder-core/models/config.rb +36 -45
- data/lib/boxgrinder-core/validators/appliance-config-validator.rb +0 -1
- data/rubygem-boxgrinder-core.spec +18 -1
- data/spec/helpers/appliance-config-helper-spec.rb +197 -113
- data/spec/helpers/appliance-helper-spec.rb +160 -45
- data/spec/helpers/log-helper-spec.rb +2 -2
- data/spec/models/config-spec.rb +56 -0
- data/spec/rspec/src/appliances/ephemeral-repo.appl +2 -3
- data/spec/rspec/src/appliances/full.appl +2 -3
- data/spec/rspec/src/appliances/invalid_yaml.appl +1 -0
- data/spec/rspec/src/appliances/repo.appl +2 -3
- data/spec/rspec/src/config/empty +0 -0
- data/spec/rspec/src/config/valid +4 -0
- metadata +9 -7
- data/lib/boxgrinder-core/defaults.rb +0 -58
@@ -50,7 +50,7 @@ module BoxGrinder
|
|
50
50
|
it "should change log level" do
|
51
51
|
FileUtils.should_receive(:mkdir_p).once.with("log")
|
52
52
|
|
53
|
-
@helper = LogHelper.new( :
|
53
|
+
@helper = LogHelper.new( :level => "debug" )
|
54
54
|
|
55
55
|
stdout_log = @helper.instance_variable_get(:@stdout_log)
|
56
56
|
file_log = @helper.instance_variable_get(:@file_log)
|
@@ -62,7 +62,7 @@ module BoxGrinder
|
|
62
62
|
it "should change log level" do
|
63
63
|
FileUtils.should_receive(:mkdir_p).once.with("log")
|
64
64
|
|
65
|
-
@helper = LogHelper.new( :
|
65
|
+
@helper = LogHelper.new( :level => "doesntexists" )
|
66
66
|
|
67
67
|
stdout_log = @helper.instance_variable_get(:@stdout_log)
|
68
68
|
file_log = @helper.instance_variable_get(:@file_log)
|
@@ -0,0 +1,56 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2010 Red Hat, Inc.
|
3
|
+
#
|
4
|
+
# This is free software; you can redistribute it and/or modify it
|
5
|
+
# under the terms of the GNU Lesser General Public License as
|
6
|
+
# published by the Free Software Foundation; either version 3 of
|
7
|
+
# the License, or (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This software is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
+
# Lesser General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU Lesser General Public
|
15
|
+
# License along with this software; if not, write to the Free
|
16
|
+
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
17
|
+
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
|
+
|
19
|
+
require 'boxgrinder-core/models/config'
|
20
|
+
|
21
|
+
module BoxGrinder
|
22
|
+
describe Config do
|
23
|
+
it "should not load options from file if it doesn't exists" do
|
24
|
+
ENV['BG_CONFIG_FILE'] = "doesntexists"
|
25
|
+
|
26
|
+
config = Config.new
|
27
|
+
config.force.should == false
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should load empty config file" do
|
31
|
+
ENV['BG_CONFIG_FILE'] = "#{File.dirname(__FILE__)}/../rspec/src/config/empty"
|
32
|
+
|
33
|
+
config = Config.new
|
34
|
+
config.force.should == false
|
35
|
+
config.log_level.should == :info
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should load config file" do
|
39
|
+
ENV['BG_CONFIG_FILE'] = "#{File.dirname(__FILE__)}/../rspec/src/config/valid"
|
40
|
+
|
41
|
+
config = Config.new
|
42
|
+
config.force.should == true
|
43
|
+
config.log_level.should == 'trace'
|
44
|
+
config.dir.build.should == 'build'
|
45
|
+
config.dir.root.should == 'root/dir'
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should merge platform" do
|
49
|
+
ENV['BG_CONFIG_FILE'] = "doesntexists"
|
50
|
+
|
51
|
+
config = Config.new.merge(:platform => :ec2)
|
52
|
+
|
53
|
+
config.platform.should == :ec2
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
!!
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxgrinder-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marek Goldmann
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-02-09 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -61,7 +61,6 @@ extra_rdoc_files:
|
|
61
61
|
- LICENSE
|
62
62
|
- README
|
63
63
|
- lib/boxgrinder-core.rb
|
64
|
-
- lib/boxgrinder-core/defaults.rb
|
65
64
|
- lib/boxgrinder-core/helpers/appliance-config-helper.rb
|
66
65
|
- lib/boxgrinder-core/helpers/appliance-helper.rb
|
67
66
|
- lib/boxgrinder-core/helpers/exec-helper.rb
|
@@ -79,7 +78,6 @@ files:
|
|
79
78
|
- Rakefile
|
80
79
|
- boxgrinder-core.gemspec
|
81
80
|
- lib/boxgrinder-core.rb
|
82
|
-
- lib/boxgrinder-core/defaults.rb
|
83
81
|
- lib/boxgrinder-core/helpers/appliance-config-helper.rb
|
84
82
|
- lib/boxgrinder-core/helpers/appliance-helper.rb
|
85
83
|
- lib/boxgrinder-core/helpers/exec-helper.rb
|
@@ -94,12 +92,16 @@ files:
|
|
94
92
|
- spec/helpers/appliance-helper-spec.rb
|
95
93
|
- spec/helpers/exec-helper-spec.rb
|
96
94
|
- spec/helpers/log-helper-spec.rb
|
95
|
+
- spec/models/config-spec.rb
|
97
96
|
- spec/rspec/ls/one
|
98
97
|
- spec/rspec/ls/two
|
99
98
|
- spec/rspec/rspec-config-helper.rb
|
100
99
|
- spec/rspec/src/appliances/ephemeral-repo.appl
|
101
100
|
- spec/rspec/src/appliances/full.appl
|
101
|
+
- spec/rspec/src/appliances/invalid_yaml.appl
|
102
102
|
- spec/rspec/src/appliances/repo.appl
|
103
|
+
- spec/rspec/src/config/empty
|
104
|
+
- spec/rspec/src/config/valid
|
103
105
|
- spec/validators/appliance-config-validator-spec.rb
|
104
106
|
has_rdoc: true
|
105
107
|
homepage: http://www.jboss.org/boxgrinder
|
@@ -1,58 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright 2010 Red Hat, Inc.
|
3
|
-
#
|
4
|
-
# This is free software; you can redistribute it and/or modify it
|
5
|
-
# under the terms of the GNU Lesser General Public License as
|
6
|
-
# published by the Free Software Foundation; either version 3 of
|
7
|
-
# the License, or (at your option) any later version.
|
8
|
-
#
|
9
|
-
# This software is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
-
# Lesser General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU Lesser General Public
|
15
|
-
# License along with this software; if not, write to the Free
|
16
|
-
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
17
|
-
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
18
|
-
|
19
|
-
module BoxGrinder
|
20
|
-
# here are global variables
|
21
|
-
SUPPORTED_ARCHES = ["i386", "x86_64"]
|
22
|
-
|
23
|
-
APPLIANCE_DEFAULTS = {
|
24
|
-
:os => {
|
25
|
-
:password => "boxgrinder"
|
26
|
-
},
|
27
|
-
:hardware => {
|
28
|
-
:partitions => {"/" => { 'size' => 1 }},
|
29
|
-
:memory => 256,
|
30
|
-
:network => "NAT",
|
31
|
-
:cpus => 1
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
SUPPORTED_DESKTOP_TYPES = ["gnome"]
|
36
|
-
|
37
|
-
DEFAULT_LOCATION = {
|
38
|
-
:log => 'log/boxgrinder.log'
|
39
|
-
}
|
40
|
-
|
41
|
-
DEFAULT_HELP_TEXT = {
|
42
|
-
:general => "See documentation: http://community.jboss.org/docs/DOC-14358."
|
43
|
-
}
|
44
|
-
|
45
|
-
DEFAULT_PROJECT_CONFIG = {
|
46
|
-
:name => 'BoxGrinder',
|
47
|
-
:version => '1.0.0',
|
48
|
-
:release => 'SNAPSHOT',
|
49
|
-
:dir_build => 'build',
|
50
|
-
#:topdir => "#{self.} build/topdir",
|
51
|
-
:dir_src_cache => '/var/cache/boxgrinder/sources-cache',
|
52
|
-
:dir_rpms_cache => '/var/cache/boxgrinder/rpms-cache',
|
53
|
-
:dir_specs => 'specs',
|
54
|
-
:dir_appliances => 'appliances',
|
55
|
-
:dir_src => 'src',
|
56
|
-
:dir_kickstarts => 'kickstarts'
|
57
|
-
}
|
58
|
-
end
|