lightningdb-happymapper 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,98 @@
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>&lt;statuses type="array">
31
+ &lt;status>
32
+ &lt;created_at>Sat Aug 09 05:38:12 +0000 2008&lt;/created_at>
33
+ &lt;id>882281424&lt;/id>
34
+ &lt;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.&lt;/text>
35
+ &lt;source>web&lt;/source>
36
+ &lt;truncated>false&lt;/truncated>
37
+ &lt;in_reply_to_status_id>1234&lt;/in_reply_to_status_id>
38
+ &lt;in_reply_to_user_id>12345&lt;/in_reply_to_user_id>
39
+ &lt;favorited>&lt;/favorited>
40
+ &lt;user>
41
+ &lt;id>4243&lt;/id>
42
+ &lt;name>John Nunemaker&lt;/name>
43
+ &lt;screen_name>jnunemaker&lt;/screen_name>
44
+ &lt;location>Mishawaka, IN, US&lt;/location>
45
+ &lt;description>Loves his wife, ruby, notre dame football and iu basketball&lt;/description>
46
+ &lt;profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/53781608/Photo_75_normal.jpg&lt;/profile_image_url>
47
+ &lt;url>http://addictedtonew.com&lt;/url>
48
+ &lt;protected>false&lt;/protected>
49
+ &lt;followers_count>486&lt;/followers_count>
50
+ &lt;/user>
51
+ &lt;/status>
52
+ &lt;/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://jnunemaker.lighthouseapp.com/projects/20014-happy-mapper/overview">Lightouse</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>
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lightningdb-happymapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - John Nunemaker
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-29 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: libxml-ruby
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - "="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.8
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: echoe
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: object to xml mapping library
36
+ email: nunemaker@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - lib/happymapper/attribute.rb
43
+ - lib/happymapper/element.rb
44
+ - lib/happymapper/item.rb
45
+ - lib/happymapper/version.rb
46
+ - lib/happymapper.rb
47
+ - README
48
+ - TODO
49
+ files:
50
+ - examples/amazon.rb
51
+ - examples/current_weather.rb
52
+ - examples/dashed_elements.rb
53
+ - examples/post.rb
54
+ - examples/twitter.rb
55
+ - happymapper.gemspec
56
+ - History
57
+ - lib/happymapper/attribute.rb
58
+ - lib/happymapper/element.rb
59
+ - lib/happymapper/item.rb
60
+ - lib/happymapper/version.rb
61
+ - lib/happymapper.rb
62
+ - License
63
+ - Manifest
64
+ - Rakefile
65
+ - README
66
+ - spec/fixtures/address.xml
67
+ - spec/fixtures/commit.xml
68
+ - spec/fixtures/current_weather.xml
69
+ - spec/fixtures/family_tree.xml
70
+ - spec/fixtures/multiple_namespaces.xml
71
+ - spec/fixtures/pita.xml
72
+ - spec/fixtures/posts.xml
73
+ - spec/fixtures/product_default_namespace.xml
74
+ - spec/fixtures/product_no_namespace.xml
75
+ - spec/fixtures/product_single_namespace.xml
76
+ - spec/fixtures/quarters.xml
77
+ - spec/fixtures/radar.xml
78
+ - spec/fixtures/statuses.xml
79
+ - spec/happymapper_attribute_spec.rb
80
+ - spec/happymapper_element_spec.rb
81
+ - spec/happymapper_item_spec.rb
82
+ - spec/happymapper_spec.rb
83
+ - spec/spec.opts
84
+ - spec/spec_helper.rb
85
+ - TODO
86
+ - website/css/common.css
87
+ - website/index.html
88
+ has_rdoc: true
89
+ homepage: http://happymapper.rubyforge.org
90
+ post_install_message: May you have many happy mappings!
91
+ rdoc_options:
92
+ - --line-numbers
93
+ - --inline-source
94
+ - --title
95
+ - Happymapper
96
+ - --main
97
+ - README
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: "0"
105
+ version:
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: "1.2"
111
+ version:
112
+ requirements: []
113
+
114
+ rubyforge_project: happymapper
115
+ rubygems_version: 1.2.0
116
+ signing_key:
117
+ specification_version: 2
118
+ summary: object to xml mapping library
119
+ test_files: []
120
+