csd 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. data/.gitignore +1 -1
  2. data/README.rdoc +19 -6
  3. data/VERSION +1 -1
  4. data/lib/csd.rb +40 -18
  5. data/lib/csd/application.rb +1 -2
  6. data/lib/csd/application/decklink/about.yml +1 -1
  7. data/lib/csd/application/decklink/base.rb +1 -0
  8. data/lib/csd/application/decklink/options/{install.rb → common.rb} +0 -2
  9. data/lib/csd/application/decklink/options/common_defaults.rb +2 -0
  10. data/lib/csd/application/default.rb +62 -6
  11. data/lib/csd/application/graphics.rb +30 -0
  12. data/lib/csd/application/graphics/about.yml +8 -0
  13. data/lib/csd/application/graphics/base.rb +157 -0
  14. data/lib/csd/application/graphics/error.rb +16 -0
  15. data/lib/csd/application/graphics/options/common.rb +11 -0
  16. data/lib/csd/application/graphics/options/common_defaults.rb +2 -0
  17. data/lib/csd/application/graphics/options/install.rb +11 -0
  18. data/lib/csd/application/graphics/options/install_defaults.rb +2 -0
  19. data/lib/csd/application/i2conf.rb +2 -1
  20. data/lib/csd/application/i2conf/about.yml +1 -1
  21. data/lib/csd/application/minisip/about.yml +1 -1
  22. data/lib/csd/application/minisip/base.rb +1 -0
  23. data/lib/csd/application/minisip/component/core.rb +20 -9
  24. data/lib/csd/application/minisip/unix.rb +0 -1
  25. data/lib/csd/application/mslog.rb +29 -0
  26. data/lib/csd/application/mslog/about.yml +8 -0
  27. data/lib/csd/application/mslog/base.rb +123 -0
  28. data/lib/csd/application/mslog/options/common.rb +7 -0
  29. data/lib/csd/application/mslog/options/common_defaults.rb +2 -0
  30. data/lib/csd/applications.rb +2 -0
  31. data/lib/csd/commands.rb +28 -28
  32. data/lib/csd/container.rb +20 -16
  33. data/lib/csd/options_parser.rb +19 -2
  34. data/lib/csd/user_interface/base.rb +4 -0
  35. metadata +19 -7
  36. data/csd.gemspec +0 -161
  37. data/lib/csd/application/opensips/about.yml +0 -2
@@ -9,6 +9,12 @@ module CSD
9
9
  #
10
10
  class OptionsParser < OpenStruct
11
11
 
12
+ # When this method is called, the OptionsParser is populated with information gained via the CLI arguments.
13
+ # For example, the application, action and scope are determined and all --options are identified. Each time
14
+ # this method is called, all current options get lost and are replaced by what could be found in ARGV.
15
+ # Note that it is a destructive method, that is, the ARGV is stripped of all processed arguments. Thus this
16
+ # method can only be called once (that is, unless ARGV is re-populated).
17
+ #
12
18
  def parse!
13
19
  clear
14
20
  parse_literals
@@ -16,14 +22,23 @@ module CSD
16
22
  parse_options
17
23
  end
18
24
 
25
+ # Determines whether the action chosen by the user is valid for the application which was chosen.
26
+ # Returns +true+ if it is a valid action. Returns +false+ if not, or if no application was chosen.
27
+ #
19
28
  def valid_action?
20
- self.actions_names.include?(self.action)
29
+ self.actions_names and self.actions_names.include?(self.action)
21
30
  end
22
31
 
32
+ # Determines whether the scope chosen by the user is valid for the application and action which was chosen.
33
+ # Returns +true+ if it is a valid action. Returns +false+ if not, or if no application was chosen.
34
+ #
23
35
  def valid_scope?
24
- self.scopes_names.include?(self.scope)
36
+ self.scopes_names and self.scopes_names.include?(self.scope)
25
37
  end
26
38
 
39
+ # This method assumes that the application has been chosen and tries to determine which actions and scopes
40
+ # the chosen application can respond to.
41
+ #
27
42
  def define_actions_and_scopes
28
43
  if Applications.current
29
44
  # Here we overwrite the default supported actions and scopes with the application specific ones
@@ -41,6 +56,8 @@ module CSD
41
56
  end
42
57
  end
43
58
 
59
+ # This method resets all Options to default.
60
+ #
44
61
  def clear(additional_options='')
45
62
  # Resetting all attributes to nil (because e.g. an application instance might have modified or added some).
46
63
  super()
@@ -17,6 +17,10 @@ module CSD
17
17
  def ask_yes_no(question, default=nil)
18
18
  end
19
19
 
20
+ def continue?
21
+ ask_yes_no 'Continue?', true
22
+ end
23
+
20
24
  def debug(message)
