railroad 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/COPYING CHANGED
@@ -1,14 +1,14 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
1
+ =GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
3
 
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
8
 
9
- Preamble
9
+ ==Preamble
10
10
 
11
- The licenses for most software are designed to take away your
11
+ The licenses for most software are designed to take away your
12
12
  freedom to share and change it. By contrast, the GNU General Public
13
13
  License is intended to guarantee your freedom to share and change free
14
14
  software--to make sure the software is free for all its users. This
@@ -18,48 +18,48 @@ using it. (Some other Free Software Foundation software is covered by
18
18
  the GNU Library General Public License instead.) You can apply it to
19
19
  your programs, too.
20
20
 
21
- When we speak of free software, we are referring to freedom, not
21
+ When we speak of free software, we are referring to freedom, not
22
22
  price. Our General Public Licenses are designed to make sure that you
23
23
  have the freedom to distribute copies of free software (and charge for
24
24
  this service if you wish), that you receive source code or can get it
25
25
  if you want it, that you can change the software or use pieces of it
26
26
  in new free programs; and that you know you can do these things.
27
27
 
28
- To protect your rights, we need to make restrictions that forbid
28
+ To protect your rights, we need to make restrictions that forbid
29
29
  anyone to deny you these rights or to ask you to surrender the rights.
30
30
  These restrictions translate to certain responsibilities for you if you
31
31
  distribute copies of the software, or if you modify it.
32
32
 
33
- For example, if you distribute copies of such a program, whether
33
+ For example, if you distribute copies of such a program, whether
34
34
  gratis or for a fee, you must give the recipients all the rights that
35
35
  you have. You must make sure that they, too, receive or can get the
36
36
  source code. And you must show them these terms so they know their
37
37
  rights.
38
38
 
39
- We protect your rights with two steps: (1) copyright the software, and
39
+ We protect your rights with two steps: (1) copyright the software, and
40
40
  (2) offer you this license which gives you legal permission to copy,
41
41
  distribute and/or modify the software.
42
42
 
43
- Also, for each author's protection and ours, we want to make certain
43
+ Also, for each author's protection and ours, we want to make certain
44
44
  that everyone understands that there is no warranty for this free
45
45
  software. If the software is modified by someone else and passed on, we
46
46
  want its recipients to know that what they have is not the original, so
47
47
  that any problems introduced by others will not reflect on the original
48
48
  authors' reputations.
49
49
 
50
- Finally, any free program is threatened constantly by software
50
+ Finally, any free program is threatened constantly by software
51
51
  patents. We wish to avoid the danger that redistributors of a free
52
52
  program will individually obtain patent licenses, in effect making the
53
53
  program proprietary. To prevent this, we have made it clear that any
54
54
  patent must be licensed for everyone's free use or not licensed at all.
55
55
 
56
- The precise terms and conditions for copying, distribution and
56
+ The precise terms and conditions for copying, distribution and
57
57
  modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
58
 
62
- 0. This License applies to any program or other work which contains
59
+ =GNU GENERAL PUBLIC LICENSE
60
+ ==TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0) This License applies to any program or other work which contains
63
63
  a notice placed by the copyright holder saying it may be distributed
64
64
  under the terms of this General Public License. The "Program", below,
65
65
  refers to any such program or work, and a "work based on the Program"
@@ -76,7 +76,7 @@ is covered only if its contents constitute a work based on the
76
76
  Program (independent of having been made by running the Program).
77
77
  Whether that is true depends on what the Program does.
78
78
 
79
- 1. You may copy and distribute verbatim copies of the Program's
79
+ 1) You may copy and distribute verbatim copies of the Program's
80
80
  source code as you receive it, in any medium, provided that you
81
81
  conspicuously and appropriately publish on each copy an appropriate
82
82
  copyright notice and disclaimer of warranty; keep intact all the
@@ -87,7 +87,7 @@ along with the Program.
87
87
  You may charge a fee for the physical act of transferring a copy, and
88
88
  you may at your option offer warranty protection in exchange for a fee.
89
89
 
90
- 2. You may modify your copy or copies of the Program or any portion
90
+ 2) You may modify your copy or copies of the Program or any portion
91
91
  of it, thus forming a work based on the Program, and copy and
92
92
  distribute such modifications or work under the terms of Section 1
93
93
  above, provided that you also meet all of these conditions:
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
110
110
  License. (Exception: if the Program itself is interactive but
111
111
  does not normally print such an announcement, your work based on
112
112
  the Program is not required to print an announcement.)
113
-
113
+
114
114
  These requirements apply to the modified work as a whole. If
115
115
  identifiable sections of that work are not derived from the Program,
