csd 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +51 -43
- data/VERSION +1 -1
- data/bin/ai +10 -7
- data/csd.gemspec +22 -6
- data/lib/csd.rb +0 -3
- data/lib/csd/application/default.rb +7 -0
- data/lib/csd/application/default/base.rb +24 -1
- data/lib/csd/application/minisip.rb +8 -2
- data/lib/csd/application/minisip/base.rb +22 -27
- data/lib/csd/application/minisip/options/common.rb +13 -1
- data/lib/csd/application/minisip/options/compile.rb +12 -33
- data/lib/csd/application/minisip/unix.rb +4 -5
- data/lib/csd/commands.rb +15 -8
- data/lib/csd/container.rb +21 -2
- data/lib/csd/error.rb +14 -7
- data/lib/csd/extensions/core/kernel.rb +23 -0
- data/lib/csd/extensions/core/object.rb +1 -0
- data/lib/csd/extensions/core/open_struct.rb +26 -0
- data/lib/csd/options_parser.rb +11 -16
- data/lib/csd/user_interface/base.rb +9 -4
- data/lib/csd/user_interface/cli.rb +10 -15
- data/lib/csd/user_interface/silent.rb +28 -0
- data/lib/csd/vendor/active_support/object_extensions.rb +37 -0
- data/test/application/test_minisip.rb +12 -7
- data/test/functional/test_application_base.rb +56 -0
- data/test/functional/test_application_default.rb +33 -0
- data/test/functional/test_applications.rb +19 -14
- data/test/functional/test_cli.rb +80 -0
- data/test/functional/test_commands.rb +84 -40
- data/test/functional/test_csd.rb +27 -0
- data/test/functional/test_options.rb +1 -1
- data/test/helper.rb +13 -2
- data/test/unit/test_container.rb +29 -0
- data/test/unit/test_open_struct.rb +22 -0
- metadata +22 -8
- data/bin/tta +0 -26
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestApplications < Test::Unit::TestCase
|
4
|
+
|
5
|
+
include CSD
|
6
|
+
|
7
|
+
context "The CSD class" do
|
8
|
+
|
9
|
+
setup do
|
10
|
+
Options.clear
|
11
|
+
end
|
12
|
+
|
13
|
+
should "by default choose the CLI as user interface" do
|
14
|
+
assert_instance_of UserInterface::CLI, CSD.ui
|
15
|
+
end
|
16
|
+
|
17
|
+
should "perform no caching of the UI class in testmode" do
|
18
|
+
Options.testmode = true
|
19
|
+
Options.silent = false
|
20
|
+
assert_instance_of UserInterface::CLI, CSD.ui
|
21
|
+
Options.silent = true
|
22
|
+
assert_instance_of UserInterface::Silent, CSD.ui
|
23
|
+
end
|
24
|
+
|
25
|
+
end # context "The CSD class"
|
26
|
+
|
27
|
+
end
|
data/test/helper.rb
CHANGED
@@ -10,14 +10,25 @@ require 'csd'
|
|
10
10
|
require 'csd/vendor/zentest/zentest_assertions'
|
11
11
|
|
12
12
|
class Test::Unit::TestCase
|
13
|
-
|
13
|
+
|
14
|
+
# This will cause tests to be executed which require Internet connection
|
15
|
+
#
|
16
|
+
ONLINE = true
|
17
|
+
|
18
|
+
# Even though the CSD library offers this function as an Kernel extension, we override it here.
|
19
|
+
# It must be guaranteed it works during running the tests.
|
20
|
+
#
|
21
|
+
def superuser?
|
22
|
+
Process.uid == 0
|
23
|
+
end
|
24
|
+
|
14
25
|
def ensure_mkdir(target)
|
15
26
|
target = Pathname.new(target) unless target.is_a?(Pathname)
|
16
27
|
target.mkpath
|
17
28
|
assert target.directory?
|
18
29
|
target
|
19
30
|
end
|
20
|
-
|
31
|
+
|
21
32
|
def assert_includes(elem, array, message = nil)
|
22
33
|
message = build_message message, ' is not found in .', elem, array
|
23
34
|
assert_block message do
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestContainer < Test::Unit::TestCase
|
4
|
+
|
5
|
+
include CSD
|
6
|
+
|
7
|
+
context "The container" do
|
8
|
+
|
9
|
+
setup do
|
10
|
+
Options.clear
|
11
|
+
end
|
12
|
+
|
13
|
+
should "have options" do
|
14
|
+
assert_equal Options.marshal_dump, CSD.options.marshal_dump
|
15
|
+
end
|
16
|
+
|
17
|
+
should "have options that can be cleared" do
|
18
|
+
assert_equal Options.marshal_dump, CSD.options.marshal_dump
|
19
|
+
Options.must_be_cleared = true
|
20
|
+
assert Options.must_be_cleared
|
21
|
+
assert_equal Options.marshal_dump, CSD.options.marshal_dump
|
22
|
+
Options.clear
|
23
|
+
assert !Options.must_be_cleared
|
24
|
+
assert_equal Options.marshal_dump, CSD.options.marshal_dump
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'helper'
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
class TestOpenStruct < Test::Unit::TestCase
|
5
|
+
|
6
|
+
context "A normal OpenStruct object" do
|
7
|
+
|
8
|
+
setup do
|
9
|
+
@os = OpenStruct.new :bill => :gates, :steve => :jobs
|
10
|
+
end
|
11
|
+
|
12
|
+
should "be clearable" do
|
13
|
+
assert_equal :gates, @os.bill
|
14
|
+
assert_equal :jobs, @os.steve
|
15
|
+
@os.clear
|
16
|
+
assert_nil @os.bill
|
17
|
+
assert_nil @os.steve
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 9
|
10
|
+
version: 0.1.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Technology Transfer Alliance Team
|
@@ -15,14 +15,13 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
19
|
-
default_executable:
|
18
|
+
date: 2010-07-29 00:00:00 +02:00
|
19
|
+
default_executable: ai
|
20
20
|
dependencies: []
|
21
21
|
|
22
22
|
description: CSD stands for Communication Systems Design and is a project of the Telecommunication Systems Laboratory (TSLab) of the Royal Institute of Technology in Stockholm, Sweden. Within CSD many software tools are used to build up various networks and services. This gem is supposed to automate processes to handle the compilation and installation of these software tools. Technology Transfer Alliance (TTA) is the project team, which maintains this code.
|
23
23
|
email: mtoday11@gmail.com
|
24
24
|
executables:
|
25
|
-
- tta
|
26
25
|
- ai
|
27
26
|
extensions: []
|
28
27
|
|
@@ -36,7 +35,6 @@ files:
|
|
36
35
|
- Rakefile
|
37
36
|
- VERSION
|
38
37
|
- bin/ai
|
39
|
-
- bin/tta
|
40
38
|
- csd.gemspec
|
41
39
|
- lib/csd.rb
|
42
40
|
- lib/csd/application.rb
|
@@ -62,7 +60,9 @@ files:
|
|
62
60
|
- lib/csd/extensions.rb
|
63
61
|
- lib/csd/extensions/core/array.rb
|
64
62
|
- lib/csd/extensions/core/dir.rb
|
63
|
+
- lib/csd/extensions/core/kernel.rb
|
65
64
|
- lib/csd/extensions/core/object.rb
|
65
|
+
- lib/csd/extensions/core/open_struct.rb
|
66
66
|
- lib/csd/extensions/core/option_parser.rb
|
67
67
|
- lib/csd/extensions/core/pathname.rb
|
68
68
|
- lib/csd/extensions/core/string.rb
|
@@ -72,18 +72,26 @@ files:
|
|
72
72
|
- lib/csd/user_interface.rb
|
73
73
|
- lib/csd/user_interface/base.rb
|
74
74
|
- lib/csd/user_interface/cli.rb
|
75
|
+
- lib/csd/user_interface/silent.rb
|
75
76
|
- lib/csd/vendor/active_support/MIT-LICENSE
|
76
77
|
- lib/csd/vendor/active_support/inflector.rb
|
78
|
+
- lib/csd/vendor/active_support/object_extensions.rb
|
77
79
|
- lib/csd/vendor/term/GPL2-LICENSE
|
78
80
|
- lib/csd/vendor/term/ansicolor.rb
|
79
81
|
- lib/csd/vendor/zentest/zentest_assertions.rb
|
80
82
|
- lib/csd/version.rb
|
81
83
|
- test/application/test_minisip.rb
|
84
|
+
- test/functional/test_application_base.rb
|
85
|
+
- test/functional/test_application_default.rb
|
82
86
|
- test/functional/test_applications.rb
|
87
|
+
- test/functional/test_cli.rb
|
83
88
|
- test/functional/test_commands.rb
|
89
|
+
- test/functional/test_csd.rb
|
84
90
|
- test/functional/test_options.rb
|
85
91
|
- test/helper.rb
|
92
|
+
- test/unit/test_container.rb
|
86
93
|
- test/unit/test_dir.rb
|
94
|
+
- test/unit/test_open_struct.rb
|
87
95
|
- test/unit/test_pathname.rb
|
88
96
|
- test/unit/test_string.rb
|
89
97
|
has_rdoc: true
|
@@ -91,7 +99,7 @@ homepage: http://github.com/csd/csd
|
|
91
99
|
licenses: []
|
92
100
|
|
93
101
|
post_install_message: "\n\
|
94
|
-
============================================================\n\n Thank you for installing the TTA Automated Installer!\n\n You can run it by typing `tta\xC2\xB4 in your command line.\n\n NOTE: On DEBIAN and UBUNTU the executable `tta\xC2\xB4 is *maybe*\n not in your PATH by default. If that is the case,\n you can fix it by running this command:\n
|
102
|
+
============================================================\n\n Thank you for installing the TTA Automated Installer!\n\n You can run it by typing `tta\xC2\xB4 in your command line.\n\n NOTE: On DEBIAN and UBUNTU the executable `tta\xC2\xB4 is *maybe*\n not in your PATH by default. If that is the case,\n you can fix it by running this command:\n\n echo \"export PATH=\\$PATH:$(gem env | grep \"E D\" | sed \"s/[^\\w]* //\")\" >> ~/.bashrc;. ~/.bashrc\n\n\
|
95
103
|
============================================================\n "
|
96
104
|
rdoc_options:
|
97
105
|
- --charset=UTF-8
|
@@ -124,10 +132,16 @@ specification_version: 3
|
|
124
132
|
summary: Installation and compilation handler for software used in CSD projects.
|
125
133
|
test_files:
|
126
134
|
- test/application/test_minisip.rb
|
135
|
+
- test/functional/test_application_base.rb
|
136
|
+
- test/functional/test_application_default.rb
|
127
137
|
- test/functional/test_applications.rb
|
138
|
+
- test/functional/test_cli.rb
|
128
139
|
- test/functional/test_commands.rb
|
140
|
+
- test/functional/test_csd.rb
|
129
141
|
- test/functional/test_options.rb
|
130
142
|
- test/helper.rb
|
143
|
+
- test/unit/test_container.rb
|
131
144
|
- test/unit/test_dir.rb
|
145
|
+
- test/unit/test_open_struct.rb
|
132
146
|
- test/unit/test_pathname.rb
|
133
147
|
- test/unit/test_string.rb
|
data/bin/tta
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# NOTE: If you would like to execute this file as a developer
|
4
|
-
# but not install the CSD gem, you can use this command:
|
5
|
-
# ruby -I path/to/csd/lib path/to/csd/bin/tta
|
6
|
-
|
7
|
-
# First, let's load the RubyGems framework and the CSD gem.
|
8
|
-
# Even though RubyGems is already loaded for Ruby >= 1.9,
|
9
|
-
# we want to go sure here and load it to provide robustness
|
10
|
-
require 'rubygems'
|
11
|
-
require 'csd'
|
12
|
-
|
13
|
-
begin
|
14
|
-
# Running the CSD library and telling it who started it
|
15
|
-
CSD.bootstrap :executable => 'tta'
|
16
|
-
rescue CSD::Error::CSDError => e
|
17
|
-
# Here we catch CSD internal errors and exit with the propriate status code
|
18
|
-
# We output the error message only for status codes 50 and higher, because they are rather severe
|
19
|
-
CSD.ui.error e.message unless e.status_code <= 49
|
20
|
-
exit e.status_code
|
21
|
-
rescue Interrupt
|
22
|
-
# Lastly, close the AI gracefully on abnormal termination
|
23
|
-
CSD.ui.separator
|
24
|
-
CSD.ui.info "Quitting the AI...".red
|
25
|
-
exit
|
26
|
-
end
|