builder 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +107 -0
- data/MIT-LICENSE +20 -0
- data/README.md +258 -0
- data/Rakefile +195 -0
- data/doc/jamis.rb +591 -0
- data/doc/releases/builder-1.2.4.rdoc +31 -0
- data/doc/releases/builder-2.0.0.rdoc +46 -0
- data/doc/releases/builder-2.1.1.rdoc +58 -0
- data/lib/builder/version.rb +1 -1
- data/rakelib/publish.rake +17 -0
- data/rakelib/tags.rake +62 -0
- metadata +36 -39
@@ -0,0 +1,31 @@
|
|
1
|
+
= Builder 1.2.4 Released.
|
2
|
+
|
3
|
+
Added a "CDATA" method to the XML Markup builder (from Josh Knowles).
|
4
|
+
|
5
|
+
== What is Builder?
|
6
|
+
|
7
|
+
Builder::XmlMarkup allows easy programmatic creation of XML markup.
|
8
|
+
For example:
|
9
|
+
|
10
|
+
builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)
|
11
|
+
builder.person { |b| b.name("Jim"); b.phone("555-1234") }
|
12
|
+
puts builder.target!
|
13
|
+
|
14
|
+
will generate:
|
15
|
+
|
16
|
+
<person>
|
17
|
+
<name>Jim</name>
|
18
|
+
<phone>555-1234</phone>
|
19
|
+
</person>
|
20
|
+
|
21
|
+
== Availability
|
22
|
+
|
23
|
+
The easiest way to get and install builder is via RubyGems ...
|
24
|
+
|
25
|
+
gem install builder (you may need root/admin privileges)
|
26
|
+
|
27
|
+
== Thanks
|
28
|
+
|
29
|
+
* Josh Knowles for the cdata! patch.
|
30
|
+
|
31
|
+
-- Jim Weirich
|
@@ -0,0 +1,46 @@
|
|
1
|
+
= Builder 2.0.0 Released.
|
2
|
+
|
3
|
+
== Changes in 2.0.0
|
4
|
+
|
5
|
+
* UTF-8 characters in data are now correctly translated to their XML
|
6
|
+
equivalents. (Thanks to Sam Ruby)
|
7
|
+
|
8
|
+
* Attribute values are now escaped by default. See the README
|
9
|
+
file for details.
|
10
|
+
|
11
|
+
<b>NOTE:</b> The escaping attribute values by default is different
|
12
|
+
than in previous releases of Builder. This makes version 2.0.0
|
13
|
+
somewhat incompatible with the 1.x series of Builder. If you use "&",
|
14
|
+
"<", or ">" in attributes values, you may have to change your
|
15
|
+
code. (Essentially you remove the manual escaping. The new way is
|
16
|
+
easier, believe me).
|
17
|
+
|
18
|
+
== What is Builder?
|
19
|
+
|
20
|
+
Builder::XmlMarkup is a library that allows easy programmatic creation
|
21
|
+
of XML markup. For example:
|
22
|
+
|
23
|
+
builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)
|
24
|
+
builder.person { |b| b.name("Jim"); b.phone("555-1234") }
|
25
|
+
|
26
|
+
will generate:
|
27
|
+
|
28
|
+
<person>
|
29
|
+
<name>Jim</name>
|
30
|
+
<phone>555-1234</phone>
|
31
|
+
</person>
|
32
|
+
|
33
|
+
== Availability
|
34
|
+
|
35
|
+
The easiest way to get and install builder is via RubyGems ...
|
36
|
+
|
37
|
+
gem install builder (you may need root/admin privileges)
|
38
|
+
|
39
|
+
== Thanks
|
40
|
+
|
41
|
+
* Sam Ruby for the XChar module and the related UTF-8 translation
|
42
|
+
tools.
|
43
|
+
* Also to Sam Ruby for gently persuading me to start quoting attribute
|
44
|
+
values.
|
45
|
+
|
46
|
+
-- Jim Weirich
|
@@ -0,0 +1,58 @@
|
|
1
|
+
= Builder 2.1.1 Released.
|
2
|
+
|
3
|
+
Release 2.1.1 of Builder is mainly a bug fix release.
|
4
|
+
|
5
|
+
== Changes in 2.1.1
|
6
|
+
|
7
|
+
* Added <tt>reveal</tt> capability to BlankSlate.
|
8
|
+
|
9
|
+
* Fixed a bug in BlankSlate where including a module into Object could
|
10
|
+
cause methods to leak into BlankSlate.
|
11
|
+
|
12
|
+
* Fixed typo in XmlMarkup class docs (from Martin Fowler).
|
13
|
+
|
14
|
+
* Fixed test on private methods to differentiate between targetted and
|
15
|
+
untargetted private methods.
|
16
|
+
|
17
|
+
* Removed legacy capture of @self in XmlBase (@self was used back when
|
18
|
+
we used instance eval).
|
19
|
+
|
20
|
+
* Added additional tests for global functions (both direct and
|
21
|
+
included).
|
22
|
+
|
23
|
+
* Several misc internal cleanups, including rearranging the source
|
24
|
+
code tree.
|
25
|
+
|
26
|
+
<b>NOTE:</b> The escaping attribute values by default is different
|
27
|
+
than in previous releases of Builder. This makes version 2.0.x
|
28
|
+
somewhat incompatible with the 1.x series of Builder. If you use "&",
|
29
|
+
"<", or ">" in attributes values, you may have to change your
|
30
|
+
code. (Essentially you remove the manual escaping. The new way is
|
31
|
+
easier, believe me).
|
32
|
+
|
33
|
+
== What is Builder?
|
34
|
+
|
35
|
+
Builder::XmlMarkup is a library that allows easy programmatic creation
|
36
|
+
of XML markup. For example:
|
37
|
+
|
38
|
+
builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)
|
39
|
+
builder.person { |b| b.name("Jim"); b.phone("555-1234") }
|
40
|
+
|
41
|
+
will generate:
|
42
|
+
|
43
|
+
<person>
|
44
|
+
<name>Jim</name>
|
45
|
+
<phone>555-1234</phone>
|
46
|
+
</person>
|
47
|
+
|
48
|
+
== Availability
|
49
|
+
|
50
|
+
The easiest way to get and install builder is via RubyGems ...
|
51
|
+
|
52
|
+
gem install builder (you may need root/admin privileges)
|
53
|
+
|
54
|
+
== Thanks
|
55
|
+
|
56
|
+
* Martin Fowler for spotting some typos in the documentation.
|
57
|
+
|
58
|
+
-- Jim Weirich
|
data/lib/builder/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Optional publish task for Rake
|
2
|
+
|
3
|
+
require 'rake/contrib/sshpublisher'
|
4
|
+
require 'rake/contrib/rubyforgepublisher'
|
5
|
+
|
6
|
+
publisher = Rake::CompositePublisher.new
|
7
|
+
publisher.add Rake::RubyForgePublisher.new('builder', 'jimweirich')
|
8
|
+
publisher.add Rake::SshFilePublisher.new(
|
9
|
+
'linode',
|
10
|
+
'htdocs/software/builder',
|
11
|
+
'.',
|
12
|
+
'builder.blurb')
|
13
|
+
|
14
|
+
desc "Publish the Documentation to RubyForge."
|
15
|
+
task :publish => [:rdoc] do
|
16
|
+
publisher.upload
|
17
|
+
end
|
data/rakelib/tags.rake
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
module Tags
|
4
|
+
extend Rake::DSL if defined?(Rake::DSL)
|
5
|
+
|
6
|
+
PROG = ENV['TAGS'] || 'ctags'
|
7
|
+
|
8
|
+
RAKEFILES = FileList['Rakefile', '**/*.rake']
|
9
|
+
|
10
|
+
FILES = FileList['**/*.rb', '**/*.js'] + RAKEFILES
|
11
|
+
FILES.exclude('pkg', 'dist')
|
12
|
+
|
13
|
+
PROJECT_DIR = ['.']
|
14
|
+
|
15
|
+
RVM_GEMDIR = File.join(`rvm gemdir`.strip, "gems")
|
16
|
+
SYSTEM_DIRS = File.exists?(RVM_GEMDIR) ? RVM_GEMDIR : []
|
17
|
+
|
18
|
+
module_function
|
19
|
+
|
20
|
+
# Convert key_word to --key-word.
|
21
|
+
def keyword(key)
|
22
|
+
k = key.to_s.gsub(/_/, '-')
|
23
|
+
(k.length == 1) ? "-#{k}" : "--#{k}"
|
24
|
+
end
|
25
|
+
|
26
|
+
# Run ctags command
|
27
|
+
def run(*args)
|
28
|
+
opts = {
|
29
|
+
:e => true,
|
30
|
+
:totals => true,
|
31
|
+
:recurse => true,
|
32
|
+
}
|
33
|
+
opts = opts.merge(args.pop) if args.last.is_a?(Hash)
|
34
|
+
command_args = opts.map { |k, v|
|
35
|
+
(v == true) ? keyword(k) : "#{keyword(k)}=#{v}"
|
36
|
+
}.join(" ")
|
37
|
+
sh %{#{Tags::PROG} #{command_args} #{args.join(' ')}}
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
namespace "tags" do
|
42
|
+
desc "Generate an Emacs TAGS file"
|
43
|
+
task :emacs, [:all] => Tags::FILES do |t, args|
|
44
|
+
puts "Making Emacs TAGS file"
|
45
|
+
verbose(true) do
|
46
|
+
Tags.run(Tags::PROJECT_DIR)
|
47
|
+
Tags.run(Tags::RAKEFILES,
|
48
|
+
:language_force => "ruby",
|
49
|
+
:append => true)
|
50
|
+
if args.all
|
51
|
+
Tags::SYSTEM_DIRS.each do |dir|
|
52
|
+
Tags.run(dir,
|
53
|
+
:language_force => "ruby",
|
54
|
+
:append => true)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
desc "Generate the TAGS file"
|
62
|
+
task :tags, [:all] => ["tags:emacs"]
|
metadata
CHANGED
@@ -1,38 +1,40 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: builder
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.2.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 3.2.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jim Weirich
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2013-02-23 00:00:00 Z
|
12
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
14
|
+
description: ! 'Builder provides a number of builder objects that make creating structured
|
15
|
+
data
|
20
16
|
|
21
|
-
description: |
|
22
|
-
Builder provides a number of builder objects that make creating structured data
|
23
17
|
simple to do. Currently the following builder objects are supported:
|
24
|
-
|
18
|
+
|
19
|
+
|
25
20
|
* XML Markup
|
21
|
+
|
26
22
|
* XML Events
|
27
23
|
|
24
|
+
'
|
28
25
|
email: jim.weirich@gmail.com
|
29
26
|
executables: []
|
30
|
-
|
31
27
|
extensions: []
|
32
|
-
|
33
28
|
extra_rdoc_files: []
|
34
|
-
|
35
|
-
|
29
|
+
files:
|
30
|
+
- CHANGES
|
31
|
+
- MIT-LICENSE
|
32
|
+
- README.md
|
33
|
+
- Rakefile
|
34
|
+
- doc/jamis.rb
|
35
|
+
- doc/releases/builder-1.2.4.rdoc
|
36
|
+
- doc/releases/builder-2.0.0.rdoc
|
37
|
+
- doc/releases/builder-2.1.1.rdoc
|
36
38
|
- lib/blankslate.rb
|
37
39
|
- lib/builder.rb
|
38
40
|
- lib/builder/blankslate.rb
|
@@ -49,44 +51,39 @@ files:
|
|
49
51
|
- test/test_method_caching.rb
|
50
52
|
- test/test_namecollision.rb
|
51
53
|
- test/test_xchar.rb
|
54
|
+
- rakelib/publish.rake
|
55
|
+
- rakelib/tags.rake
|
52
56
|
homepage: http://onestepback.org
|
53
|
-
licenses:
|
57
|
+
licenses:
|
54
58
|
- MIT
|
55
59
|
post_install_message:
|
56
|
-
rdoc_options:
|
60
|
+
rdoc_options:
|
57
61
|
- --title
|
58
62
|
- Builder -- Easy XML Building
|
59
63
|
- --main
|
60
64
|
- README.rdoc
|
61
65
|
- --line-numbers
|
62
|
-
require_paths:
|
66
|
+
require_paths:
|
63
67
|
- lib
|
64
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
69
|
none: false
|
66
|
-
requirements:
|
67
|
-
- -
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
|
70
|
-
|
71
|
-
- 0
|
72
|
-
version: "0"
|
73
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
75
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
|
79
|
-
segments:
|
80
|
-
- 0
|
81
|
-
version: "0"
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
82
80
|
requirements: []
|
83
|
-
|
84
81
|
rubyforge_project:
|
85
82
|
rubygems_version: 1.8.24
|
86
83
|
signing_key:
|
87
84
|
specification_version: 3
|
88
85
|
summary: Builders for MarkUp.
|
89
|
-
test_files:
|
86
|
+
test_files:
|
90
87
|
- test/test_blankslate.rb
|
91
88
|
- test/test_eventbuilder.rb
|
92
89
|
- test/test_markupbuilder.rb
|