116
116
  and can be reasonably considered independent and separate works in
@@ -131,7 +131,7 @@ with the Program (or with a work based on the Program) on a volume of
131
131
  a storage or distribution medium does not bring the other work under
132
132
  the scope of this License.
133
133
 
134
- 3. You may copy and distribute the Program (or a work based on it,
134
+ 3) You may copy and distribute the Program (or a work based on it,
135
135
  under Section 2) in object code or executable form under the terms of
136
136
  Sections 1 and 2 above provided that you also do one of the following:
137
137
 
@@ -168,8 +168,8 @@ access to copy from a designated place, then offering equivalent
168
168
  access to copy the source code from the same place counts as
169
169
  distribution of the source code, even though third parties are not
170
170
  compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
171
+
172
+ 4) You may not copy, modify, sublicense, or distribute the Program
173
173
  except as expressly provided under this License. Any attempt
174
174
  otherwise to copy, modify, sublicense or distribute the Program is
175
175
  void, and will automatically terminate your rights under this License.
@@ -177,7 +177,7 @@ However, parties who have received copies, or rights, from you under
177
177
  this License will not have their licenses terminated so long as such
178
178
  parties remain in full compliance.
179
179
 
180
- 5. You are not required to accept this License, since you have not
180
+ 5) You are not required to accept this License, since you have not
181
181
  signed it. However, nothing else grants you permission to modify or
182
182
  distribute the Program or its derivative works. These actions are
183
183
  prohibited by law if you do not accept this License. Therefore, by
@@ -186,7 +186,7 @@ Program), you indicate your acceptance of this License to do so, and
186
186
  all its terms and conditions for copying, distributing or modifying
187
187
  the Program or works based on it.
188
188
 
189
- 6. Each time you redistribute the Program (or any work based on the
189
+ 6) Each time you redistribute the Program (or any work based on the
190
190
  Program), the recipient automatically receives a license from the
191
191
  original licensor to copy, distribute or modify the Program subject to
192
192
  these terms and conditions. You may not impose any further
@@ -194,7 +194,7 @@ restrictions on the recipients' exercise of the rights granted herein.
194
194
  You are not responsible for enforcing compliance by third parties to
195
195
  this License.
196
196
 
197
- 7. If, as a consequence of a court judgment or allegation of patent
197
+ 7) If, as a consequence of a court judgment or allegation of patent
198
198
  infringement or for any other reason (not limited to patent issues),
199
199
  conditions are imposed on you (whether by court order, agreement or
200
200
  otherwise) that contradict the conditions of this License, they do not
@@ -225,8 +225,8 @@ impose that choice.
225
225
 
226
226
  This section is intended to make thoroughly clear what is believed to
227
227
  be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
228
+
229
+ 8) If the distribution and/or use of the Program is restricted in
230
230
  certain countries either by patents or by copyrighted interfaces, the
231
231
  original copyright holder who places the Program under this License
232
232
  may add an explicit geographical distribution limitation excluding
@@ -234,7 +234,7 @@ those countries, so that distribution is permitted only in or among
234
234
  countries not thus excluded. In such case, this License incorporates
235
235
  the limitation as if written in the body of this License.
236
236
 
237
- 9. The Free Software Foundation may publish revised and/or new versions
237
+ 9) The Free Software Foundation may publish revised and/or new versions
238
238
  of the General Public License from time to time. Such new versions will
239
239
  be similar in spirit to the present version, but may differ in detail to
240
240
  address new problems or concerns.
@@ -247,7 +247,7 @@ Software Foundation. If the Program does not specify a version number of
247
247
  this License, you may choose any version ever published by the Free Software
248
248
  Foundation.
249
249
 
250
- 10. If you wish to incorporate parts of the Program into other free
250
+ 10) If you wish to incorporate parts of the Program into other free
251
251
  programs whose distribution conditions are different, write to the author
252
252
  to ask for permission. For software which is copyrighted by the Free
253
253
  Software Foundation, write to the Free Software Foundation; we sometimes
@@ -255,9 +255,9 @@ make exceptions for this. Our decision will be guided by the two goals
255
255
  of preserving the free status of all derivatives of our free software and
256
256
  of promoting the sharing and reuse of software generally.
257
257
 
258
- NO WARRANTY
258
+ ==NO WARRANTY
259
259
 
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
260
+ 11) BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
261
  FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
262
  OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
263
  PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
@@ -267,7 +267,7 @@ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
267
  PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
268
  REPAIR OR CORRECTION.
269
269
 
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
270
+ 12) IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
271
  WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
272
  REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
273
  INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
