railroady 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -65,6 +65,7 @@ Models diagram options:
65
65
  (not just content columns)
66
66
  --hide-magic Hide magic field names
67
67
  --hide-types Hide attributes type
68
+ --hide-through Hide through associations
68
69
  -j, --join Concentrate edges
69
70
  -m, --modules Include modules
70
71
  -p, --plugins-models Include plugins models
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 0
4
- :patch: 7
4
+ :patch: 8
5
5
  :build:
@@ -66,7 +66,8 @@ class AppDiagram
66
66
  # Prevents Rails application from writing to STDOUT
67
67
  def disable_stdout
68
68
  @old_stdout = STDOUT.dup
69
- STDOUT.reopen(::RUBY_PLATFORM =~ /mswin/ ? "NUL" : "/dev/null")
69
+ #via Tomas Matousek, http://www.ruby-forum.com/topic/205887
70
+ STDOUT.reopen(::RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw/? "NUL" : "/dev/null")
70
71
  end
71
72
 
72
73
  # Restore STDOUT
@@ -82,7 +82,7 @@ class ModelsDiagram < AppDiagram
82
82
  node_type = 'model'
83
83
 
84
84
  # Collect model's content columns
85
- content_columns = current_class.content_columns
85
+ #content_columns = current_class.content_columns
86
86
 
87
87
  if @options.hide_magic
88
88
  # From patch #13351
@@ -95,7 +95,7 @@ class ModelsDiagram < AppDiagram
95
95
  magic_fields << current_class.table_name + "_count" if current_class.respond_to? 'table_name'
96
96
  content_columns = current_class.content_columns.select {|c| ! magic_fields.include? c.name}
97
97
  else
98
- content_columns = current_class.content_columns
98
+ content_columns = current_class.columns
99
99
  end
100
100
 
101
101
  content_columns.each do |a|
@@ -220,6 +220,10 @@ class ModelsDiagram < AppDiagram
220
220
  macro = assoc.macro.to_s
221
221
  return if %w[belongs_to referenced_in].include?(macro) && !@options.show_belongs_to
222
222
 
223
+ # Skip "through" associations
224
+ through = assoc.options.include?(:through)
225
+ return if through && @options.hide_through
226
+
223
227
  #TODO:
224
228
  # FAIL: assoc.methods.include?(:class_name)
225
229
  # FAIL: assoc.responds_to?(:class_name)
@@ -29,6 +29,7 @@ class OptionsStruct < OpenStruct
29
29
  :plugins_models => false,
30
30
  :root => '',
31
31
  :show_belongs_to => false,
32
+ :hide_through => false,
32
33
  :transitive => false,
33
34
  :verbose => false,
34
35
  :xmi => false,
@@ -82,6 +83,9 @@ class OptionsStruct < OpenStruct
82
83
  opts.on("--show-belongs_to", "Show belongs_to associations") do |s|
83
84
  self.show_belongs_to = s
84
85
  end
86
+ opts.on("--hide-through", "Hide through associations") do |h|
87
+ self.hide_through = h
88
+ end
85
89
  opts.on("--all-columns", "Show all columns (not just content columns)") do |h|
86
90
  self.all_columns = h
87
91
  end
metadata CHANGED
@@ -1,15 +1,10 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: railroady
3
- version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 0
9
- - 7
10
- version: 1.0.7
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.8
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Preston Lee
14
9
  - Tobias Crawley
15
10
  - Peter Hoeg
@@ -17,28 +12,26 @@ authors:
17
12
  autorequire:
18
13
  bindir: bin
19
14
  cert_chain: []
20
-
21
- date: 2012-02-28 00:00:00 +05:30
22
- default_executable: railroady
15
+ date: 2012-07-11 00:00:00.000000000 Z
23
16
  dependencies: []
24
-
25
- description: Ruby on Rails 3 model and controller UML class diagram generator. Originally based on the 'railroad' plugin and contributions of many others. (`sudo port install graphviz` before use!)
26
- email:
17
+ description: Ruby on Rails 3 model and controller UML class diagram generator. Originally
18
+ based on the 'railroad' plugin and contributions of many others. (`sudo port install
19
+ graphviz` before use!)
20
+ email:
27
21
  - conmotto@gmail.com
28
22
  - tcrawley@gmail.com
29
23
  - peter@hoeg.com
30
24
  - p.hoeg@northwind.sg
31
25
  - javier@smaldone.com.ar
32
- executables:
26
+ executables:
33
27
  - railroady
34
28
  extensions: []
35
-
36
- extra_rdoc_files:
29
+ extra_rdoc_files:
37
30
  - AUTHORS.rdoc
38
31
  - CHANGELOG.rdoc
39
32
  - LICENSE.rdoc
40
33
  - README.rdoc
41
- files:
34
+ files:
42
35
  - .document
43
36
  - AUTHORS.rdoc
44
37
  - CHANGELOG.rdoc
@@ -57,39 +50,28 @@ files:
57
50
  - lib/railroady/railtie.rb
58
51
  - lib/railroady/version.rb
59
52
  - tasks/railroady.rake
60
- has_rdoc: true
61
53
  homepage: http://github.com/preston/railroady
62
54
  licenses: []
63
-
64
55
  post_install_message:
65
56
  rdoc_options: []
66
-
67
- require_paths:
57
+ require_paths:
68
58
  - lib
69
- required_ruby_version: !ruby/object:Gem::Requirement
59
+ required_ruby_version: !ruby/object:Gem::Requirement
70
60
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
78
- required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
66
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
87
71
  requirements: []
88
-
89
72
  rubyforge_project:
90
- rubygems_version: 1.3.7
73
+ rubygems_version: 1.8.24
91
74
  signing_key:
92
75
  specification_version: 3
93
76
  summary: Ruby on Rails 3 model and controller UML class diagram generator.
94
77
  test_files: []
95
-