Changeset 19232

Show
Ignore:
Timestamp:
09/12/08 18:21:18 (4 months ago)
Author:
authorNari
Message:

type columns. add head.

Location:
lang/ruby/ymldot
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ymldot/README

    r19163 r19232  
    33== Description 
    44 
    5 Can describe ERD in a form of ".yml". 
    6 ERD method use IDEF1X. (see http://www.idef.com/IDEF1x.html) 
    7 ".yml" file to ".dot" file. ".dot" is a language used in "graphviz". 
     5 Can describe ERD in a form of ".yml". 
     6 ERD method use IDEF1X. 
     7 ".yml" file to ".dot" file. ".dot" is a language used in "graphviz". 
    88 
    99== Installation 
    1010(1) if not install graphviz, type following. 
    11     $ apt-get install graphviz 
     11*  $ apt-get install graphviz 
    1212(2) get ymldot. 
    13     $ gem install ymldot 
     13*  $ gem install ymldot 
    1414 
    1515== Option 
     
    2020* config 
    2121  * font 
    22     Please set the font name that You want to use. 
     22    * Please set the font name that You want to use. 
    2323* tables 
    2424  * name 
    25     table name 
     25    * table name 
    2626  * columns 
    27     enumerate column names 
     27    * enumerate column names 
    2828  * foreginkeys 
    2929    * has_many 
    3030    * has_one 
    3131    * has_many_and_belongs_to 
    32       same meaning the relation of ActiveRecord. 
    33       enumerate ref table name. 
     32      * same meaning the relation of ActiveRecord. 
     33      * enumerate ref table name. 
    3434    * polymorphic 
    3535      * name 
    3636      * type 
    3737      * tables 
    38         target table name. 
     38        * target table name. 
    3939 
    4040* category 
    4141   * label 
    42      category name set. and set frame. 
     42     * category name set. and set frame. 
    4343   * table 
    44      nested table. 
     44     * nested table. 
    4545 
    4646== Sample 
     
    9191 
    9292* please type 
    93   $ dot -Tpng sample.dot -o sample.png 
     93 $ dot -Tpng sample.dot -o sample.png 
    9494 
    9595== Copyright 
    9696 
    97 Author::    nari <authorNari@gmail.com> 
    98 Copyright:: Copyright (c) 2008 nari 
    99 License::   Ruby's 
     97* Author::    nari <authorNari@gmail.com> 
     98* Copyright:: Copyright (c) 2008 nari 
     99* License::   Ruby's 
     100 
     101== Link 
     102* ((<ymldot-project|URL:http://rubyforge.org/projects/ymldot>)) 
  • lang/ruby/ymldot/lib/ymldot.rb

    r19163 r19232  
    179179    keys.each do |rel| 
    180180      @entity_dict[tname].foreignkeys << "#{rel["name"]}ID(FK)" if key = rel["name"] 
    181       @entity_dict[tname].columns << "#{rel["type"]}(type)" if key = rel["type"] 
     181      @entity_dict[tname].columns.unshift "#{rel["type"]}(type)" if key = rel["type"] 
    182182      rel["tables"].each do |t| 
    183183        @one_relations << {:self => @entity_dict[t], :have => @entity_dict[tname] }