@@ -277,15 +277,15 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
277
  PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
278
  POSSIBILITY OF SUCH DAMAGES.
279
279
 
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
280
+ ==END OF TERMS AND CONDITIONS
281
+
282
+ =How to Apply These Terms to Your New Programs
283
283
 
284
- If you develop a new program, and you want it to be of the greatest
284
+ If you develop a new program, and you want it to be of the greatest
285
285
  possible use to the public, the best way to achieve this is to make it
286
286
  free software which everyone can redistribute and change under these terms.
287
287
 
288
- To do so, attach the following notices to the program. It is safest
288
+ To do so, attach the following notices to the program. It is safest
289
289
  to attach them to the start of each source file to most effectively
290
290
  convey the exclusion of warranty; and each file should have at least
291
291
  the "copyright" line and a pointer to where the full notice is found.
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ Version 0.4.1 (may 9 2008)
2
+ - Fix a bug (class name treated as String).
3
+
1
4
  Version 0.4.0 (apr 25 2007)
2
5
  - Draw inheritance edges in reverse way
3
6
  (from superclass to subclass, with an arrow in the tail)
data/README CHANGED
@@ -139,4 +139,6 @@ License, or (at your option) any later version.
139
139
 
140
140
  = Author
141
141
 
142
- Javier Smaldone (javier -at- smaldone -dot- com -dot- ar)
142
+ Javier Smaldone
143
+ (javier -at- smaldone -dot- com -dot- ar, http://blog.smaldone.com.ar )
144
+
@@ -16,7 +16,7 @@
16
16
 
17
17
  APP_NAME = "railroad"
18
18
  APP_HUMAN_NAME = "RailRoad"
19
- APP_VERSION = [0,4,0]
19
+ APP_VERSION = [0,4,1]
20
20
  COPYRIGHT = "Copyright (C) 2007 Javier Smaldone"
21
21
 
22
22
  require 'railroad/options_struct'
@@ -32,10 +32,14 @@ class AppDiagram
32
32
  exit 2
33
33
  end
34
34
  end
35
-
36
- STDERR.print "Generating DOT graph\n" if @options.verbose
37
-
38
- STDOUT.print @graph.to_dot
35
+
36
+ if @options.xmi
37
+ STDERR.print "Generating XMI diagram\n" if @options.verbose
38
+ STDOUT.print @graph.to_xmi
39
+ else
40
+ STDERR.print "Generating DOT graph\n" if @options.verbose
41
+ STDOUT.print @graph.to_dot
42
+ end
39
43
 
40
44
  if @options.output
41
45
  STDOUT.reopen(old_stdout)
@@ -10,7 +10,7 @@ require 'railroad/app_diagram'
10
10
  class ControllersDiagram < AppDiagram
11
11
 
12
12
  def initialize(options)
13
- options.exclude.map! {|e| e = "app/controllers/" + e}
13
+ options.exclude.map! {|e| "app/controllers/" + e}
14
14
  super options
15
15
  @graph.diagram_type = 'Controllers'
16
16
  end
@@ -76,7 +76,6 @@ class ControllersDiagram < AppDiagram
76
76
  # Generate the inheritance edge (only for ApplicationControllers)
77
77
  if @options.inheritance &&
78
78
  (ApplicationController.subclasses.include? current_class.name)
79
- # REVERSE INHERITANCE (CHECK)
80
79
  @graph.add_edge ['is-a', current_class.superclass.name, current_class.name]
81
80
  end
82
81
  end # process_class
@@ -39,6 +39,12 @@ class DiagramGraph
39
39
  @edges.map{|e| dot_edge e[0], e[1], e[2], e[3]}.join +
40
40
  dot_footer
41
41
  end
42
+
43
+ # Generate XMI diagram (not yet implemented)
44
+ def to_xmi
45
+ STDERR.print "Sorry. XMI output not yet implemented.\n\n"
46
+ return ""
47
+ end
42
48
 
43
49
  private
44
50
 
@@ -58,7 +64,7 @@ class DiagramGraph
58
64
  # Build diagram label
59
65
  def dot_label
60
66
  return "\t_diagram_info [shape=\"plaintext\", " +
61
- "label=\"Diagram: #{@diagram_type}\\l" +
67
+ "label=\"#{@diagram_type} diagram\\l" +
62
68
  "Date: #{Time.now.strftime "%b %d %Y - %H:%M"}\\l" +
63
69
  "Migration version: " +
64
70
  "#{ActiveRecord::Migrator.current_version}\\l" +
@@ -106,8 +112,6 @@ class DiagramGraph
106
112
  when 'many-many'
107
113
  options += 'taillabel="n", headlabel="n", arrowtail="normal"'
108
114
  when 'is-a'
109
- # REVERSE INHERITANCE (CHECK)
110
- # options += 'arrowhead="onormal"'
111
115
  options += 'arrowhead="none", arrowtail="onormal"'
112
116
  end
113
117
  return "\t#{quote(from)} -> #{quote(to)} [#{options}]\n"
@@ -115,7 +119,7 @@ class DiagramGraph
115
119
 
116
120
  # Quotes a class name
117
121
  def quote(name)
118
- '"' + name + '"'
122
+ '"' + name.to_s + '"'
119
123
  end
120
124
 
121
125
  end # class DiagramGraph
@@ -10,7 +10,7 @@ require 'railroad/app_diagram'
10
10
  class ModelsDiagram < AppDiagram
11
11
 
12
12
  def initialize(options)
13
- options.exclude.map! {|e| e = "app/models/" + e}
13
+ options.exclude.map! {|e| "app/models/" + e}
14
14
  super options
15
15
  @graph.diagram_type = 'Models'
16
16
  # Processed habtm associations
@@ -90,7 +90,6 @@ class ModelsDiagram < AppDiagram
90
90
  if @options.inheritance && generated &&
91
91
  (current_class.superclass != ActiveRecord::Base) &&
92
92
  (current_class.superclass != Object)
93
- # REVERSE INHERITANCE (CHECK)
94
93
  @graph.add_edge ['is-a', current_class.superclass.name, current_class.name]
95
94
  end
96
95
 
@@ -25,7 +25,7 @@ class OptionsStruct < OpenStruct
25
25
  :hide_private => false,
26
26
  :transitive => false,
27
27
  :verbose => false,
28
- # :xmi => false,
28
+ :xmi => false,
29
29
  :command => '' }
