dm-mapping 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  tmp*
2
+ pkg
data/CHANGES CHANGED
@@ -1,5 +1,11 @@
1
1
  = dm-mapper changes history
2
2
 
3
+ == dm-mapping 0.2.1, 2008-08-03
4
+
5
+ * fixed a bug that type map should lookup for parent.
6
+ * fixed a bug that sql type could be lower case.
7
+ fixed by calling upcase.
8
+
3
9
  == dm-mapping 0.2.0, 2008-08-02
4
10
 
5
11
  * added Sqlite3Adapter::Migration#fields
data/NOTICE CHANGED
@@ -1,5 +1,9 @@
1
1
  = notice for other stuffs
2
2
 
3
- * this project skeleton is built through Mr Bones 2.0.3:
4
- gem install bones
3
+ * dm-mapping is a plugin of DataMapper
4
+ > sudo gem install dm-core
5
+ http://datamapper.org
6
+
7
+ * this project skeleton is built through Mr Bones
8
+ > sudo gem install bones
5
9
  http://codeforpeople.rubyforge.org/bones/
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = dm-mapping 0.2.0
1
+ = dm-mapping 0.2.1
2
2
  by Lin Jen-Shin (a.k.a. godfat-真常[http://godfat.org])
3
3
  strip any number: 18god29fat7029 (at] godfat32 -dooot- 20org
4
4
 
@@ -6,7 +6,8 @@ by Lin Jen-Shin (a.k.a. godfat-真常[http://godfat.org])
6
6
 
7
7
  == DESCRIPTION:
8
8
 
9
- placeholder
9
+ DataMapper plugin that helps you manipulate an existing database.
10
+ It creates mappings between existing columns and model's properties.
10
11
 
11
12
  == FEATURES:
12
13
 
@@ -60,7 +61,7 @@ placeholder
60
61
 
61
62
  == INSTALL:
62
63
 
63
- * sudo gem install dm-mapping
64
+ > sudo gem install dm-mapping
64
65
 
65
66
  == LICENSE:
66
67
 
data/Rakefile CHANGED
@@ -35,7 +35,7 @@ PROJ.url = 'http://github.com/godfat/dm-mapping'
35
35
  PROJ.description = PROJ.summary = paragraphs_of('README', 'description').join("\n\n")
36
36
  PROJ.changes = paragraphs_of('CHANGES', 0..1).join("\n\n")
37
37
  PROJ.rubyforge.name = 'ludy'
38
- PROJ.version = paragraphs_of('README', 0).first.split("\n").first.split(' ').last
38
+ PROJ.version = File.open('lib/dm-mapping/version.rb', 0){ |f| f.read.gsub(/.*VERSION = "(.*)".*/m, '\1') }
39
39
 
40
40
  PROJ.gem.dependencies << 'dm-core'
41
41
  # PROJ.gem.executables = []
data/TODO CHANGED
@@ -1,5 +1,9 @@
1
1
  = dm-mapping todo list
2
2
 
3
- * DataMapper::Resource#mapping
4
- * DataMapper::Resource#storage_fields
5
- * DataMapper.repository.storages_and_fields
3
+ * o DataMapper::Resource#mapping
4
+ * o DataMapper::Resource#storage_fields
5
+ * x DataMapper.repository.storages_and_fields
6
+
7
+ * o Mapping::All
8
+ * Mapping::String
9
+ * Mapping::Integer
data/dm-mapping.gemspec CHANGED
@@ -1,22 +1,22 @@
1
1
 
2
2
  Gem::Specification.new do |s|
3
3
  s.name = %q{dm-mapping}
4
- s.version = "0.1.0"
4
+ s.version = "0.2.1"
5
5
 
6
6
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
7
7
  s.authors = ["Lin Jen-Shin (a.k.a. godfat \347\234\237\345\270\270)"]
8
- s.date = %q{2008-07-27}
9
- s.description = %q{placeholder}
8
+ s.date = %q{2008-08-03}
9
+ s.description = %q{DataMapper plugin that helps you manipulate an existing database. It creates mappings between existing columns and model's properties.}
10
10
  s.email = %q{strip any number: 18god29fat7029 (at] godfat32 -dooot- 20org}
11
- s.extra_rdoc_files = ["CHANGES", "LICENSE", "NOTICE", "README", "tasks/ann.rake", "tasks/bones.rake", "tasks/gem.rake", "tasks/git.rake", "tasks/manifest.rake", "tasks/notes.rake", "tasks/post_load.rake", "tasks/rdoc.rake", "tasks/rubyforge.rake", "tasks/spec.rake", "tasks/svn.rake", "tasks/test.rake"]
12
- s.files = ["CHANGES", "LICENSE", "Manifest", "NOTICE", "README", "Rakefile", "lib/dm-mapping.rb", "lib/dm-mapping/sqlite3adapter.rb", "lib/dm-mapping/version.rb", "tasks/ann.rake", "tasks/bones.rake", "tasks/gem.rake", "tasks/git.rake", "tasks/manifest.rake", "tasks/notes.rake", "tasks/post_load.rake", "tasks/rdoc.rake", "tasks/rubyforge.rake", "tasks/setup.rb", "tasks/spec.rake", "tasks/svn.rake", "tasks/test.rake", "test/test_dm-mapping.rb"]
11
+ s.extra_rdoc_files = [".gitignore", "CHANGES", "LICENSE", "NOTICE", "README", "TODO", "dm-mapping.gemspec", "tasks/ann.rake", "tasks/bones.rake", "tasks/gem.rake", "tasks/git.rake", "tasks/manifest.rake", "tasks/notes.rake", "tasks/post_load.rake", "tasks/rdoc.rake", "tasks/rubyforge.rake", "tasks/spec.rake", "tasks/svn.rake", "tasks/test.rake"]
12
+ s.files = [".gitignore", "CHANGES", "LICENSE", "NOTICE", "README", "Rakefile", "TODO", "dm-mapping.gemspec", "lib/dm-mapping.rb", "lib/dm-mapping/adapters/sqlite3adapter.rb", "lib/dm-mapping/model.rb", "lib/dm-mapping/type_map.rb", "lib/dm-mapping/version.rb", "tasks/ann.rake", "tasks/bones.rake", "tasks/gem.rake", "tasks/git.rake", "tasks/manifest.rake", "tasks/notes.rake", "tasks/post_load.rake", "tasks/rdoc.rake", "tasks/rubyforge.rake", "tasks/setup.rb", "tasks/spec.rake", "tasks/svn.rake", "tasks/test.rake", "test/test_dm-mapping.rb"]
13
13
  s.has_rdoc = true
14
14
  s.homepage = %q{http://github.com/godfat/dm-mapping}
15
15
  s.rdoc_options = ["--diagram", "--charset=utf-8", "--inline-source", "--line-numbers", "--promiscuous", "--main", "README"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{ludy}
18
18
  s.rubygems_version = %q{1.2.0}
19
- s.summary = %q{placeholder}
19
+ s.summary = %q{DataMapper plugin that helps you manipulate an existing database. It creates mappings between existing columns and model's properties.}
20
20
  s.test_files = ["test/test_dm-mapping.rb"]
21
21
 
22
22
  if s.respond_to? :specification_version then
@@ -22,7 +22,7 @@ module DataMapper
22
22
  def fields table
23
23
  query_table(table).map{ |field|
24
24
  type, chain = self.class.type_map.
25
- find_primitive(field.type.gsub(/\(\d+\)/, ''))
25
+ find_primitive(field.type.gsub(/\(\d+\)/, '').upcase)
26
26
 
27
27
  # stupid hack
28
28
  type = String if type == Class
@@ -4,7 +4,7 @@ module DataMapper
4
4
  def find_primitive primitive, type_map = self
5
5
  type_map.chains.find{ |type, chain|
6
6
  primitive == chain.primitive
7
- } or find_primitive(primitive, parent)
7
+ } or find_primitive(primitive, type_map.parent)
8
8
  end
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
2
  module Mapping
3
- VERSION = "0.2.0" unless defined?(DataMapper::Mapping::VERSION)
3
+ VERSION = "0.2.1" unless defined?(DataMapper::Mapping::VERSION)
4
4
  end
5
5
  end
data/lib/dm-mapping.rb CHANGED
@@ -17,6 +17,10 @@ module DataMapper
17
17
  def storages
18
18
  raise NotImplementedError
19
19
  end
20
+
21
+ def fields storage
22
+ raise NotImplementedError
23
+ end
20
24
  end
21
25
  end
22
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-mapping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Lin Jen-Shin (a.k.a. godfat \xE7\x9C\x9F\xE5\xB8\xB8)"
@@ -22,7 +22,7 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: "0"
24
24
  version:
25
- description: placeholder
25
+ description: DataMapper plugin that helps you manipulate an existing database. It creates mappings between existing columns and model's properties.
26
26
  email: "strip any number: 18god29fat7029 (at] godfat32 -dooot- 20org"
27
27
  executables: []
28
28
 
@@ -107,6 +107,6 @@ rubyforge_project: ludy
107
107
  rubygems_version: 1.2.0
108
108
  signing_key:
109
109
  specification_version: 2
110
- summary: placeholder
110
+ summary: DataMapper plugin that helps you manipulate an existing database. It creates mappings between existing columns and model's properties.
111
111
  test_files:
112
112
  - test/test_dm-mapping.rb