21
25
  end
22
26
 
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Technology Transfer Alliance Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-30 00:00:00 +02:00
18
+ date: 2010-09-07 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -37,15 +37,23 @@ files:
37
37
  - VERSION
38
38
  - bin/ai
39
39
  - bin/ttai
40
- - csd.gemspec
41
40
  - lib/csd.rb
42
41
  - lib/csd/application.rb
43
42
  - lib/csd/application/decklink.rb
44
43
  - lib/csd/application/decklink/about.yml
45
44
  - lib/csd/application/decklink/base.rb
46
- - lib/csd/application/decklink/options/install.rb
45
+ - lib/csd/application/decklink/options/common.rb
46
+ - lib/csd/application/decklink/options/common_defaults.rb
47
47
  - lib/csd/application/default.rb
48
48
  - lib/csd/application/default/base.rb
49
+ - lib/csd/application/graphics.rb
50
+ - lib/csd/application/graphics/about.yml
51
+ - lib/csd/application/graphics/base.rb
52
+ - lib/csd/application/graphics/error.rb
53
+ - lib/csd/application/graphics/options/common.rb
54
+ - lib/csd/application/graphics/options/common_defaults.rb
55
+ - lib/csd/application/graphics/options/install.rb
56
+ - lib/csd/application/graphics/options/install_defaults.rb
49
57
  - lib/csd/application/i2conf.rb
50
58
  - lib/csd/application/i2conf/about.yml
51
59
  - lib/csd/application/i2conf/base.rb
@@ -78,7 +86,11 @@ files:
78
86
  - lib/csd/application/minisip/unix/linux.rb
79
87
  - lib/csd/application/minisip/unix/linux/debian.rb
80
88
  - lib/csd/application/minisip/unix/linux/debian/ubuntu10.rb
81
- - lib/csd/application/opensips/about.yml
89
+ - lib/csd/application/mslog.rb
90
+ - lib/csd/application/mslog/about.yml
91
+ - lib/csd/application/mslog/base.rb
92
+ - lib/csd/application/mslog/options/common.rb
93
+ - lib/csd/application/mslog/options/common_defaults.rb
82
94
  - lib/csd/applications.rb
83
95
  - lib/csd/commands.rb
84
96
  - lib/csd/container.rb