30
30
  super(init_options)
31
31
  end # initialize
@@ -57,11 +57,10 @@ class OptionsStruct < OpenStruct
57
57
  " (produce messages to STDOUT)") do |v|
58
58
  self.verbose = v
59
59
  end
60
- # TODO: Add XMI output.
61
- # opts.on("-x", "--xmi", "Produce XMI instead of DOT",
62
- # " (for UML tools)") do |x|
63
- # self.xmi = x
64
- # end
60
+ opts.on("-x", "--xmi", "Produce XMI instead of DOT",
61
+ " (for UML tools)") do |x|
62
+ self.xmi = x
63
+ end
65
64
  opts.separator ""
66
65
  opts.separator "Models diagram options:"
67
66
  opts.on("-a", "--all", "Include all models",
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  SPEC = Gem::Specification.new do |s|
3
3
  s.name = "railroad"
4
- s.version = "0.4.0"
4
+ s.version = "0.4.1"
5
5
  s.author = "Javier Smaldone"
6
6
  s.email = "javier@smaldone.com.ar"
7
7
  s.homepage = "http://railroad.rubyforge.org"
metadata CHANGED
@@ -1,33 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
3
- specification_version: 1
4
2
  name: railroad
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.4.0
7
- date: 2007-04-25 00:00:00 -03:00
8
- summary: A DOT diagram generator for Ruby on Rail applications
9
- require_paths:
10
- - lib
11
- email: javier@smaldone.com.ar
12
- homepage: http://railroad.rubyforge.org
13
- rubyforge_project:
14
- description:
15
- autorequire:
16
- default_executable: railroad
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.4.1
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Javier Smaldone
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-05-09 00:00:00 -03:00
13
+ default_executable: railroad
14
+ dependencies: []
15
+
16
+ description:
17
+ email: javier@smaldone.com.ar
18
+ executables:
19
+ - railroad
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ - COPYING
31
25
  files:
32
26
  - lib/railroad/models_diagram.rb
33
27
  - lib/railroad/app_diagram.rb
@@ -38,18 +32,31 @@ files:
38
32
  - COPYING
39
33
  - rake.gemspec
40
34
  - README
41
- test_files: []
42
-
35
+ has_rdoc: true
36
+ homepage: http://railroad.rubyforge.org
37
+ post_install_message:
43
38
  rdoc_options: []
44
39
 
45
- extra_rdoc_files:
46
- - README
47
- - COPYING
48
- executables:
49
- - railroad
50
- extensions: []
51
-
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ version:
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: "0"
53
+ version:
52
54
  requirements: []
53
55
 
54
- dependencies: []
56
+ rubyforge_project:
57
+ rubygems_version: 1.1.1
58
+ signing_key:
59
+ specification_version: 2
60
+ summary: A DOT diagram generator for Ruby on Rail applications
61
+ test_files: []
55
62