sqld4r 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data.tar.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ ��������ٿ�g��<&�_� J�xQ�)B5�#.���{1#͉��)
2
+ =14��<�y.4����_���\�LbX�\�ʲ8�n�5�l���Z�� �-&����v��H�^��3Z�`87(���Ή��S_� ��ӗ�p��4�E���8 S�� �����u�� �
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ nbproject
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ == 0.0.1 2008-06-20
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
data/License.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Yusuke Ohmichi(maimuzo)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Manifest.txt ADDED
@@ -0,0 +1,37 @@
1
+ .gitignore
2
+ History.txt
3
+ License.txt
4
+ Manifest.txt
5
+ PostInstall.txt
6
+ README.txt
7
+ Rakefile
8
+ bin/sqld4r
9
+ config/hoe.rb
10
+ config/requirements.rb
11
+ lib/sqld4r.rb
12
+ lib/sqld4r/er2.xml
13
+ lib/sqld4r/sqld4r_core.rb
14
+ lib/sqld4r/sqld4r_options.rb
15
+ lib/sqld4r/sqld4r_parser.rb
16
+ lib/sqld4r/version.rb
17
+ nbproject/private/config.properties
18
+ nbproject/private/private.properties
19
+ nbproject/project.properties
20
+ nbproject/project.xml
21
+ script/console
22
+ script/destroy
23
+ script/generate
24
+ script/txt2html
25
+ setup.rb
26
+ spec/spec.opts
27
+ spec/spec_helper.rb
28
+ spec/sqld4r_spec.rb
29
+ tasks/deployment.rake
30
+ tasks/environment.rake
31
+ tasks/rspec.rake
32
+ tasks/website.rake
33
+ website/index.html
34
+ website/index.txt
35
+ website/javascripts/rounded_corners_lite.inc.js
36
+ website/stylesheets/screen.css
37
+ website/template.html.erb
data/PostInstall.txt ADDED
@@ -0,0 +1,27 @@
1
+ 1. Set environment valiable.
2
+
3
+ $ export SQLD4R_CONF=~/.sqld4r
4
+
5
+ - Default is $HOME/.sqld4r
6
+
7
+ 2. Create config file.
8
+
9
+ $ sqld4r --init
10
+
11
+ 3. Modify default values.
12
+
13
+ $ vi ~/.sqld4r
14
+
15
+ 4. Test for setting
16
+
17
+ $ sqld4r --check
18
+
19
+ 5. Generate migration files and model files from SQLDesigner xml file.
20
+
21
+ $ cd your-rails-root
22
+ $ sqld4r /path/to/SQLDesigner.xml
23
+
24
+ For more information on sqld4r, see http://sqld4r.rubyforge.org
25
+
26
+
27
+
data/README.txt ADDED
@@ -0,0 +1,52 @@
1
+ = sqld4r
2
+
3
+ * http://sqld4r.rubyforge.org/
4
+
5
+ == DESCRIPTION:
6
+
7
+ The sqld4r is model generator for SQLDesigner(http://ondras.zarovi.cz/sql/demo/).
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ * generate migration files and model files from SQLDesigner xml file.
12
+
13
+ == SYNOPSIS:
14
+
15
+ Usage: sqld4r SQLDesigner_xml_path [options]
16
+ Usage: sqld4r --init [options]
17
+ Usage: sqld4r --check [options]
18
+
19
+
20
+ == REQUIREMENTS:
21
+
22
+ * activesupport ver 2.1.0
23
+ (I checked this version only)
24
+
25
+ == INSTALL:
26
+
27
+ * gem install sqld4r
28
+
29
+ == LICENSE:
30
+
31
+ (The MIT License)
32
+
33
+ Copyright (c) 2008 Yusuke Ohmichi(maimuzo)
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining
36
+ a copy of this software and associated documentation files (the
37
+ 'Software'), to deal in the Software without restriction, including
38
+ without limitation the rights to use, copy, modify, merge, publish,
39
+ distribute, sublicense, and/or sell copies of the Software, and to
40
+ permit persons to whom the Software is furnished to do so, subject to
41
+ the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be
44
+ included in all copies or substantial portions of the Software.
45
+
46
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
47
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
48
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
49
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
50
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
51
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
52
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require 'config/requirements'
2
+ require 'config/hoe' # setup Hoe + all gem configuration
3
+
4
+ Dir['tasks/**/*.rake'].each { |rake| load rake }
data/bin/sqld4r ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created by Yusuke Ohmichi(maimuzo) on 2008-6-20.
4
+ # Copyright (c) 2008. All rights reserved.
5
+
6
+ begin
7
+ require 'rubygems'
8
+ rescue LoadError
9
+ # no rubygems to load, so we fail silently
10
+ end
11
+ require 'sqld4r'
12
+
13
+ options = Sqld4r_options.new.parse
14
+ # Create an instance and run it
15
+ Sqld4r_core.new( options ).run
data/config/hoe.rb ADDED
@@ -0,0 +1,73 @@
1
+ require 'sqld4r/version'
2
+
3
+ AUTHOR = 'Yusuke Ohmichi(maimuzo)' # can also be an array of Authors
4
+ EMAIL = "maimuzo@gmail.com"
5
+ DESCRIPTION = "The sqld4r is model generator for SQLDesigner(http://ondras.zarovi.cz/sql/demo/)."
6
+ GEM_NAME = 'sqld4r' # what ppl will type to install your gem
7
+ RUBYFORGE_PROJECT = 'sqld4r' # 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
+ ['activesupport', '>= 2.1.0']
12
+ ] # An array of rubygem dependencies [name, version]
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 = Sqld4r::VERSION::STRING + (REV ? ".#{REV}" : "")
38
+ RDOC_OPTS = ['--quiet', '--title', 'sqld4r 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 ""
@@ -0,0 +1,15 @@
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/lib/sqld4r.rb ADDED
@@ -0,0 +1,11 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ require File.dirname(__FILE__) + "/sqld4r/version"
5
+ require File.dirname(__FILE__) + "/sqld4r/sqld4r_core"
6
+ require File.dirname(__FILE__) + "/sqld4r/sqld4r_options"
7
+ require File.dirname(__FILE__) + "/sqld4r/sqld4r_parser"
8
+
9
+ module Sqld4r
10
+
11
+ end
@@ -0,0 +1,232 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <sql>
3
+ <datatypes db="mysql">
4
+ <group label="Numeric" color="rgb(238,238,170)">
5
+ <type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
6
+ <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
7
+ <type label="Single precision" length="0" sql="FLOAT" quote=""/>
8
+ <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
9
+ </group>
10
+
11
+ <group label="Character" color="rgb(255,200,200)">
12
+ <type label="Char" length="1" sql="CHAR" quote="'"/>
13
+ <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
14
+ <type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
15
+ <type label="Binary" length="1" sql="BINARY" quote="'"/>
16
+ <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
17
+ <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
18
+ </group>
19
+
20
+ <group label="Date &amp; Time" color="rgb(200,255,200)">
21
+ <type label="Date" length="0" sql="DATE" quote="'"/>
22
+ <type label="Time" length="0" sql="TIME" quote="'"/>
23
+ <type label="Datetime" length="0" sql="DATETIME" quote="'"/>
24
+ <type label="Year" length="0" sql="YEAR" quote=""/>
25
+ <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
26
+ </group>
27
+
28
+ <group label="Miscellaneous" color="rgb(200,200,255)">
29
+ <type label="ENUM" length="1" sql="ENUM" quote=""/>
30
+ <type label="SET" length="1" sql="SET" quote=""/>
31
+ </group>
32
+ </datatypes>
33
+ <table x="102" y="68" name="users">
34
+ <row name="id" null="0" autoincrement="1">
35
+ <datatype>INTEGER</datatype>
36
+ </row>
37
+ <row name="login" null="0" autoincrement="0">
38
+ <datatype>VARCHAR</datatype>
39
+ </row>
40
+ <row name="email" null="0" autoincrement="0">
41
+ <datatype>VARCHAR</datatype>
42
+ </row>
43
+ <row name="crypted_password" null="0" autoincrement="0">
44
+ <datatype>VARCHAR</datatype>
45
+ </row>
46
+ <row name="salt" null="0" autoincrement="0">
47
+ <datatype>VARCHAR</datatype>
48
+ </row>
49
+ <row name="created_at" null="0" autoincrement="0">
50
+ <datatype>DATETIME</datatype>
51
+ </row>
52
+ <row name="updated_at" null="0" autoincrement="0">
53
+ <datatype>DATETIME</datatype>
54
+ </row>
55
+ <row name="remember_token" null="0" autoincrement="0">
56
+ <datatype>VARCHAR</datatype>
57
+ </row>
58
+ <row name="remember_token_expires_at" null="0" autoincrement="0">
59
+ <datatype>DATETIME</datatype>
60
+ </row>
61
+ <key type="PRIMARY" name="">
62
+ <part>id</part>
63
+ </key>
64
+ <comment>acts_as_authanticate</comment>
65
+ </table>
66
+ <table x="374" y="77" name="tasks">
67
+ <row name="id" null="0" autoincrement="1">
68
+ <datatype>INTEGER</datatype>
69
+ </row>
70
+ <row name="user_id" null="0" autoincrement="0">
71
+ <datatype>INTEGER</datatype>
72
+ <relation table="users" row="id" />
73
+ </row>
74
+ <row name="title" null="0" autoincrement="0">
75
+ <datatype>VARCHAR</datatype>
76
+ </row>
77
+ <row name="toaddress" null="0" autoincrement="0">
78
+ <datatype>VARCHAR</datatype>
79
+ </row>
80
+ <row name="memo" null="0" autoincrement="0">
81
+ <datatype>MEDIUMTEXT</datatype>
82
+ </row>
83
+ <row name="position" null="0" autoincrement="0">
84
+ <datatype>INTEGER</datatype>
85
+ </row>
86
+ <row name="agenttype_id" null="0" autoincrement="0">
87
+ <datatype>INTEGER</datatype>
88
+ <relation table="agenttypes" row="id" />
89
+ </row>
90
+ <row name="isdebugmode" null="0" autoincrement="0">
91
+ <datatype>INTEGER</datatype>
92
+ </row>
93
+ <key type="PRIMARY" name="">
94
+ <part>id</part>
95
+ </key>
96
+ <comment>user has many actions</comment>
97
+ </table>
98
+ <table x="564" y="195" name="commands">
99
+ <row name="id" null="0" autoincrement="1">
100
+ <datatype>INTEGER</datatype>
101
+ </row>
102
+ <row name="task_id" null="0" autoincrement="0">
103
+ <datatype>INTEGER</datatype>
104
+ <relation table="tasks" row="id" />
105
+ </row>
106
+ <row name="commandtype_id" null="0" autoincrement="0">
107
+ <datatype>INTEGER</datatype>
108
+ <relation table="commandtypes" row="id" />
109
+ </row>
110
+ <row name="url" null="0" autoincrement="0">
111
+ <datatype>VARCHAR</datatype>
112
+ </row>
113
+ <row name="namecolumn" null="0" autoincrement="0">
114
+ <datatype>VARCHAR</datatype>
115
+ </row>
116
+ <row name="staticvalue" null="0" autoincrement="0">
117
+ <datatype>MEDIUMTEXT</datatype>
118
+ </row>
119
+ <row name="mailparam_id" null="0" autoincrement="0">
120
+ <datatype>INTEGER</datatype>
121
+ <relation table="mailparams" row="id" />
122
+ </row>
123
+ <row name="mailvalue_id" null="0" autoincrement="0">
124
+ <datatype>INTEGER</datatype>
125
+ <relation table="mailvalues" row="id" />
126
+ </row>
127
+ <row name="position" null="0" autoincrement="0">
128
+ <datatype>INTEGER</datatype>
129
+ </row>
130
+ <key type="PRIMARY" name="">
131
+ <part>id</part>
132
+ </key>
133
+ <comment>actions has many commands</comment>
134
+ </table>
135
+ <table x="786" y="70" name="commandtypes">
136
+ <row name="id" null="0" autoincrement="1">
137
+ <datatype>INTEGER</datatype>
138
+ </row>
139
+ <row name="name" null="0" autoincrement="0">
140
+ <datatype>VARCHAR</datatype></row>
141
+ <row name="key" null="0" autoincrement="0">
142
+ <datatype>VARCHAR</datatype>
143
+ </row>
144
+ <key type="PRIMARY" name="">
145
+ <part>id</part>
146
+ </key>
147
+ <comment>command blogn to command type.static data.</comment>
148
+ </table>
149
+ <table x="132" y="342" name="agenttypes">
150
+ <row name="id" null="0" autoincrement="1">
151
+ <datatype>INTEGER</datatype>
152
+ </row>
153
+ <row name="name" null="0" autoincrement="0">
154
+ <datatype>VARCHAR</datatype>
155
+ </row>
156
+ <row name="agentstring" null="0" autoincrement="0">
157
+ <datatype>VARCHAR</datatype>
158
+ </row>
159
+ <key type="PRIMARY" name="">
160
+ <part>id</part>
161
+ </key>
162
+ <comment>action blong to agent type. static data.</comment>
163
+ </table>
164
+ <table x="562" y="72" name="mailparams">
165
+ <row name="id" null="0" autoincrement="1">
166
+ <datatype>INTEGER</datatype>
167
+ </row>
168
+ <row name="task_id" null="0" autoincrement="0">
169
+ <datatype>INTEGER</datatype>
170
+ <relation table="tasks" row="id" />
171
+ </row>
172
+ <row name="name" null="0" autoincrement="0">
173
+ <datatype>VARCHAR</datatype>
174
+ </row>
175
+ <row name="pattern" null="0" autoincrement="0">
176
+ <datatype>VARCHAR</datatype>
177
+ </row>
178
+ <key type="PRIMARY" name="">
179
+ <part>id</part>
180
+ </key>
181
+ <comment>manage regexp pattern and name</comment>
182
+ </table>
183
+ <table x="371" y="335" name="members">
184
+ <row name="id" null="0" autoincrement="1">
185
+ <datatype>INTEGER</datatype>
186
+ </row>
187
+ <row name="task_id" null="0" autoincrement="0">
188
+ <datatype>INTEGER</datatype>
189
+ <relation table="tasks" row="id" />
190
+ </row>
191
+ <row name="user_id" null="0" autoincrement="0">
192
+ <datatype>INTEGER</datatype>
193
+ <relation table="users" row="id" />
194
+ </row>
195
+ <key type="PRIMARY" name="">
196
+ <part>id</part>
197
+ </key>
198
+ <comment>action has many users through members</comment>
199
+ </table>
200
+ <table x="566" y="429" name="logs">
201
+ <row name="id" null="0" autoincrement="1">
202
+ <datatype>INTEGER</datatype>
203
+ </row>
204
+ <row name="task_id" null="0" autoincrement="0">
205
+ <datatype>INTEGER</datatype>
206
+ <relation table="tasks" row="id" />
207
+ </row>
208
+ <row name="created_at" null="0" autoincrement="0">
209
+ <datatype>DATETIME</datatype>
210
+ </row>
211
+ <row name="result" null="0" autoincrement="0">
212
+ <datatype>MEDIUMTEXT</datatype>
213
+ </row>
214
+ <key type="PRIMARY" name="">
215
+ <part>id</part>
216
+ </key>
217
+ </table>
218
+ <table x="794" y="266" name="mailvalues">
219
+ <row name="id" null="0" autoincrement="1">
220
+ <datatype>INTEGER</datatype>
221
+ </row>
222
+ <row name="name" null="0" autoincrement="0">
223
+ <datatype>VARCHAR</datatype>
224
+ </row>
225
+ <key type="PRIMARY" name="">
226
+ <part>id</part>
227
+ </key>
228
+ </table>
229
+ </sql>
230
+
231
+
232
+