What have you found for these years?

2008-08-04

[ANN] dm-mapping 0.4.0

dm-mapping version 0.4.0
by Lin Jen-Shin (a.k.a. godfat 真常)
http://github.com/godfat/dm-mapping

== DESCRIPTION

DataMapper plugin that helps you manipulate an existing database.
It creates mappings between existing columns and model's properties.

== CHANGES

=== dm-mapping 0.4.0, 2008-08-04
* added Migration#auto_genclass!.
* updated README.
* added more rdoc.

== LINKS

* rdoc[http://ludy.rubyforge.org/dm-mapping]
* github-project[http://github.com/godfat/dm-mapping]
* rubyforge-project[http://rubyforge.org/projects/ludy]

== SYNOPSIS

require 'dm-mapping'
dm = DataMapper.setup :default, 'sqlite3:db/development.sqlite3'

dm.object_id == DataMapper.repository.adapter.object_id
# => true

class User
include DataMapper::Resource
# maping all
mapping /.*/

# mapping for ended with _at, and started with salt_
mapping /_at$/, /^salt_/

# mapping id and email
mapping :id, :email

# mapping all fields with type String, and id
mapping String, :id

# mapping login, and all fields with type Integer
mapping :login, Integer
end

# there's no guarantee of the order in storages array
dm.storages
# => ['users']

# there's no guarantee of the order in fields array
User.fields.sort
# => [['created_at', DateTime, {}],
['email', String, {:default => 'nospam@nospam.tw'}],
['id', Integer, {:serial => true}],
['salt_first', String, {}],
['salt_second', String, {}]]

dm.fields('users').sort == User.fields.sort
# => true

dm.storages_and_fields
# => {'users' => [['id', Integer, {:serial => true}],
['email', String, {:default => 'nospam@nospam.tw'}],
['created_at', DateTime, {}],
['salt_first', String, {}],
['salt_second', String, {}]]}

# there's no guarantee of the order in returned array
dm.auto_genclass!
# => [DataMapper::Mapping::User,
DataMapper::Mapping::SchemaInfo,
DataMapper::Mapping::Session]

# you can change the scope of generated models:
dm.auto_genclass! Object
# => [User, SchemaInfo, Session]

== REQUIREMENTS

* dm-core 0.9.3

== INSTALL

> sudo gem install dm-mapping

== LICENSE

Apache License 2.0

Copyright (c) 2008, Lin Jen-Shin (a.k.a. godfat 真常)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

7 retries:

Hinoris said...

借我記錄一下小說寫景:

綠葉搖擺枝柯裡,鈴聲徜徉樹林間,
霧水濡濕山邊路,微風輕挑美溪澗。

回去再修改。

Lin Jen-Shin (godfat) said...

不瞞您說,除非很閒,不然看到寫景的文字,我 95% 會跳掉 @@

Lin Jen-Shin (godfat) said...

臭爛 msn
http://summer2008.blog.roodo.com

Plumm said...

> 不然看到寫景的文字,我 95% 會跳掉 @@
其實寫景好壞差很多,跳過有點不利,就像看程式跳過註解一樣呀。

> http://summer2008.blog.roodo.com
這個和 MSN 有什咩關??

Lin Jen-Shin (godfat) said...

註解我也不太看啊,有需要才會看
source code would say anything

因為 msn 一直沒辦法傳出那個網址
大概被擋了

老林 said...


再離題一下, 來板上討論一下事情吧
我對 gameplay 調整做了一些測試
你對測試結果說點想法吧 @_@

Lin Jen-Shin (godfat) said...

已回

Post a Comment

Note: Only a member of this blog may post a comment.



All texts are licensed under CC Attribution 3.0