happymapper 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{README → README.rdoc} +2 -8
- data/Rakefile +32 -28
- data/lib/happymapper.rb +3 -7
- data/lib/happymapper/version.rb +1 -1
- data/spec/spec_helper.rb +2 -9
- metadata +47 -39
- data/HOW_TO_RELEASE +0 -5
- data/History +0 -59
- data/Manifest +0 -42
- data/TODO +0 -0
- data/happymapper.gemspec +0 -34
- data/website/css/common.css +0 -47
- data/website/index.html +0 -98
data/{README → README.rdoc}
RENAMED
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
== DESCRIPTION:
|
4
4
|
|
5
|
-
Object to xml mapping library. I have included examples to help get you going. The specs
|
6
|
-
should also point you in the right direction.
|
5
|
+
Object to xml mapping library. I have included examples to help get you going. The specs should also point you in the right direction.
|
7
6
|
|
8
7
|
== FEATURES:
|
9
8
|
|
@@ -49,12 +48,7 @@ http://github.com/jnunemaker/happymapper/tree/master/examples/
|
|
49
48
|
|
50
49
|
== INSTALL:
|
51
50
|
|
52
|
-
*
|
53
|
-
* sudo gem install happymapper (when rubyforge approves and i release there)
|
54
|
-
|
55
|
-
== TICKETS:
|
56
|
-
|
57
|
-
http://github.com/jnunemaker/happymapper/issues/
|
51
|
+
* gem install happymapper
|
58
52
|
|
59
53
|
== DOCS:
|
60
54
|
|
data/Rakefile
CHANGED
@@ -1,43 +1,47 @@
|
|
1
|
-
ProjectName = 'happymapper'
|
2
|
-
WebsitePath = "jnunemaker@rubyforge.org:/var/www/gforge-projects/#{ProjectName}"
|
3
|
-
|
4
1
|
require 'rubygems'
|
5
2
|
require 'rake'
|
6
|
-
require '
|
3
|
+
require 'rake/rdoctask'
|
7
4
|
require 'spec/rake/spectask'
|
8
|
-
require
|
5
|
+
require File.expand_path('../lib/happymapper/version', __FILE__)
|
6
|
+
|
7
|
+
Spec::Rake::SpecTask.new do |t|
|
8
|
+
t.ruby_opts << '-rubygems'
|
9
|
+
t.verbose = true
|
10
|
+
end
|
11
|
+
task :default => :spec
|
12
|
+
|
13
|
+
desc 'Builds the gem'
|
14
|
+
task :build do
|
15
|
+
sh "gem build happymapper.gemspec"
|
16
|
+
end
|
9
17
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
desc 'Builds and installs the gem'
|
19
|
+
task :install => :build do
|
20
|
+
sh "gem install happymapper-#{HappyMapper::Version}"
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Tags version, pushes to remote, and pushes gem'
|
24
|
+
task :release => :build do
|
25
|
+
sh "git tag v#{HappyMapper::Version}"
|
26
|
+
sh "git push origin master"
|
27
|
+
sh "git push origin v#{HappyMapper::Version}"
|
28
|
+
sh "gem push bin-#{HappyMapper::Version}.gem"
|
19
29
|
end
|
20
30
|
|
21
31
|
desc 'Upload website files to rubyforge'
|
22
32
|
task :website do
|
23
|
-
sh %{rsync -av website/
|
33
|
+
sh %{rsync -av website/ jnunemaker@rubyforge.org:/var/www/gforge-projects/happymapper}
|
24
34
|
Rake::Task['website_docs'].invoke
|
25
35
|
end
|
26
36
|
|
27
37
|
task :website_docs do
|
28
|
-
Rake::Task['
|
29
|
-
sh %{rsync -av doc/
|
30
|
-
end
|
31
|
-
|
32
|
-
desc 'Preps the gem for a new release'
|
33
|
-
task :prepare do
|
34
|
-
%w[manifest build_gemspec].each do |task|
|
35
|
-
Rake::Task[task].invoke
|
36
|
-
end
|
38
|
+
Rake::Task['rerdoc'].invoke
|
39
|
+
sh %{rsync -av doc/ jnunemaker@rubyforge.org:/var/www/gforge-projects/happymapper/docs}
|
37
40
|
end
|
38
41
|
|
39
|
-
Rake::
|
40
|
-
|
41
|
-
|
42
|
-
|
42
|
+
Rake::RDocTask.new do |r|
|
43
|
+
r.title = 'HappyMapper Docs'
|
44
|
+
r.main = 'README.rdoc'
|
45
|
+
r.rdoc_dir = 'doc'
|
46
|
+
r.rdoc_files.include("README.rdoc", "lib/**/*.rb")
|
43
47
|
end
|
data/lib/happymapper.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
dir = File.dirname(__FILE__)
|
2
|
-
|
3
1
|
require 'date'
|
4
2
|
require 'time'
|
5
|
-
require 'rubygems'
|
6
|
-
gem 'libxml-ruby', '= 1.1.3'
|
7
3
|
require 'xml'
|
8
4
|
|
9
5
|
class Boolean; end
|
@@ -114,6 +110,6 @@ module HappyMapper
|
|
114
110
|
end
|
115
111
|
end
|
116
112
|
|
117
|
-
require
|
118
|
-
require
|
119
|
-
require
|
113
|
+
require 'happymapper/item'
|
114
|
+
require 'happymapper/attribute'
|
115
|
+
require 'happymapper/element'
|
data/lib/happymapper/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
rescue LoadError
|
4
|
-
require 'rubygems'
|
5
|
-
gem 'rspec'
|
6
|
-
require 'spec'
|
7
|
-
end
|
8
|
-
|
9
|
-
require File.join(File.dirname(__FILE__), '..', 'lib', 'happymapper')
|
1
|
+
require 'spec'
|
2
|
+
require File.expand_path('../../lib/happymapper', __FILE__)
|
10
3
|
|
11
4
|
def fixture_file(filename)
|
12
5
|
File.read(File.dirname(__FILE__) + "/fixtures/#{filename}")
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: happymapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- John Nunemaker
|
@@ -9,33 +14,46 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-06-18 00:00:00 -04:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: libxml-ruby
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
|
-
- -
|
25
|
+
- - ~>
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 1
|
30
|
+
- 3
|
23
31
|
version: 1.1.3
|
24
|
-
|
25
|
-
|
26
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rspec
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 3
|
44
|
+
- 0
|
45
|
+
version: 1.3.0
|
46
|
+
type: :development
|
47
|
+
version_requirements: *id002
|
48
|
+
description:
|
49
|
+
email:
|
50
|
+
- nunemaker@gmail.com
|
27
51
|
executables: []
|
28
52
|
|
29
53
|
extensions: []
|
30
54
|
|
31
|
-
extra_rdoc_files:
|
32
|
-
|
33
|
-
- lib/happymapper/element.rb
|
34
|
-
- lib/happymapper/item.rb
|
35
|
-
- lib/happymapper/version.rb
|
36
|
-
- lib/happymapper.rb
|
37
|
-
- README
|
38
|
-
- TODO
|
55
|
+
extra_rdoc_files: []
|
56
|
+
|
39
57
|
files:
|
40
58
|
- examples/amazon.rb
|
41
59
|
- examples/current_weather.rb
|
@@ -43,18 +61,11 @@ files:
|
|
43
61
|
- examples/multi_street_address.rb
|
44
62
|
- examples/post.rb
|
45
63
|
- examples/twitter.rb
|
46
|
-
- happymapper.gemspec
|
47
|
-
- History
|
48
|
-
- HOW_TO_RELEASE
|
49
64
|
- lib/happymapper/attribute.rb
|
50
65
|
- lib/happymapper/element.rb
|
51
66
|
- lib/happymapper/item.rb
|
52
67
|
- lib/happymapper/version.rb
|
53
68
|
- lib/happymapper.rb
|
54
|
-
- License
|
55
|
-
- Manifest
|
56
|
-
- Rakefile
|
57
|
-
- README
|
58
69
|
- spec/fixtures/address.xml
|
59
70
|
- spec/fixtures/analytics.xml
|
60
71
|
- spec/fixtures/commit.xml
|
@@ -76,39 +87,36 @@ files:
|
|
76
87
|
- spec/happymapper_spec.rb
|
77
88
|
- spec/spec.opts
|
78
89
|
- spec/spec_helper.rb
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
90
|
+
- License
|
91
|
+
- Rakefile
|
92
|
+
- README.rdoc
|
82
93
|
has_rdoc: true
|
83
94
|
homepage: http://happymapper.rubyforge.org
|
84
95
|
licenses: []
|
85
96
|
|
86
|
-
post_install_message:
|
87
|
-
rdoc_options:
|
88
|
-
|
89
|
-
- --inline-source
|
90
|
-
- --title
|
91
|
-
- Happymapper
|
92
|
-
- --main
|
93
|
-
- README
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
|
94
100
|
require_paths:
|
95
101
|
- lib
|
96
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
103
|
requirements:
|
98
104
|
- - ">="
|
99
105
|
- !ruby/object:Gem::Version
|
106
|
+
segments:
|
107
|
+
- 0
|
100
108
|
version: "0"
|
101
|
-
version:
|
102
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
110
|
requirements:
|
104
111
|
- - ">="
|
105
112
|
- !ruby/object:Gem::Version
|
106
|
-
|
107
|
-
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
108
116
|
requirements: []
|
109
117
|
|
110
118
|
rubyforge_project: happymapper
|
111
|
-
rubygems_version: 1.3.
|
119
|
+
rubygems_version: 1.3.6
|
112
120
|
signing_key:
|
113
121
|
specification_version: 3
|
114
122
|
summary: object to xml mapping library
|
data/HOW_TO_RELEASE
DELETED
data/History
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
== 0.2.5
|
2
|
-
* 1 minor tweak
|
3
|
-
* Classes can now be strings instead of constants so you don't have to worry about class definition order (this was all for technicalpickles, enjoy!)
|
4
|
-
|
5
|
-
== 0.2.4
|
6
|
-
* 1 minor tweak
|
7
|
-
* Added a patch that allows even crazy namespaces to work
|
8
|
-
|
9
|
-
== 0.2.3
|
10
|
-
* 1 minor tweak
|
11
|
-
* bumped the version of libxml-ruby to 1.1.3
|
12
|
-
|
13
|
-
== 0.2.2
|
14
|
-
* 2 minor tweaks
|
15
|
-
* removed GC.start (libxml recommended this) as setting nodes to nil should be enough, specs run 3-4x faster (Brandon Keepers)
|
16
|
-
* renamed get_tag_name to tag_name (Brandon Keepers)
|
17
|
-
* removed libxml helpers as they are no longer needed
|
18
|
-
|
19
|
-
== 0.2.1
|
20
|
-
* 1 minor fix, 3 major enhancements
|
21
|
-
* fixed warnings about using XML::Parser (mojodna)
|
22
|
-
* Improved namespace support, now handles multiple namespaces and allows namespaces to be set item wide or on a per element basis (mojodna)
|
23
|
-
* Auto detect root nodes (mojodna)
|
24
|
-
* Type coercion (mojodna)
|
25
|
-
|
26
|
-
== 0.2.0
|
27
|
-
* 1 major enhancement, 2 minor ehancements
|
28
|
-
* Automatic handling of namespaces (part by Robert Lowrey and rest by John Nunemaker)
|
29
|
-
* Added :root option to tag method. This allows setting an object as the root element, which sets xpath to use / and sets single to true
|
30
|
-
* Now defaulting tag names for classes in modules to last constant downcased
|
31
|
-
|
32
|
-
== 0.1.7 2009-01-29
|
33
|
-
* 1 minor enhancement
|
34
|
-
* Support dashes in elements (Josh Nichols)
|
35
|
-
|
36
|
-
== 0.1.6 2009-01-17
|
37
|
-
* 1 minor enhancement:
|
38
|
-
* added support for nested collection elements (Justin Marney)
|
39
|
-
|
40
|
-
== 0.1.5 2009-01-05
|
41
|
-
* 1 major enhancement:
|
42
|
-
* Updated to latest version of libxml-ruby (lightningdb)
|
43
|
-
|
44
|
-
== 0.1.4 2009-01-05
|
45
|
-
* 1 major enhancement:
|
46
|
-
* Fixed parsing when the object is the root node. (Garret Alfert)
|
47
|
-
|
48
|
-
== 0.1.3 2008-12-31
|
49
|
-
* 1 major enhancement:
|
50
|
-
* Added parsing of attributes of elements that are also mapped, see current_weather.rb for example (jeremyf)
|
51
|
-
|
52
|
-
== 0.1.2 2008-12-12
|
53
|
-
* 1 major enhancement:
|
54
|
-
* Fixed that :deep only worked for first item (dvrensk)
|
55
|
-
|
56
|
-
== 0.1.0 2008-11-16
|
57
|
-
|
58
|
-
* 1 major enhancement:
|
59
|
-
* Initial release
|
data/Manifest
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
examples/amazon.rb
|
2
|
-
examples/current_weather.rb
|
3
|
-
examples/dashed_elements.rb
|
4
|
-
examples/multi_street_address.rb
|
5
|
-
examples/post.rb
|
6
|
-
examples/twitter.rb
|
7
|
-
happymapper.gemspec
|
8
|
-
History
|
9
|
-
HOW_TO_RELEASE
|
10
|
-
lib/happymapper/attribute.rb
|
11
|
-
lib/happymapper/element.rb
|
12
|
-
lib/happymapper/item.rb
|
13
|
-
lib/happymapper/version.rb
|
14
|
-
lib/happymapper.rb
|
15
|
-
License
|
16
|
-
Manifest
|
17
|
-
Rakefile
|
18
|
-
README
|
19
|
-
spec/fixtures/address.xml
|
20
|
-
spec/fixtures/analytics.xml
|
21
|
-
spec/fixtures/commit.xml
|
22
|
-
spec/fixtures/current_weather.xml
|
23
|
-
spec/fixtures/family_tree.xml
|
24
|
-
spec/fixtures/multi_street_address.xml
|
25
|
-
spec/fixtures/multiple_namespaces.xml
|
26
|
-
spec/fixtures/nested_namespaces.xml
|
27
|
-
spec/fixtures/pita.xml
|
28
|
-
spec/fixtures/posts.xml
|
29
|
-
spec/fixtures/product_default_namespace.xml
|
30
|
-
spec/fixtures/product_no_namespace.xml
|
31
|
-
spec/fixtures/product_single_namespace.xml
|
32
|
-
spec/fixtures/radar.xml
|
33
|
-
spec/fixtures/statuses.xml
|
34
|
-
spec/happymapper_attribute_spec.rb
|
35
|
-
spec/happymapper_element_spec.rb
|
36
|
-
spec/happymapper_item_spec.rb
|
37
|
-
spec/happymapper_spec.rb
|
38
|
-
spec/spec.opts
|
39
|
-
spec/spec_helper.rb
|
40
|
-
TODO
|
41
|
-
website/css/common.css
|
42
|
-
website/index.html
|
data/TODO
DELETED
File without changes
|
data/happymapper.gemspec
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{happymapper}
|
5
|
-
s.version = "0.3.0"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["John Nunemaker"]
|
9
|
-
s.date = %q{2009-10-04}
|
10
|
-
s.description = %q{object to xml mapping library}
|
11
|
-
s.email = %q{nunemaker@gmail.com}
|
12
|
-
s.extra_rdoc_files = ["lib/happymapper/attribute.rb", "lib/happymapper/element.rb", "lib/happymapper/item.rb", "lib/happymapper/version.rb", "lib/happymapper.rb", "README", "TODO"]
|
13
|
-
s.files = ["examples/amazon.rb", "examples/current_weather.rb", "examples/dashed_elements.rb", "examples/multi_street_address.rb", "examples/post.rb", "examples/twitter.rb", "happymapper.gemspec", "History", "HOW_TO_RELEASE", "lib/happymapper/attribute.rb", "lib/happymapper/element.rb", "lib/happymapper/item.rb", "lib/happymapper/version.rb", "lib/happymapper.rb", "License", "Manifest", "Rakefile", "README", "spec/fixtures/address.xml", "spec/fixtures/analytics.xml", "spec/fixtures/commit.xml", "spec/fixtures/current_weather.xml", "spec/fixtures/family_tree.xml", "spec/fixtures/multi_street_address.xml", "spec/fixtures/multiple_namespaces.xml", "spec/fixtures/nested_namespaces.xml", "spec/fixtures/pita.xml", "spec/fixtures/posts.xml", "spec/fixtures/product_default_namespace.xml", "spec/fixtures/product_no_namespace.xml", "spec/fixtures/product_single_namespace.xml", "spec/fixtures/radar.xml", "spec/fixtures/statuses.xml", "spec/happymapper_attribute_spec.rb", "spec/happymapper_element_spec.rb", "spec/happymapper_item_spec.rb", "spec/happymapper_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "TODO", "website/css/common.css", "website/index.html"]
|
14
|
-
s.homepage = %q{http://happymapper.rubyforge.org}
|
15
|
-
s.post_install_message = %q{May you have many happy mappings!}
|
16
|
-
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Happymapper", "--main", "README"]
|
17
|
-
s.require_paths = ["lib"]
|
18
|
-
s.rubyforge_project = %q{happymapper}
|
19
|
-
s.rubygems_version = %q{1.3.5}
|
20
|
-
s.summary = %q{object to xml mapping library}
|
21
|
-
|
22
|
-
if s.respond_to? :specification_version then
|
23
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
-
s.specification_version = 3
|
25
|
-
|
26
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_runtime_dependency(%q<libxml-ruby>, ["= 1.1.3"])
|
28
|
-
else
|
29
|
-
s.add_dependency(%q<libxml-ruby>, ["= 1.1.3"])
|
30
|
-
end
|
31
|
-
else
|
32
|
-
s.add_dependency(%q<libxml-ruby>, ["= 1.1.3"])
|
33
|
-
end
|
34
|
-
end
|
data/website/css/common.css
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
@media screen, projection {
|
2
|
-
/*
|
3
|
-
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
|
4
|
-
Code licensed under the BSD License:
|
5
|
-
http://developer.yahoo.net/yui/license.txt
|
6
|
-
version: 2.2.0
|
7
|
-
*/
|
8
|
-
body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
|
9
|
-
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}/*ol,ul {list-style:none;}*/caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
|
10
|
-
/* end of yahoo reset and fonts */
|
11
|
-
|
12
|
-
body {color:#333; background:#4b1a1a; line-height:1.3;}
|
13
|
-
p {margin:0 0 20px;}
|
14
|
-
a {color:#4b1a1a;}
|
15
|
-
a:hover {text-decoration:none;}
|
16
|
-
strong {font-weight:bold;}
|
17
|
-
em {font-style:italics;}
|
18
|
-
h1,h2,h3,h4,h5,h6 {font-weight:bold;}
|
19
|
-
h1 {font-size:197%; margin:30px 0; color:#4b1a1a;}
|
20
|
-
h2 {font-size:174%; margin:20px 0; color:#b8111a;}
|
21
|
-
h3 {font-size:152%; margin:10px 0;}
|
22
|
-
h4 {font-size:129%; margin:10px 0;}
|
23
|
-
pre {background:#eee; margin:0 0 20px; padding:20px; border:1px solid #ccc; font-size:100%; overflow:auto;}
|
24
|
-
code {font-size:100%; margin:0; padding:0;}
|
25
|
-
ul, ol {margin:10px 0 10px 25px;}
|
26
|
-
ol li {margin:0 0 10px;}
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
div#wrapper {background:#fff; width:560px; margin:0 auto; padding:20px; border:10px solid #bc8c46; border-width:0 10px;}
|
33
|
-
div#header {position:relative; border-bottom:1px dotted; margin:0 0 10px; padding:0 0 10px;}
|
34
|
-
div#header p {margin:0; padding:0;}
|
35
|
-
div#header h1 {margin:0; padding:0;}
|
36
|
-
ul#nav {position:absolute; top:0; right:0; list-style:none; margin:0; padding:0;}
|
37
|
-
ul#nav li {display:inline; padding:0 0 0 5px;}
|
38
|
-
ul#nav li a {}
|
39
|
-
div#content {}
|
40
|
-
div#footer {margin:40px 0 0; border-top:1px dotted; padding:10px 0 0;}
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
}
|
data/website/index.html
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
5
|
-
<title>HappyMapper by John Nunemaker</title>
|
6
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
7
|
-
</head>
|
8
|
-
<body>
|
9
|
-
|
10
|
-
<div id="wrapper">
|
11
|
-
<div id="header">
|
12
|
-
<h1>HappyMapper</h1>
|
13
|
-
<p>Object to xml mapping library.</p>
|
14
|
-
|
15
|
-
<ul id="nav">
|
16
|
-
<li><a href="rdoc/">Docs</a></li>
|
17
|
-
<li><a href="http://github.com/jnunemaker/happymapper">Github</a></li>
|
18
|
-
<li><a href="http://jnunemaker.lighthouseapp.com/projects/20014-happy-mapper/overview">Lighthouse</a></li>
|
19
|
-
<li><a href="http://rubyforge.org/projects/happymapper/">Rubyforge</a></li>
|
20
|
-
</ul>
|
21
|
-
</div>
|
22
|
-
|
23
|
-
<div id="content">
|
24
|
-
<h2>Install</h2>
|
25
|
-
<pre><code>$ sudo gem install happymapper</code></pre>
|
26
|
-
|
27
|
-
<h2>Examples</h2>
|
28
|
-
|
29
|
-
<h3>Given the following xml:</h3>
|
30
|
-
<pre><code><statuses type="array">
|
31
|
-
<status>
|
32
|
-
<created_at>Sat Aug 09 05:38:12 +0000 2008</created_at>
|
33
|
-
<id>882281424</id>
|
34
|
-
<text>I so just thought the guy lighting the Olympic torch was falling when he began to run on the wall. Wow that would have been catastrophic.</text>
|
35
|
-
<source>web</source>
|
36
|
-
<truncated>false</truncated>
|
37
|
-
<in_reply_to_status_id>1234</in_reply_to_status_id>
|
38
|
-
<in_reply_to_user_id>12345</in_reply_to_user_id>
|
39
|
-
<favorited></favorited>
|
40
|
-
<user>
|
41
|
-
<id>4243</id>
|
42
|
-
<name>John Nunemaker</name>
|
43
|
-
<screen_name>jnunemaker</screen_name>
|
44
|
-
<location>Mishawaka, IN, US</location>
|
45
|
-
<description>Loves his wife, ruby, notre dame football and iu basketball</description>
|
46
|
-
<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg</profile_image_url>
|
47
|
-
<url>http://addictedtonew.com</url>
|
48
|
-
<protected>false</protected>
|
49
|
-
<followers_count>486</followers_count>
|
50
|
-
</user>
|
51
|
-
</status>
|
52
|
-
</statuses></code></pre>
|
53
|
-
|
54
|
-
<h3>You could have the following objects:</h3>
|
55
|
-
|
56
|
-
<pre><code>class User
|
57
|
-
include HappyMapper
|
58
|
-
|
59
|
-
element :id, Integer
|
60
|
-
element :name, String
|
61
|
-
element :screen_name, String
|
62
|
-
element :location, String
|
63
|
-
element :description, String
|
64
|
-
element :profile_image_url, String
|
65
|
-
element :url, String
|
66
|
-
element :protected, Boolean
|
67
|
-
element :followers_count, Integer
|
68
|
-
end
|
69
|
-
|
70
|
-
class Status
|
71
|
-
include HappyMapper
|
72
|
-
|
73
|
-
element :id, Integer
|
74
|
-
element :text, String
|
75
|
-
element :created_at, Time
|
76
|
-
element :source, String
|
77
|
-
element :truncated, Boolean
|
78
|
-
element :in_reply_to_status_id, Integer
|
79
|
-
element :in_reply_to_user_id, Integer
|
80
|
-
element :favorited, Boolean
|
81
|
-
has_one :user, User
|
82
|
-
end
|
83
|
-
|
84
|
-
statuses = Status.parse(file_contents)
|
85
|
-
statuses.each do |status|
|
86
|
-
puts status.user.name, status.user.screen_name, status.text, status.source, ''
|
87
|
-
end</code></pre>
|
88
|
-
|
89
|
-
<h2>Support</h2>
|
90
|
-
<p>Conversations welcome in the <a href="http://groups.google.com/group/happymapper">google group</a> and bugs/features over at <a href="http://github.com/jnunemaker/happymapper/issues/">Github</a>.</p>
|
91
|
-
</div>
|
92
|
-
|
93
|
-
<div id="footer">
|
94
|
-
<p>Created by <a href="http://addictedtonew.com/about/">John Nunemaker</a></p>
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
</body>
|
98
|
-
</html>
|