@@ -1,161 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{csd}
8
- s.version = "0.2.2"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Technology Transfer Alliance Team"]
12
- s.date = %q{2010-08-30}
13
- s.description = %q{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.}
14
- s.email = %q{mtoday11@gmail.com}
15
- s.executables = ["ai", "ttai"]
16
- s.extra_rdoc_files = [
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".gitignore",
22
- "COPYING",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "bin/ai",
27
- "bin/ttai",
28
- "csd.gemspec",
29
- "lib/csd.rb",
30
- "lib/csd/application.rb",
31
- "lib/csd/application/decklink.rb",
32
- "lib/csd/application/decklink/about.yml",
33
- "lib/csd/application/decklink/base.rb",
34
- "lib/csd/application/decklink/options/install.rb",
35
- "lib/csd/application/default.rb",
36
- "lib/csd/application/default/base.rb",
37
- "lib/csd/application/i2conf.rb",
38
- "lib/csd/application/i2conf/about.yml",
39
- "lib/csd/application/i2conf/base.rb",
40
- "lib/csd/application/i2conf/config_example.rb",
41
- "lib/csd/application/i2conf/options/common.rb",
42
- "lib/csd/application/i2conf/options/common_defaults.rb",
43
- "lib/csd/application/i2conf/options/install.rb",
44
- "lib/csd/application/i2conf/options/install_defaults.rb",
45
- "lib/csd/application/minisip.rb",
46
- "lib/csd/application/minisip/about.yml",
47
- "lib/csd/application/minisip/base.rb",
48
- "lib/csd/application/minisip/component.rb",
49
- "lib/csd/application/minisip/component/core.rb",
50
- "lib/csd/application/minisip/component/ffmpeg.rb",
51
- "lib/csd/application/minisip/component/gnome.rb",
52
- "lib/csd/application/minisip/component/hdviper.rb",
53
- "lib/csd/application/minisip/component/network.rb",
54
- "lib/csd/application/minisip/component/plugins.rb",
55
- "lib/csd/application/minisip/component/x264.rb",
56
- "lib/csd/application/minisip/error.rb",
57
- "lib/csd/application/minisip/options/common.rb",
58
- "lib/csd/application/minisip/options/common_defaults.rb",
59
- "lib/csd/application/minisip/options/install.rb",
60
- "lib/csd/application/minisip/options/install_defaults.rb",
61
- "lib/csd/application/minisip/options/package.rb",
62
- "lib/csd/application/minisip/options/package_defaults.rb",
63
- "lib/csd/application/minisip/phonebook_example.rb",
64
- "lib/csd/application/minisip/unix.rb",
65
- "lib/csd/application/minisip/unix/darwin.rb",
66
- "lib/csd/application/minisip/unix/linux.rb",
67
- "lib/csd/application/minisip/unix/linux/debian.rb",
68
- "lib/csd/application/minisip/unix/linux/debian/ubuntu10.rb",
69
- "lib/csd/application/opensips/about.yml",
70
- "lib/csd/applications.rb",
71
- "lib/csd/commands.rb",
72
- "lib/csd/container.rb",
73
- "lib/csd/error.rb",
74
- "lib/csd/extensions.rb",
75
- "lib/csd/extensions/core/array.rb",
76
- "lib/csd/extensions/core/dir.rb",
77
- "lib/csd/extensions/core/kernel.rb",
78
- "lib/csd/extensions/core/object.rb",
79
- "lib/csd/extensions/core/open_struct.rb",
80
- "lib/csd/extensions/core/option_parser.rb",
81
- "lib/csd/extensions/core/pathname.rb",
82
- "lib/csd/extensions/core/string.rb",
83
- "lib/csd/extensions/gem/platform.rb",
84
- "lib/csd/options_parser.rb",
85
- "lib/csd/path_container.rb",
86
- "lib/csd/user_interface.rb",
87
- "lib/csd/user_interface/base.rb",
88
- "lib/csd/user_interface/cli.rb",
89
- "lib/csd/user_interface/silent.rb",
90
- "lib/csd/vendor/active_support/MIT-LICENSE",
91
- "lib/csd/vendor/active_support/inflector.rb",
92
- "lib/csd/vendor/active_support/object_extensions.rb",
93
- "lib/csd/vendor/term/GPL2-LICENSE",
94
- "lib/csd/vendor/term/ansicolor.rb",
95
- "lib/csd/vendor/zentest/zentest_assertions.rb",
96
- "lib/csd/version.rb",
97
- "test/application/test_minisip.rb",
98
- "test/functional/test_application_base.rb",
99
- "test/functional/test_application_default.rb",
100
- "test/functional/test_applications.rb",
101
- "test/functional/test_cli.rb",
102
- "test/functional/test_commands.rb",
103
- "test/functional/test_csd.rb",
104
- "test/functional/test_options.rb",
105
- "test/helper.rb",
106
- "test/unit/test_container.rb",
107
- "test/unit/test_dir.rb",
108
- "test/unit/test_open_struct.rb",
109
- "test/unit/test_pathname.rb",
110
- "test/unit/test_platform.rb",
111
- "test/unit/test_string.rb"
112
- ]
113
- s.homepage = %q{http://github.com/csd/csd}
114
- s.post_install_message = %q{
115
- ============================================================
116
-
117
- Thank you for installing the TTA Automated Installer!
118
-
119
- You can run it by typing `ai´ in your command line.
120
-
121
- NOTE: On DEBIAN and UBUNTU the executable `ai´ is *maybe*
122
- not in your PATH by default. If that is the case,
123
- you can fix it by running this command:
124
-
125
- echo "export PATH=\$PATH:$(gem env | grep "E D" | sed "s/[^\w]* //")" >> ~/.bashrc;. ~/.bashrc
126
-
127
- ============================================================
128
- }
129
- s.rdoc_options = ["--charset=UTF-8"]
130
- s.require_paths = ["lib"]
131
- s.rubygems_version = %q{1.3.7}
132
- s.summary = %q{Installation and compilation handler for software used in CSD projects.}
133
- s.test_files = [
134
- "test/application/test_minisip.rb",
135
- "test/functional/test_application_base.rb",
136
- "test/functional/test_application_default.rb",
137
- "test/functional/test_applications.rb",
138
- "test/functional/test_cli.rb",
139
- "test/functional/test_commands.rb",
140
- "test/functional/test_csd.rb",
141
- "test/functional/test_options.rb",
142
- "test/helper.rb",
143
- "test/unit/test_container.rb",
144
- "test/unit/test_dir.rb",
145
- "test/unit/test_open_struct.rb",
146
- "test/unit/test_pathname.rb",
147
- "test/unit/test_platform.rb",
148
- "test/unit/test_string.rb"
149
- ]
150
-
151
- if s.respond_to? :specification_version then
152
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
153
- s.specification_version = 3
154
-
155
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
156
- else
157
- end
158
- else
159
- end
160
- end
161
-
@@ -1,2 +0,0 @@
1
- human: opensips
2
- description: An open-source SIP server.