jnunemaker-happymapper 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/{History.txt → History} +8 -0
- data/{License.txt → License} +0 -0
- data/{Manifest.txt → Manifest} +10 -19
- data/{README.txt → README} +0 -0
- data/Rakefile +42 -3
- data/TODO +1 -0
- data/happymapper.gemspec +15 -12
- data/lib/happymapper/version.rb +1 -7
- data/lib/happymapper.rb +12 -2
- data/spec/fixtures/commit.xml +52 -0
- data/spec/fixtures/posts.xml +1 -1
- data/spec/fixtures/radar.xml +21 -0
- data/spec/happymapper_spec.rb +44 -1
- metadata +38 -34
- data/PostInstall.txt +0 -0
- data/TODO.txt +0 -2
- data/config/hoe.rb +0 -73
- data/config/requirements.rb +0 -15
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -82
- data/setup.rb +0 -1585
- data/tasks/deployment.rake +0 -43
- data/tasks/environment.rake +0 -7
- data/tasks/rspec.rake +0 -21
- data/tasks/website.rake +0 -17
data/{History.txt → History}
RENAMED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.1.7 2009-01-29
|
2
|
+
* 1 minor enhancement
|
3
|
+
* Support dashes in elements (Josh Nichols)
|
4
|
+
|
5
|
+
== 0.1.6 2009-01-17
|
6
|
+
* 1 minor enhancement:
|
7
|
+
* added support for nested collection elements (Justin Marney)
|
8
|
+
|
1
9
|
== 0.1.5 2009-01-05
|
2
10
|
* 1 major enhancement:
|
3
11
|
* Updated to latest version of libxml-ruby (lightningdb)
|
data/{License.txt → License}
RENAMED
File without changes
|
data/{Manifest.txt → Manifest}
RENAMED
@@ -1,32 +1,26 @@
|
|
1
|
-
History.txt
|
2
|
-
License.txt
|
3
|
-
Manifest.txt
|
4
|
-
PostInstall.txt
|
5
|
-
README.txt
|
6
|
-
Rakefile
|
7
|
-
TODO.txt
|
8
|
-
config/hoe.rb
|
9
|
-
config/requirements.rb
|
10
1
|
examples/amazon.rb
|
11
2
|
examples/current_weather.rb
|
3
|
+
examples/dashed_elements.rb
|
12
4
|
examples/post.rb
|
13
5
|
examples/twitter.rb
|
14
6
|
happymapper.gemspec
|
15
|
-
|
7
|
+
History
|
16
8
|
lib/happymapper/attribute.rb
|
17
9
|
lib/happymapper/element.rb
|
18
10
|
lib/happymapper/item.rb
|
19
11
|
lib/happymapper/version.rb
|
12
|
+
lib/happymapper.rb
|
20
13
|
lib/libxml_ext/libxml_helper.rb
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
setup.rb
|
14
|
+
License
|
15
|
+
Manifest
|
16
|
+
Rakefile
|
17
|
+
README
|
26
18
|
spec/fixtures/address.xml
|
19
|
+
spec/fixtures/commit.xml
|
27
20
|
spec/fixtures/current_weather.xml
|
28
21
|
spec/fixtures/pita.xml
|
29
22
|
spec/fixtures/posts.xml
|
23
|
+
spec/fixtures/radar.xml
|
30
24
|
spec/fixtures/statuses.xml
|
31
25
|
spec/happymapper_attribute_spec.rb
|
32
26
|
spec/happymapper_element_spec.rb
|
@@ -34,9 +28,6 @@ spec/happymapper_item_spec.rb
|
|
34
28
|
spec/happymapper_spec.rb
|
35
29
|
spec/spec.opts
|
36
30
|
spec/spec_helper.rb
|
37
|
-
|
38
|
-
tasks/environment.rake
|
39
|
-
tasks/rspec.rake
|
40
|
-
tasks/website.rake
|
31
|
+
TODO
|
41
32
|
website/css/common.css
|
42
33
|
website/index.html
|
data/{README.txt → README}
RENAMED
File without changes
|
data/Rakefile
CHANGED
@@ -1,4 +1,43 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
ProjectName = 'happymapper'
|
2
|
+
WebsitePath = "jnunemaker@rubyforge.org:/var/www/gforge-projects/#{ProjectName}"
|
3
3
|
|
4
|
-
|
4
|
+
require 'rubygems'
|
5
|
+
require 'rake'
|
6
|
+
require 'echoe'
|
7
|
+
require 'spec/rake/spectask'
|
8
|
+
require "lib/#{ProjectName}/version"
|
9
|
+
|
10
|
+
Echoe.new(ProjectName, HappyMapper::Version) do |p|
|
11
|
+
p.description = "object to xml mapping library"
|
12
|
+
p.install_message = "May you have many happy mappings!"
|
13
|
+
p.url = "http://#{ProjectName}.rubyforge.org"
|
14
|
+
p.author = "John Nunemaker"
|
15
|
+
p.email = "nunemaker@gmail.com"
|
16
|
+
p.extra_deps = [['libxml-ruby', '>= 0.9.7']]
|
17
|
+
p.need_tar_gz = false
|
18
|
+
p.docs_host = WebsitePath
|
19
|
+
end
|
20
|
+
|
21
|
+
desc 'Upload website files to rubyforge'
|
22
|
+
task :website do
|
23
|
+
sh %{rsync -av website/ #{WebsitePath}}
|
24
|
+
Rake::Task['website_docs'].invoke
|
25
|
+
end
|
26
|
+
|
27
|
+
task :website_docs do
|
28
|
+
Rake::Task['redocs'].invoke
|
29
|
+
sh %{rsync -av doc/ #{WebsitePath}/docs}
|
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
|
37
|
+
end
|
38
|
+
|
39
|
+
Rake::Task[:default].prerequisites.clear
|
40
|
+
task :default => :spec
|
41
|
+
Spec::Rake::SpecTask.new do |t|
|
42
|
+
t.spec_files = FileList["spec/**/*_spec.rb"]
|
43
|
+
end
|
data/TODO
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* doesn't do xml namespaces really (does work with default namespace though)
|
data/happymapper.gemspec
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{happymapper}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.7"
|
6
6
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">=
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["John Nunemaker"]
|
9
|
-
s.date = %q{2009-01-
|
9
|
+
s.date = %q{2009-01-28}
|
10
10
|
s.description = %q{object to xml mapping library}
|
11
|
-
s.email =
|
12
|
-
s.extra_rdoc_files = ["
|
13
|
-
s.files = ["
|
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", "lib/libxml_ext/libxml_helper.rb", "README", "TODO"]
|
13
|
+
s.files = ["examples/amazon.rb", "examples/current_weather.rb", "examples/post.rb", "examples/twitter.rb", "happymapper.gemspec", "History", "lib/happymapper/attribute.rb", "lib/happymapper/element.rb", "lib/happymapper/item.rb", "lib/happymapper/version.rb", "lib/happymapper.rb", "lib/libxml_ext/libxml_helper.rb", "License", "Manifest", "Rakefile", "README", "spec/fixtures/address.xml", "spec/fixtures/commit.xml", "spec/fixtures/current_weather.xml", "spec/fixtures/pita.xml", "spec/fixtures/posts.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
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://happymapper.rubyforge.org}
|
16
|
-
s.post_install_message = %q{}
|
17
|
-
s.rdoc_options = ["--main", "README
|
16
|
+
s.post_install_message = %q{May you have many happy mappings!}
|
17
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Happymapper", "--main", "README"]
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
s.rubyforge_project = %q{happymapper}
|
20
20
|
s.rubygems_version = %q{1.3.1}
|
@@ -25,11 +25,14 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.specification_version = 2
|
26
26
|
|
27
27
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
28
|
-
s.
|
28
|
+
s.add_runtime_dependency(%q<libxml-ruby>, [">= 0.9.7"])
|
29
|
+
s.add_development_dependency(%q<echoe>, [">= 0"])
|
29
30
|
else
|
30
|
-
s.add_dependency(%q<
|
31
|
+
s.add_dependency(%q<libxml-ruby>, [">= 0.9.7"])
|
32
|
+
s.add_dependency(%q<echoe>, [">= 0"])
|
31
33
|
end
|
32
34
|
else
|
33
|
-
s.add_dependency(%q<
|
35
|
+
s.add_dependency(%q<libxml-ruby>, [">= 0.9.7"])
|
36
|
+
s.add_dependency(%q<echoe>, [">= 0"])
|
34
37
|
end
|
35
|
-
end
|
38
|
+
end
|
data/lib/happymapper/version.rb
CHANGED
data/lib/happymapper.rb
CHANGED
@@ -99,13 +99,15 @@ module HappyMapper
|
|
99
99
|
def create_collection(nodes, namespace=nil)
|
100
100
|
nodes.inject([]) do |acc, el|
|
101
101
|
obj = new
|
102
|
-
attributes.each { |attr| obj.send("#{attr.name}=", attr.from_xml_node(el)) }
|
103
|
-
elements.each { |elem| obj.send("#{elem.name}=", elem.from_xml_node(el, namespace)) }
|
102
|
+
attributes.each { |attr| obj.send("#{normalize_name attr.name}=", attr.from_xml_node(el)) }
|
103
|
+
elements.each { |elem| obj.send("#{normalize_name elem.name}=", elem.from_xml_node(el, namespace)) }
|
104
104
|
acc << obj
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
108
|
def create_getter(name)
|
109
|
+
name = normalize_name(name)
|
110
|
+
|
109
111
|
class_eval <<-EOS, __FILE__, __LINE__
|
110
112
|
def #{name}
|
111
113
|
@#{name}
|
@@ -114,6 +116,8 @@ module HappyMapper
|
|
114
116
|
end
|
115
117
|
|
116
118
|
def create_setter(name)
|
119
|
+
name = normalize_name(name)
|
120
|
+
|
117
121
|
class_eval <<-EOS, __FILE__, __LINE__
|
118
122
|
def #{name}=(value)
|
119
123
|
@#{name} = value
|
@@ -122,9 +126,15 @@ module HappyMapper
|
|
122
126
|
end
|
123
127
|
|
124
128
|
def create_accessor(name)
|
129
|
+
name = normalize_name(name)
|
130
|
+
|
125
131
|
create_getter(name)
|
126
132
|
create_setter(name)
|
127
133
|
end
|
134
|
+
|
135
|
+
def normalize_name(name)
|
136
|
+
name.gsub('-', '_')
|
137
|
+
end
|
128
138
|
end
|
129
139
|
end
|
130
140
|
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<commit>
|
3
|
+
<removed type="array">
|
4
|
+
<removed>
|
5
|
+
<filename>commands.rb</filename>
|
6
|
+
</removed>
|
7
|
+
<removed>
|
8
|
+
<filename>helpers.rb</filename>
|
9
|
+
</removed>
|
10
|
+
</removed>
|
11
|
+
<added type="array">
|
12
|
+
<added>
|
13
|
+
<filename>commands/commands.rb</filename>
|
14
|
+
</added>
|
15
|
+
<added>
|
16
|
+
<filename>commands/helpers.rb</filename>
|
17
|
+
</added>
|
18
|
+
</added>
|
19
|
+
<message>move commands.rb and helpers.rb into commands/ dir</message>
|
20
|
+
<modified type="array">
|
21
|
+
<modified>
|
22
|
+
<diff>@@ -56,7 +56,7 @@ module GitHub
|
23
|
+
end
|
24
|
+
|
25
|
+
def load(file)
|
26
|
+
- file[0] == ?/ ? super : super(BasePath + "/#{file}")
|
27
|
+
+ file[0] == ?/ ? super : super(BasePath + "/commands/#{file}")
|
28
|
+
end
|
29
|
+
|
30
|
+
def debug(*messages)</diff>
|
31
|
+
<filename>lib/github.rb</filename>
|
32
|
+
</modified>
|
33
|
+
</modified>
|
34
|
+
<parents type="array">
|
35
|
+
<parent>
|
36
|
+
<id>d462d2a2e60438ded3dd9e8e6593ca4146c5a0ba</id>
|
37
|
+
</parent>
|
38
|
+
</parents>
|
39
|
+
<url>http://github.com/defunkt/github-gem/commit/c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b</url>
|
40
|
+
<author>
|
41
|
+
<name>Chris Wanstrath</name>
|
42
|
+
<email>chris@ozmm.org</email>
|
43
|
+
</author>
|
44
|
+
<id>c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b</id>
|
45
|
+
<committed-date>2008-03-02T16:45:41-08:00</committed-date>
|
46
|
+
<authored-date>2008-03-02T16:45:41-08:00</authored-date>
|
47
|
+
<tree>28a1a1ca3e663d35ba8bf07d3f1781af71359b76</tree>
|
48
|
+
<committer>
|
49
|
+
<name>Chris Wanstrath</name>
|
50
|
+
<email>chris@ozmm.org</email>
|
51
|
+
</committer>
|
52
|
+
</commit>
|
data/spec/fixtures/posts.xml
CHANGED
@@ -20,4 +20,4 @@
|
|
20
20
|
<post href="http://codeclimber.blogspot.com/2008/06/using-ruby-for-imap-with-gmail.html" hash="33bbf2492beac5fbf1fc167014060067" description="CodeClimber: using Ruby for IMAP with Gmail" tag="email gems gmail google imap rails railstips ruby" time="2008-07-05T20:06:47Z" others="118" extended="how to check gmail using ruby's IMAP libraries. the key is to use the login method instead of the authenticate one."/>
|
21
21
|
<post href="http://xullicious.blogspot.com/2008/07/updated-curb-multi-interface-patch.html" hash="f95dcc012bdc13bc26bace3ceed10656" description="Xul for thought: Updated curb multi interface patch" tag="curl ruby http" time="2008-07-03T21:52:45Z" others="1" extended="Really cool multi curl stuff to rapidly hit urls."/>
|
22
22
|
</posts>
|
23
|
-
<!-- fe04.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 9 00:20:11 PDT 2008 -->
|
23
|
+
<!-- fe04.api.del.ac4.yahoo.net uncompressed/chunked Sat Aug 9 00:20:11 PDT 2008 -->
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<radars>
|
3
|
+
<radar>
|
4
|
+
<places>
|
5
|
+
<place>
|
6
|
+
<name>Store</name>
|
7
|
+
</place>
|
8
|
+
</places>
|
9
|
+
</radar>
|
10
|
+
<radar></radar>
|
11
|
+
<radar>
|
12
|
+
<places>
|
13
|
+
<place>
|
14
|
+
<name>Work</name>
|
15
|
+
</place>
|
16
|
+
<place>
|
17
|
+
<name>Home</name>
|
18
|
+
</place>
|
19
|
+
</places>
|
20
|
+
</radar>
|
21
|
+
</radars>
|
data/spec/happymapper_spec.rb
CHANGED
@@ -89,6 +89,20 @@ module PITA
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
+
module GitHub
|
93
|
+
class Commit
|
94
|
+
include HappyMapper
|
95
|
+
|
96
|
+
tag "commit"
|
97
|
+
|
98
|
+
element :url, String
|
99
|
+
element :tree, String
|
100
|
+
element :message, String
|
101
|
+
element :id, String
|
102
|
+
element :'committed-date', Date
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
92
106
|
describe HappyMapper do
|
93
107
|
|
94
108
|
describe "being included into another class" do
|
@@ -112,6 +126,12 @@ describe HappyMapper do
|
|
112
126
|
}.should change(Foo, :attributes)
|
113
127
|
end
|
114
128
|
|
129
|
+
it "should allow adding an attribute containing a dash" do
|
130
|
+
lambda {
|
131
|
+
Foo.attribute :'bar-baz', String
|
132
|
+
}.should change(Foo, :attributes)
|
133
|
+
end
|
134
|
+
|
115
135
|
it "should be able to get all attributes in array" do
|
116
136
|
Foo.attribute :name, String
|
117
137
|
Foo.attributes.size.should == 1
|
@@ -122,6 +142,13 @@ describe HappyMapper do
|
|
122
142
|
Foo.element :name, String
|
123
143
|
}.should change(Foo, :elements)
|
124
144
|
end
|
145
|
+
|
146
|
+
it "should allow adding an element containing a dash" do
|
147
|
+
lambda {
|
148
|
+
Foo.element :'bar-baz', String
|
149
|
+
}.should change(Foo, :elements)
|
150
|
+
|
151
|
+
end
|
125
152
|
|
126
153
|
it "should be able to get all elements in array" do
|
127
154
|
Foo.element(:name, String)
|
@@ -291,4 +318,20 @@ describe HappyMapper do
|
|
291
318
|
@third.places[1].name.should == 'Home'
|
292
319
|
end
|
293
320
|
end
|
294
|
-
|
321
|
+
|
322
|
+
describe "#parse (with xml that has elements with dashes in them)" do
|
323
|
+
before do
|
324
|
+
file_contents = File.read(File.dirname(__FILE__) + '/fixtures/commit.xml')
|
325
|
+
@commit = GitHub::Commit.parse(file_contents).first
|
326
|
+
end
|
327
|
+
|
328
|
+
it "should properly create objects" do
|
329
|
+
@commit.message.should == "move commands.rb and helpers.rb into commands/ dir"
|
330
|
+
@commit.url.should == "http://github.com/defunkt/github-gem/commit/c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b"
|
331
|
+
@commit.id.should == "c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b"
|
332
|
+
@commit.committed_date.should == Date.parse("2008-03-02T16:45:41-08:00")
|
333
|
+
@commit.tree.should == "28a1a1ca3e663d35ba8bf07d3f1781af71359b76"
|
334
|
+
end
|
335
|
+
|
336
|
+
end
|
337
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jnunemaker-happymapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
@@ -9,62 +9,65 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-28 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: libxml-ruby
|
17
17
|
version_requirement:
|
18
18
|
version_requirements: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 0.9.7
|
23
|
+
version:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
name: echoe
|
26
|
+
version_requirement:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: "0"
|
23
32
|
version:
|
24
33
|
description: object to xml mapping library
|
25
|
-
email:
|
26
|
-
- nunemaker@gmail.com
|
34
|
+
email: nunemaker@gmail.com
|
27
35
|
executables: []
|
28
36
|
|
29
37
|
extensions: []
|
30
38
|
|
31
39
|
extra_rdoc_files:
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
40
|
+
- lib/happymapper/attribute.rb
|
41
|
+
- lib/happymapper/element.rb
|
42
|
+
- lib/happymapper/item.rb
|
43
|
+
- lib/happymapper/version.rb
|
44
|
+
- lib/happymapper.rb
|
45
|
+
- lib/libxml_ext/libxml_helper.rb
|
46
|
+
- README
|
47
|
+
- TODO
|
38
48
|
files:
|
39
|
-
- History.txt
|
40
|
-
- License.txt
|
41
|
-
- Manifest.txt
|
42
|
-
- PostInstall.txt
|
43
|
-
- README.txt
|
44
|
-
- Rakefile
|
45
|
-
- TODO.txt
|
46
|
-
- config/hoe.rb
|
47
|
-
- config/requirements.rb
|
48
49
|
- examples/amazon.rb
|
49
50
|
- examples/current_weather.rb
|
50
51
|
- examples/post.rb
|
51
52
|
- examples/twitter.rb
|
52
53
|
- happymapper.gemspec
|
53
|
-
-
|
54
|
+
- History
|
54
55
|
- lib/happymapper/attribute.rb
|
55
56
|
- lib/happymapper/element.rb
|
56
57
|
- lib/happymapper/item.rb
|
57
58
|
- lib/happymapper/version.rb
|
59
|
+
- lib/happymapper.rb
|
58
60
|
- lib/libxml_ext/libxml_helper.rb
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
- setup.rb
|
61
|
+
- License
|
62
|
+
- Manifest
|
63
|
+
- Rakefile
|
64
|
+
- README
|
64
65
|
- spec/fixtures/address.xml
|
66
|
+
- spec/fixtures/commit.xml
|
65
67
|
- spec/fixtures/current_weather.xml
|
66
68
|
- spec/fixtures/pita.xml
|
67
69
|
- spec/fixtures/posts.xml
|
70
|
+
- spec/fixtures/radar.xml
|
68
71
|
- spec/fixtures/statuses.xml
|
69
72
|
- spec/happymapper_attribute_spec.rb
|
70
73
|
- spec/happymapper_element_spec.rb
|
@@ -72,18 +75,19 @@ files:
|
|
72
75
|
- spec/happymapper_spec.rb
|
73
76
|
- spec/spec.opts
|
74
77
|
- spec/spec_helper.rb
|
75
|
-
-
|
76
|
-
- tasks/environment.rake
|
77
|
-
- tasks/rspec.rake
|
78
|
-
- tasks/website.rake
|
78
|
+
- TODO
|
79
79
|
- website/css/common.css
|
80
80
|
- website/index.html
|
81
81
|
has_rdoc: true
|
82
82
|
homepage: http://happymapper.rubyforge.org
|
83
|
-
post_install_message:
|
83
|
+
post_install_message: May you have many happy mappings!
|
84
84
|
rdoc_options:
|
85
|
+
- --line-numbers
|
86
|
+
- --inline-source
|
87
|
+
- --title
|
88
|
+
- Happymapper
|
85
89
|
- --main
|
86
|
-
- README
|
90
|
+
- README
|
87
91
|
require_paths:
|
88
92
|
- lib
|
89
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -96,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
100
|
requirements:
|
97
101
|
- - ">="
|
98
102
|
- !ruby/object:Gem::Version
|
99
|
-
version: "
|
103
|
+
version: "1.2"
|
100
104
|
version:
|
101
105
|
requirements: []
|
102
106
|
|
data/PostInstall.txt
DELETED
File without changes
|
data/TODO.txt
DELETED
data/config/hoe.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'happymapper/version'
|
2
|
-
|
3
|
-
AUTHOR = 'John Nunemaker' # can also be an array of Authors
|
4
|
-
EMAIL = "nunemaker@gmail.com"
|
5
|
-
DESCRIPTION = "object to xml mapping library"
|
6
|
-
GEM_NAME = 'happymapper' # what ppl will type to install your gem
|
7
|
-
RUBYFORGE_PROJECT = 'happymapper' # The unix name for your project
|
8
|
-
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
|
-
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
|
-
EXTRA_DEPENDENCIES = [
|
11
|
-
['libxml-ruby', '>= 0.9.7']
|
12
|
-
]
|
13
|
-
|
14
|
-
@config_file = "~/.rubyforge/user-config.yml"
|
15
|
-
@config = nil
|
16
|
-
RUBYFORGE_USERNAME = "unknown"
|
17
|
-
def rubyforge_username
|
18
|
-
unless @config
|
19
|
-
begin
|
20
|
-
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
21
|
-
rescue
|
22
|
-
puts <<-EOS
|
23
|
-
ERROR: No rubyforge config file found: #{@config_file}
|
24
|
-
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
25
|
-
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
26
|
-
EOS
|
27
|
-
exit
|
28
|
-
end
|
29
|
-
end
|
30
|
-
RUBYFORGE_USERNAME.replace @config["username"]
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
REV = nil
|
35
|
-
# UNCOMMENT IF REQUIRED:
|
36
|
-
# REV = YAML.load(`svn info`)['Revision']
|
37
|
-
VERS = HappyMapper::VERSION::STRING + (REV ? ".#{REV}" : "")
|
38
|
-
RDOC_OPTS = ['--quiet', '--title', 'happymapper documentation',
|
39
|
-
"--opname", "index.html",
|
40
|
-
"--line-numbers",
|
41
|
-
"--main", "README",
|
42
|
-
"--inline-source"]
|
43
|
-
|
44
|
-
class Hoe
|
45
|
-
def extra_deps
|
46
|
-
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
47
|
-
@extra_deps
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# Generate all the Rake tasks
|
52
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
53
|
-
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
54
|
-
p.developer(AUTHOR, EMAIL)
|
55
|
-
p.description = DESCRIPTION
|
56
|
-
p.summary = DESCRIPTION
|
57
|
-
p.url = HOMEPATH
|
58
|
-
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
59
|
-
p.test_globs = ["test/**/test_*.rb"]
|
60
|
-
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
61
|
-
|
62
|
-
# == Optional
|
63
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
64
|
-
#p.extra_deps = EXTRA_DEPENDENCIES
|
65
|
-
|
66
|
-
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
67
|
-
end
|
68
|
-
|
69
|
-
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
70
|
-
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
71
|
-
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
72
|
-
$hoe.rsync_args = '-av --delete --ignore-errors'
|
73
|
-
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
data/config/requirements.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
include FileUtils
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
-
begin
|
7
|
-
require req_gem
|
8
|
-
rescue LoadError
|
9
|
-
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
-
puts "Installation: gem install #{req_gem} -y"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
data/script/console
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r #{File.dirname(__FILE__) + '/../lib/happymapper.rb'}"
|
9
|
-
puts "Loading happymapper gem"
|
10
|
-
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/generate'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|