puppet 4.0.0.rc1-x86-mingw32 → 4.0.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.md +11 -6
  3. data/Gemfile +1 -1
  4. data/conf/environment.conf +4 -2
  5. data/ext/build_defaults.yaml +3 -3
  6. data/ext/debian/control +2 -2
  7. data/ext/project_data.yaml +1 -1
  8. data/ext/rack/config.ru +1 -0
  9. data/ext/redhat/client.sysconfig +1 -1
  10. data/ext/redhat/puppet.spec.erb +2 -2
  11. data/ext/systemd/puppet.service +1 -0
  12. data/install.rb +2 -2
  13. data/lib/puppet/application/device.rb +22 -5
  14. data/lib/puppet/data_providers.rb +7 -4
  15. data/lib/puppet/data_providers/data_adapter.rb +6 -1
  16. data/lib/puppet/data_providers/data_function_support.rb +17 -4
  17. data/lib/puppet/data_providers/function_env_data_provider.rb +1 -1
  18. data/lib/puppet/data_providers/function_module_data_provider.rb +14 -19
  19. data/lib/puppet/defaults.rb +43 -16
  20. data/lib/puppet/error.rb +4 -0
  21. data/lib/puppet/pops/evaluator/evaluator_impl.rb +33 -4
  22. data/lib/puppet/pops/evaluator/runtime3_support.rb +5 -1
  23. data/lib/puppet/pops/parser/egrammar.ra +2 -0
  24. data/lib/puppet/pops/parser/eparser.rb +732 -724
  25. data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
  26. data/lib/puppet/pops/parser/lexer2.rb +19 -21
  27. data/lib/puppet/provider/macauthorization/macauthorization.rb +1 -1
  28. data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
  29. data/lib/puppet/provider/package/appdmg.rb +1 -1
  30. data/lib/puppet/provider/package/gem.rb +19 -6
  31. data/lib/puppet/provider/package/pkgdmg.rb +1 -1
  32. data/lib/puppet/provider/package/puppet_gem.rb +17 -0
  33. data/lib/puppet/provider/service/launchd.rb +1 -1
  34. data/lib/puppet/provider/user/directoryservice.rb +2 -2
  35. data/lib/puppet/settings.rb +1 -1
  36. data/lib/puppet/util/errors.rb +4 -2
  37. data/lib/puppet/util/network_device/config.rb +5 -0
  38. data/lib/puppet/util/run_mode.rb +28 -11
  39. data/lib/puppet/util/windows/registry.rb +3 -3
  40. data/lib/puppet/vendor/deep_merge/PUPPET_README.md +6 -0
  41. data/lib/puppet/vendor/load_plist.rb +1 -0
  42. data/lib/puppet/vendor/plist/CHANGELOG +82 -0
  43. data/lib/puppet/vendor/plist/MIT-LICENSE +21 -0
  44. data/lib/puppet/vendor/plist/PUPPET_README.md +6 -0
  45. data/lib/puppet/vendor/plist/README +36 -0
  46. data/lib/puppet/vendor/plist/Rakefile +144 -0
  47. data/lib/puppet/vendor/plist/docs/USAGE +104 -0
  48. data/lib/puppet/vendor/plist/docs/jamis-template.rb +591 -0
  49. data/lib/puppet/vendor/plist/lib/plist.rb +22 -0
  50. data/lib/puppet/vendor/plist/lib/plist/generator.rb +224 -0
  51. data/lib/puppet/vendor/plist/lib/plist/parser.rb +225 -0
  52. data/lib/puppet/vendor/plist/test/assets/AlbumData.xml +203 -0
  53. data/lib/puppet/vendor/plist/test/assets/Cookies.plist +104 -0
  54. data/lib/puppet/vendor/plist/test/assets/commented.plist +9 -0
  55. data/lib/puppet/vendor/plist/test/assets/example_data.bin +0 -0
  56. data/lib/puppet/vendor/plist/test/assets/example_data.jpg +0 -0
  57. data/lib/puppet/vendor/plist/test/assets/example_data.plist +259 -0
  58. data/lib/puppet/vendor/plist/test/assets/test_data_elements.plist +24 -0
  59. data/lib/puppet/vendor/plist/test/assets/test_empty_key.plist +13 -0
  60. data/lib/puppet/vendor/plist/test/test_data_elements.rb +115 -0
  61. data/lib/puppet/vendor/plist/test/test_generator.rb +59 -0
  62. data/lib/puppet/vendor/plist/test/test_generator_basic_types.rb +58 -0
  63. data/lib/puppet/vendor/plist/test/test_generator_collections.rb +82 -0
  64. data/lib/puppet/vendor/plist/test/test_parser.rb +90 -0
  65. data/lib/puppet/version.rb +1 -1
  66. data/man/man5/puppet.conf.5 +5 -13
  67. data/man/man8/extlookup2hiera.8 +1 -1
  68. data/man/man8/puppet-agent.8 +1 -1
  69. data/man/man8/puppet-apply.8 +1 -1
  70. data/man/man8/puppet-ca.8 +1 -1
  71. data/man/man8/puppet-catalog.8 +1 -1
  72. data/man/man8/puppet-cert.8 +1 -1
  73. data/man/man8/puppet-certificate.8 +1 -1
  74. data/man/man8/puppet-certificate_request.8 +1 -1
  75. data/man/man8/puppet-certificate_revocation_list.8 +1 -1
  76. data/man/man8/puppet-config.8 +1 -1
  77. data/man/man8/puppet-describe.8 +1 -1
  78. data/man/man8/puppet-device.8 +1 -1
  79. data/man/man8/puppet-doc.8 +1 -1
  80. data/man/man8/puppet-epp.8 +1 -1
  81. data/man/man8/puppet-facts.8 +1 -1
  82. data/man/man8/puppet-file.8 +1 -1
  83. data/man/man8/puppet-filebucket.8 +1 -1
  84. data/man/man8/puppet-help.8 +1 -1
  85. data/man/man8/puppet-inspect.8 +1 -1
  86. data/man/man8/puppet-key.8 +1 -1
  87. data/man/man8/puppet-man.8 +1 -1
  88. data/man/man8/puppet-master.8 +1 -1
  89. data/man/man8/puppet-module.8 +1 -1
  90. data/man/man8/puppet-node.8 +1 -1
  91. data/man/man8/puppet-parser.8 +1 -1
  92. data/man/man8/puppet-plugin.8 +1 -1
  93. data/man/man8/puppet-report.8 +1 -1
  94. data/man/man8/puppet-resource.8 +1 -1
  95. data/man/man8/puppet-resource_type.8 +1 -1
  96. data/man/man8/puppet-status.8 +1 -1
  97. data/man/man8/puppet.8 +1 -1
  98. data/spec/fixtures/unit/functions/lookup/environments/production/lib/puppet/functions/environment/data.rb +8 -6
  99. data/spec/fixtures/unit/functions/lookup/environments/production/modules/abc/lib/puppet/functions/abc/data.rb +4 -4
  100. data/spec/fixtures/unit/functions/lookup/environments/production/modules/bad_data/lib/puppet/bindings/bad_data/default.rb +9 -0
  101. data/spec/fixtures/unit/functions/lookup/environments/production/modules/bad_data/lib/puppet/functions/bad_data/data.rb +6 -0
  102. data/spec/fixtures/unit/functions/lookup/environments/production/modules/bad_data/manifests/init.pp +3 -0
  103. data/spec/fixtures/unit/functions/lookup/environments/production/modules/bca/lib/puppet/bindings/bca/default.rb +9 -0
  104. data/spec/fixtures/unit/functions/lookup/environments/production/modules/bca/lib/puppet/functions/bca/data.rb +9 -0
  105. data/spec/fixtures/unit/functions/lookup/environments/production/modules/bca/manifests/init.pp +2 -0
  106. data/spec/fixtures/unit/functions/lookup/environments/production/modules/no_provider/manifests/init.pp +2 -0
  107. data/spec/integration/provider/yumrepo_spec.rb +127 -0
  108. data/spec/unit/application/device_spec.rb +52 -14
  109. data/spec/unit/functions/lookup_spec.rb +95 -55
  110. data/spec/unit/parser/functions/create_resources_spec.rb +1 -1
  111. data/spec/unit/pops/binder/injector_spec.rb +0 -18
  112. data/spec/unit/pops/parser/lexer2_spec.rb +26 -16
  113. data/spec/unit/pops/parser/parse_heredoc_spec.rb +21 -0
  114. data/spec/unit/pops/validator/validator_spec.rb +2 -3
  115. data/spec/unit/provider/macauthorization_spec.rb +1 -1
  116. data/spec/unit/provider/package/gem_spec.rb +201 -139
  117. data/spec/unit/provider/package/puppet_gem_spec.rb +67 -0
  118. data/spec/unit/provider/user/directoryservice_spec.rb +1 -1
  119. data/spec/unit/util/network_device/config_spec.rb +6 -0
  120. data/spec/unit/util/run_mode_spec.rb +26 -26
  121. data/spec/unit/util/windows/registry_spec.rb +4 -3
  122. metadata +3016 -2994
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2006, Ben Bleything <ben@bleything.net>
2
+ and Patrick May <patrick@hexane.org>
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included
13
+ in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
16
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
17
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,6 @@
1
+ Plist - All-purpose Property List manipulation library
2
+ ================
3
+
4
+ Plist 3.0.0+
5
+
6
+ Copied from https://github.com/bleything/plist/tree/3b9ef5be6157c75f334433f438e0af2f26117d2f
@@ -0,0 +1,36 @@
1
+ = All-purpose Property List manipulation library
2
+
3
+ Plist is a library to manipulate Property List files, also known as plists. It can parse plist files into native Ruby data structures as well as generating new plist files from your Ruby objects.
4
+
5
+ == Usage
6
+
7
+ See USAGE[link:files/docs/USAGE.html].
8
+
9
+ == Links
10
+
11
+ [<b>Project Page</b>] http://plist.rubyforge.org
12
+ [<b>Subversion repository</b>] svn://rubyforge.org//var/svn/plist
13
+ [<b>RDoc (on RubyForge)</b>] http://plist.rubyforge.org
14
+
15
+ == Credits
16
+
17
+ plist is maintained by Ben Bleything <mailto:ben@bleything.net> and Patrick May <mailto:patrick@hexane.org>. Patrick wrote most of the code; Ben is a recent addition to the project, having merged in his plist generation library.
18
+
19
+ Other folks who have helped along the way:
20
+
21
+ [<b>Martin Dittus</b>] who pointed out that +Time+ wasn't enough for plist <tt>Dates</tt>, especially those in <tt>~/Library/Cookies/Cookies.plist</tt>
22
+ [<b>Chuck Remes</b>] who pushed Patrick towards implementing <tt>#to_plist</tt>
23
+ [<b>Mat Schaffer</b>] who supplied code and test cases for <tt><data></tt> elements
24
+ [<b>Michael Granger</b>] for encouragement and help
25
+
26
+ == License and Copyright
27
+
28
+ plist is released under the MIT License.
29
+
30
+ Portions of the code (notably the Rakefile) contain code pulled and/or adapted from other projects. These files contain a comment at the top describing what was used.
31
+
32
+ === MIT License
33
+
34
+ :include: MIT-LICENSE
35
+
36
+
@@ -0,0 +1,144 @@
1
+ ##############################################################
2
+ # Copyright 2006, Ben Bleything <ben@bleything.net> and #
3
+ # Patrick May <patrick@hexane.org> #
4
+ # #
5
+ # Based heavily on Geoffrey Grosenbach's Rakefile for gruff. #
6
+ # Includes whitespace-fixing task based on code from Typo. #
7
+ # #
8
+ # Distributed under the MIT license. #
9
+ ##############################################################
10
+
11
+ require 'fileutils'
12
+ require 'rubygems'
13
+ require 'rake'
14
+ require 'rake/testtask'
15
+ require 'rake/rdoctask'
16
+ require 'rake/packagetask'
17
+ require 'rake/gempackagetask'
18
+ require 'rake/contrib/rubyforgepublisher'
19
+
20
+ $:.unshift(File.dirname(__FILE__) + "/lib")
21
+ require 'plist'
22
+
23
+ PKG_NAME = 'plist'
24
+ PKG_VERSION = Plist::VERSION
25
+ PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
26
+
27
+ RELEASE_NAME = "REL #{PKG_VERSION}"
28
+
29
+ RUBYFORGE_PROJECT = "plist"
30
+ RUBYFORGE_USER = ENV['RUBYFORGE_USER']
31
+
32
+ TEST_FILES = Dir.glob('test/test_*').delete_if { |item| item.include?( "\.svn" ) }
33
+ TEST_ASSETS = Dir.glob('test/assets/*').delete_if { |item| item.include?( "\.svn" ) }
34
+ LIB_FILES = Dir.glob('lib/**/*').delete_if { |item| item.include?( "\.svn" ) }
35
+ RELEASE_FILES = [ "Rakefile", "README", "MIT-LICENSE", "docs/USAGE" ] + LIB_FILES + TEST_FILES + TEST_ASSETS
36
+
37
+ task :default => [ :test ]
38
+ # Run the unit tests
39
+ Rake::TestTask.new { |t|
40
+ t.libs << "test"
41
+ t.pattern = 'test/test_*.rb'
42
+ t.verbose = true
43
+ }
44
+
45
+ desc "Clean pkg, coverage, and rdoc; remove .bak files"
46
+ task :clean => [ :clobber_rdoc, :clobber_package, :clobber_coverage ] do
47
+ puts cmd = "find . -type f -name *.bak -delete"
48
+ `#{cmd}`
49
+ end
50
+
51
+ task :clobber_coverage do
52
+ puts cmd = "rm -rf coverage"
53
+ `#{cmd}`
54
+ end
55
+
56
+ desc "Generate coverage analysis with rcov (requires rcov to be installed)"
57
+ task :rcov => [ :clobber_coverage ] do
58
+ puts cmd = "rcov -Ilib --xrefs -T test/*.rb"
59
+ puts `#{cmd}`
60
+ end
61
+
62
+ desc "Strip trailing whitespace and fix newlines for all release files"
63
+ task :fix_whitespace => [ :clean ] do
64
+ RELEASE_FILES.reject {|i| i =~ /assets/}.each do |filename|
65
+ next if File.directory? filename
66
+
67
+ File.open(filename) do |file|
68
+ newfile = ''
69
+ needs_love = false
70
+
71
+ file.readlines.each_with_index do |line, lineno|
72
+ if line =~ /[ \t]+$/
73
+ needs_love = true
74
+ puts "#{filename}: trailing whitespace on line #{lineno}"
75
+ line.gsub!(/[ \t]*$/, '')
76
+ end
77
+
78
+ if line.chomp == line
79
+ needs_love = true
80
+ puts "#{filename}: no newline on line #{lineno}"
81
+ line << "\n"
82
+ end
83
+
84
+ newfile << line
85
+ end
86
+
87
+ if needs_love
88
+ tempname = "#{filename}.new"
89
+
90
+ File.open(tempname, 'w').write(newfile)
91
+ File.chmod(File.stat(filename).mode, tempname)
92
+
93
+ FileUtils.ln filename, "#{filename}.bak"
94
+ FileUtils.ln tempname, filename, :force => true
95
+ File.unlink(tempname)
96
+ end
97
+ end
98
+ end
99
+ end
100
+
101
+ desc "Copy documentation to rubyforge"
102
+ task :update_rdoc => [ :rdoc ] do
103
+ Rake::SshDirPublisher.new("#{RUBYFORGE_USER}@rubyforge.org", "/var/www/gforge-projects/#{RUBYFORGE_PROJECT}", "rdoc").upload
104
+ end
105
+
106
+ # Genereate the RDoc documentation
107
+ Rake::RDocTask.new { |rdoc|
108
+ rdoc.rdoc_dir = 'rdoc'
109
+ rdoc.title = "All-purpose Property List manipulation library"
110
+ rdoc.options << '-SNmREADME'
111
+ rdoc.template = "docs/jamis-template.rb"
112
+ rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'CHANGELOG')
113
+ rdoc.rdoc_files.include Dir.glob('docs/**').delete_if {|f| f.include? 'jamis' }
114
+ rdoc.rdoc_files.include('lib/**')
115
+ }
116
+
117
+ # Create compressed packages
118
+ spec = Gem::Specification.new do |s|
119
+ s.name = PKG_NAME
120
+ s.version = PKG_VERSION
121
+
122
+ s.summary = "All-purpose Property List manipulation library."
123
+ s.description = <<-EOD
124
+ Plist is a library to manipulate Property List files, also known as plists. It can parse plist files into native Ruby data structures as well as generating new plist files from your Ruby objects.
125
+ EOD
126
+
127
+ s.authors = "Ben Bleything and Patrick May"
128
+ s.homepage = "http://plist.rubyforge.org"
129
+
130
+ s.rubyforge_project = RUBYFORGE_PROJECT
131
+
132
+ s.has_rdoc = true
133
+
134
+ s.files = RELEASE_FILES
135
+ s.test_files = TEST_FILES
136
+
137
+ s.autorequire = 'plist'
138
+ end
139
+
140
+ Rake::GemPackageTask.new(spec) do |p|
141
+ p.gem_spec = spec
142
+ p.need_tar = true
143
+ p.need_zip = true
144
+ end
@@ -0,0 +1,104 @@
1
+ == Parsing
2
+
3
+ result = Plist::parse_xml('path/to/example.plist')
4
+
5
+ result.class
6
+ => Hash
7
+
8
+ "#{result['FirstName']} #{result['LastName']}"
9
+ => "John Public"
10
+
11
+ result['ZipPostal']
12
+ => "12345"
13
+
14
+ ==== Example Property List
15
+
16
+ <?xml version="1.0" encoding="UTF-8"?>
17
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
18
+ <plist version="1.0">
19
+ <dict>
20
+ <key>FirstName</key>
21
+ <string>John</string>
22
+
23
+ <key>LastName</key>
24
+ <string>Public</string>
25
+
26
+ <key>StreetAddr1</key>
27
+ <string>123 Anywhere St.</string>
28
+
29
+ <key>StateProv</key>
30
+ <string>CA</string>
31
+
32
+ <key>City</key>
33
+ <string>Some Town</string>
34
+
35
+ <key>CountryName</key>
36
+ <string>United States</string>
37
+
38
+ <key>AreaCode</key>
39
+ <string>555</string>
40
+
41
+ <key>LocalPhoneNumber</key>
42
+ <string>5551212</string>
43
+
44
+ <key>ZipPostal</key>
45
+ <string>12345</string>
46
+ </dict>
47
+ </plist>
48
+
49
+ == Generation
50
+
51
+ plist also provides the ability to generate plists from Ruby objects. The following Ruby classes are converted into native plist types:
52
+ Array, Bignum, Date, DateTime, Fixnum, Float, Hash, Integer, String, Symbol, Time, true, false
53
+
54
+ * +Array+ and +Hash+ are both recursive; their elements will be converted into plist nodes inside the <array> and <dict> containers (respectively).
55
+ * +IO+ (and its descendants) and +StringIO+ objects are read from and their contents placed in a <data> element.
56
+ * User classes may implement +to_plist_node+ to dictate how they should be serialized; otherwise the object will be passed to <tt>Marshal.dump</tt> and the result placed in a <data> element. See below for more details.
57
+
58
+ ==== Creating a plist
59
+
60
+ There are two ways to generate complete plists. Given an object:
61
+
62
+ obj = [1, :two, {'c' => 0xd}]
63
+
64
+ If you've mixed in <tt>Plist::Emit</tt> (which is already done for +Array+ and +Hash+), you can simply call +to_plist+:
65
+
66
+ obj.to_plist
67
+
68
+ This is equivalent to calling <tt>Plist::Emit.dump(obj)</tt>. Either one will yield:
69
+
70
+ <?xml version="1.0" encoding="UTF-8"?>
71
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
72
+ <plist version="1.0">
73
+ <array>
74
+ <integer>1</integer>
75
+ <string>two</string>
76
+ <dict>
77
+ <key>c</key>
78
+ <integer>13</integer>
79
+ </dict>
80
+ </array>
81
+ </plist>
82
+
83
+ You can also dump plist fragments by passing +false+ as the second parameter:
84
+
85
+ Plist::Emit.dump('holy cow!', false)
86
+ => "<string>holy cow!</string>"
87
+
88
+ ==== Custom serialization
89
+
90
+ If your class can be safely coerced into a native plist datatype, you can implement +to_plist_node+. Upon encountering an object of a class it doesn't recognize, the plist library will check to see if it responds to +to_plist_node+, and if so, insert the result of that call into the plist output.
91
+
92
+ An example:
93
+
94
+ class MyFancyString
95
+ ...
96
+
97
+ def to_plist_node
98
+ return "<string>#{self.defancify}</string>"
99
+ end
100
+ end
101
+
102
+ When you attempt to serialize a +MyFancyString+ object, the +to_plist_node+ method will be called and the object's contents will be defancified and placed in the plist.
103
+
104
+ If for whatever reason you can't add this method, your object will be serialized with <tt>Marshal.dump</tt> instead.
@@ -0,0 +1,591 @@
1
+ module RDoc
2
+ module Page
3
+
4
+ FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif"
5
+
6
+ STYLE = <<CSS
7
+ a {
8
+ color: #00F;
9
+ text-decoration: none;
10
+ }
11
+
12
+ a:hover {
13
+ color: #77F;
14
+ text-decoration: underline;
15
+ }
16
+
17
+ body, td, p {
18
+ font-family: %fonts%;
19
+ background: #FFF;
20
+ color: #000;
21
+ margin: 0px;
22
+ font-size: small;
23
+ }
24
+
25
+ #content {
26
+ margin: 2em;
27
+ }
28
+
29
+ #description p {
30
+ margin-bottom: 0.5em;
31
+ }
32
+
33
+ .sectiontitle {
34
+ margin-top: 1em;
35
+ margin-bottom: 1em;
36
+ padding: 0.5em;
37
+ padding-left: 2em;
38
+ background: #005;
39
+ color: #FFF;
40
+ font-weight: bold;
41
+ border: 1px dotted black;
42
+ }
43
+
44
+ .attr-rw {
45
+ padding-left: 1em;
46
+ padding-right: 1em;
47
+ text-align: center;
48
+ color: #055;
49
+ }
50
+
51
+ .attr-name {
52
+ font-weight: bold;
53
+ }
54
+
55
+ .attr-desc {
56
+ }
57
+
58
+ .attr-value {
59
+ font-family: monospace;
60
+ }
61
+
62
+ .file-title-prefix {
63
+ font-size: large;
64
+ }
65
+
66
+ .file-title {
67
+ font-size: large;
68
+ font-weight: bold;
69
+ background: #005;
70
+ color: #FFF;
71
+ }
72
+
73
+ .banner {
74
+ background: #005;
75
+ color: #FFF;
76
+ border: 1px solid black;
77
+ padding: 1em;
78
+ }
79
+
80
+ .banner td {
81
+ background: transparent;
82
+ color: #FFF;
83
+ }
84
+
85
+ h1 a, h2 a, .sectiontitle a, .banner a {
86
+ color: #FF0;
87
+ }
88
+
89
+ h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover {
90
+ color: #FF7;
91
+ }
92
+
93
+ .dyn-source {
94
+ display: none;
95
+ background: #FFE;
96
+ color: #000;
97
+ border: 1px dotted black;
98
+ margin: 0.5em 2em 0.5em 2em;
99
+ padding: 0.5em;
100
+ }
101
+
102
+ .dyn-source .cmt {
103
+ color: #00F;
104
+ font-style: italic;
105
+ }
106
+
107
+ .dyn-source .kw {
108
+ color: #070;
109
+ font-weight: bold;
110
+ }
111
+
112
+ .method {
113
+ margin-left: 1em;
114
+ margin-right: 1em;
115
+ margin-bottom: 1em;
116
+ }
117
+
118
+ .description pre {
119
+ padding: 0.5em;
120
+ border: 1px dotted black;
121
+ background: #FFE;
122
+ }
123
+
124
+ .method .title {
125
+ font-family: monospace;
126
+ font-size: large;
127
+ border-bottom: 1px dashed black;
128
+ margin-bottom: 0.3em;
129
+ padding-bottom: 0.1em;
130
+ }
131
+
132
+ .method .description, .method .sourcecode {
133
+ margin-left: 1em;
134
+ }
135
+
136
+ .description p, .sourcecode p {
137
+ margin-bottom: 0.5em;
138
+ }
139
+
140
+ .method .sourcecode p.source-link {
141
+ text-indent: 0em;
142
+ margin-top: 0.5em;
143
+ }
144
+
145
+ .method .aka {
146
+ margin-top: 0.3em;
147
+ margin-left: 1em;
148
+ font-style: italic;
149
+ text-indent: 2em;
150
+ }
151
+
152
+ h1 {
153
+ padding: 1em;
154
+ border: 1px solid black;
155
+ font-size: x-large;
156
+ font-weight: bold;
157
+ color: #FFF;
158
+ background: #007;
159
+ }
160
+
161
+ h2 {
162
+ padding: 0.5em 1em 0.5em 1em;
163
+ border: 1px solid black;
164
+ font-size: large;
165
+ font-weight: bold;
166
+ color: #FFF;
167
+ background: #009;
168
+ }
169
+
170
+ h3, h4, h5, h6 {
171
+ padding: 0.2em 1em 0.2em 1em;
172
+ border: 1px dashed black;
173
+ color: #000;
174
+ background: #AAF;
175
+ }
176
+
177
+ .sourcecode > pre {
178
+ padding: 0.5em;
179
+ border: 1px dotted black;
180
+ background: #FFE;
181
+ }
182
+
183
+ CSS
184
+
185
+ XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
186
+ <!DOCTYPE html
187
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
188
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
189
+ }
190
+
191
+ HEADER = XHTML_PREAMBLE + <<ENDHEADER
192
+ <html>
193
+ <head>
194
+ <title>%title%</title>
195
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
196
+ <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
197
+
198
+ <script language="JavaScript" type="text/javascript">
199
+ // <![CDATA[
200
+
201
+ function toggleSource( id )
202
+ {
203
+ var elem
204
+ var link
205
+
206
+ if( document.getElementById )
207
+ {
208
+ elem = document.getElementById( id )
209
+ link = document.getElementById( "l_" + id )
210
+ }
211
+ else if ( document.all )
212
+ {
213
+ elem = eval( "document.all." + id )
214
+ link = eval( "document.all.l_" + id )
215
+ }
216
+ else
217
+ return false;
218
+
219
+ if( elem.style.display == "block" )
220
+ {
221
+ elem.style.display = "none"
222
+ link.innerHTML = "show source"
223
+ }
224
+ else
225
+ {
226
+ elem.style.display = "block"
227
+ link.innerHTML = "hide source"
228
+ }
229
+ }
230
+
231
+ function openCode( url )
232
+ {
233
+ window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
234
+ }
235
+ // ]]>
236
+ </script>
237
+ </head>
238
+
239
+ <body>
240
+ ENDHEADER
241
+
242
+ FILE_PAGE = <<HTML
243
+ <table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>
244
+ <tr><td>
245
+ <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr>
246
+ <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td>
247
+ <td align="right">
248
+ <table border='0' cellspacing="0" cellpadding="2">
249
+ <tr>
250
+ <td>Path:</td>
251
+ <td>%full_path%
252
+ IF:cvsurl
253
+ &nbsp;(<a href="%cvsurl%">CVS</a>)
254
+ ENDIF:cvsurl
255
+ </td>
256
+ </tr>
257
+ <tr>
258
+ <td>Modified:</td>
259
+ <td>%dtm_modified%</td>
260
+ </tr>
261
+ </table>
262
+ </td></tr>
263
+ </table>
264
+ </td></tr>
265
+ </table><br>
266
+ HTML
267
+
268
+ ###################################################################
269
+
270
+ CLASS_PAGE = <<HTML
271
+ <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
272
+ <td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td>
273
+ <td align="right">
274
+ <table cellspacing=0 cellpadding=2>
275
+ <tr valign="top">
276
+ <td>In:</td>
277
+ <td>
278
+ START:infiles
279
+ HREF:full_path_url:full_path:
280
+ IF:cvsurl
281
+ &nbsp;(<a href="%cvsurl%">CVS</a>)
282
+ ENDIF:cvsurl
283
+ END:infiles
284
+ </td>
285
+ </tr>
286
+ IF:parent
287
+ <tr>
288
+ <td>Parent:</td>
289
+ <td>
290
+ IF:par_url
291
+ <a href="%par_url%">
292
+ ENDIF:par_url
293
+ %parent%
294
+ IF:par_url
295
+ </a>
296
+ ENDIF:par_url
297
+ </td>
298
+ </tr>
299
+ ENDIF:parent
300
+ </table>
301
+ </td>
302
+ </tr>
303
+ </table>
304
+ HTML
305
+
306
+ ###################################################################
307
+
308
+ METHOD_LIST = <<HTML
309
+ <div id="content">
310
+ IF:diagram
311
+ <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center">
312
+ %diagram%
313
+ </td></tr></table>
314
+ ENDIF:diagram
315
+
316
+ IF:description
317
+ <div class="description">%description%</div>
318
+ ENDIF:description
319
+
320
+ IF:requires
321
+ <div class="sectiontitle">Required Files</div>
322
+ <ul>
323
+ START:requires
324
+ <li>HREF:aref:name:</li>
325
+ END:requires
326
+ </ul>
327
+ ENDIF:requires
328
+
329
+ IF:toc
330
+ <div class="sectiontitle">Contents</div>
331
+ <ul>
332
+ START:toc
333
+ <li><a href="#%href%">%secname%</a></li>
334
+ END:toc
335
+ </ul>
336
+ ENDIF:toc
337
+
338
+ IF:methods
339
+ <div class="sectiontitle">Methods</div>
340
+ <ul>
341
+ START:methods
342
+ <li>HREF:aref:name:</li>
343
+ END:methods
344
+ </ul>
345
+ ENDIF:methods
346
+
347
+ IF:includes
348
+ <div class="sectiontitle">Included Modules</div>
349
+ <ul>
350
+ START:includes
351
+ <li>HREF:aref:name:</li>
352
+ END:includes
353
+ </ul>
354
+ ENDIF:includes
355
+
356
+ START:sections
357
+ IF:sectitle
358
+ <div class="sectiontitle"><a nem="%secsequence%">%sectitle%</a></div>
359
+ IF:seccomment
360
+ <div class="description">
361
+ %seccomment%
362
+ </div>
363
+ ENDIF:seccomment
364
+ ENDIF:sectitle
365
+
366
+ IF:classlist
367
+ <div class="sectiontitle">Classes and Modules</div>
368
+ %classlist%
369
+ ENDIF:classlist
370
+
371
+ IF:constants
372
+ <div class="sectiontitle">Constants</div>
373
+ <table border='0' cellpadding='5'>
374
+ START:constants
375
+ <tr valign='top'>
376
+ <td class="attr-name">%name%</td>
377
+ <td>=</td>
378
+ <td class="attr-value">%value%</td>
379
+ </tr>
380
+ IF:desc
381
+ <tr valign='top'>
382
+ <td>&nbsp;</td>
383
+ <td colspan="2" class="attr-desc">%desc%</td>
384
+ </tr>
385
+ ENDIF:desc
386
+ END:constants
387
+ </table>
388
+ ENDIF:constants
389
+
390
+ IF:attributes
391
+ <div class="sectiontitle">Attributes</div>
392
+ <table border='0' cellpadding='5'>
393
+ START:attributes
394
+ <tr valign='top'>
395
+ <td class='attr-rw'>
396
+ IF:rw
397
+ [%rw%]
398
+ ENDIF:rw
399
+ </td>
400
+ <td class='attr-name'>%name%</td>
401
+ <td class='attr-desc'>%a_desc%</td>
402
+ </tr>
403
+ END:attributes
404
+ </table>
405
+ ENDIF:attributes
406
+
407
+ IF:method_list
408
+ START:method_list
409
+ IF:methods
410
+ <div class="sectiontitle">%type% %category% methods</div>
411
+ START:methods
412
+ <div class="method">
413
+ <div class="title">
414
+ IF:callseq
415
+ <a name="%aref%"></a><b>%callseq%</b>
416
+ ENDIF:callseq
417
+ IFNOT:callseq
418
+ <a name="%aref%"></a><b>%name%</b>%params%
419
+ ENDIF:callseq
420
+ IF:codeurl
421
+ [ <a href="javascript:openCode('%codeurl%')">source</a> ]
422
+ ENDIF:codeurl
423
+ </div>
424
+ IF:m_desc
425
+ <div class="description">
426
+ %m_desc%
427
+ </div>
428
+ ENDIF:m_desc
429
+ IF:aka
430
+ <div class="aka">
431
+ This method is also aliased as
432
+ START:aka
433
+ <a href="%aref%">%name%</a>
434
+ END:aka
435
+ </div>
436
+ ENDIF:aka
437
+ IF:sourcecode
438
+ <div class="sourcecode">
439
+ <p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p>
440
+ <div id="%aref%_source" class="dyn-source">
441
+ <pre>
442
+ %sourcecode%
443
+ </pre>
444
+ </div>
445
+ </div>
446
+ ENDIF:sourcecode
447
+ </div>
448
+ END:methods
449
+ ENDIF:methods
450
+ END:method_list
451
+ ENDIF:method_list
452
+ END:sections
453
+ </div>
454
+ HTML
455
+
456
+ FOOTER = <<ENDFOOTER
457
+ </body>
458
+ </html>
459
+ ENDFOOTER
460
+
461
+ BODY = HEADER + <<ENDBODY
462
+ !INCLUDE! <!-- banner header -->
463
+
464
+ <div id="bodyContent">
465
+ #{METHOD_LIST}
466
+ </div>
467
+
468
+ #{FOOTER}
469
+ ENDBODY
470
+
471
+ ########################## Source code ##########################
472
+
473
+ SRC_PAGE = XHTML_PREAMBLE + <<HTML
474
+ <html>
475
+ <head><title>%title%</title>
476
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
477
+ <style>
478
+ .ruby-comment { color: green; font-style: italic }
479
+ .ruby-constant { color: #4433aa; font-weight: bold; }
480
+ .ruby-identifier { color: #222222; }
481
+ .ruby-ivar { color: #2233dd; }
482
+ .ruby-keyword { color: #3333FF; font-weight: bold }
483
+ .ruby-node { color: #777777; }
484
+ .ruby-operator { color: #111111; }
485
+ .ruby-regexp { color: #662222; }
486
+ .ruby-value { color: #662222; font-style: italic }
487
+ .kw { color: #3333FF; font-weight: bold }
488
+ .cmt { color: green; font-style: italic }
489
+ .str { color: #662222; font-style: italic }
490
+ .re { color: #662222; }
491
+ </style>
492
+ </head>
493
+ <body bgcolor="white">
494
+ <pre>%code%</pre>
495
+ </body>
496
+ </html>
497
+ HTML
498
+
499
+ ########################## Index ################################
500
+
501
+ FR_INDEX_BODY = <<HTML
502
+ !INCLUDE!
503
+ HTML
504
+
505
+ FILE_INDEX = XHTML_PREAMBLE + <<HTML
506
+ <html>
507
+ <head>
508
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
509
+ <style>
510
+ <!--
511
+ body {
512
+ background-color: #EEE;
513
+ font-family: #{FONTS};
514
+ color: #000;
515
+ margin: 0px;
516
+ }
517
+ .banner {
518
+ background: #005;
519
+ color: #FFF;
520
+ padding: 0.2em;
521
+ font-size: small;
522
+ font-weight: bold;
523
+ text-align: center;
524
+ }
525
+ .entries {
526
+ margin: 0.25em 1em 0 1em;
527
+ font-size: x-small;
528
+ }
529
+ a {
530
+ color: #00F;
531
+ text-decoration: none;
532
+ white-space: nowrap;
533
+ }
534
+ a:hover {
535
+ color: #77F;
536
+ text-decoration: underline;
537
+ }
538
+ -->
539
+ </style>
540
+ <base target="docwin">
541
+ </head>
542
+ <body>
543
+ <div class="banner">%list_title%</div>
544
+ <div class="entries">
545
+ START:entries
546
+ <a href="%href%">%name%</a><br>
547
+ END:entries
548
+ </div>
549
+ </body></html>
550
+ HTML
551
+
552
+ CLASS_INDEX = FILE_INDEX
553
+ METHOD_INDEX = FILE_INDEX
554
+
555
+ INDEX = XHTML_PREAMBLE + <<HTML
556
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
557
+ <head>
558
+ <title>%title%</title>
559
+ <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
560
+ </head>
561
+
562
+ <frameset cols="20%,*">
563
+ <frameset rows="15%,35%,50%">
564
+ <frame src="fr_file_index.html" title="Files" name="Files" />
565
+ <frame src="fr_class_index.html" name="Classes" />
566
+ <frame src="fr_method_index.html" name="Methods" />
567
+ </frameset>
568
+ IF:inline_source
569
+ <frame src="%initial_page%" name="docwin">
570
+ ENDIF:inline_source
571
+ IFNOT:inline_source
572
+ <frameset rows="80%,20%">
573
+ <frame src="%initial_page%" name="docwin">
574
+ <frame src="blank.html" name="source">
575
+ </frameset>
576
+ ENDIF:inline_source
577
+ <noframes>
578
+ <body bgcolor="white">
579
+ Click <a href="html/index.html">here</a> for a non-frames
580
+ version of this page.
581
+ </body>
582
+ </noframes>
583
+ </frameset>
584
+
585
+ </html>
586
+ HTML
587
+
588
+ end
589
+ end
590
+
591
+