royw-railroad_xing 0.5.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.
@@ -0,0 +1,45 @@
1
+ # A class that encapsulates the interaction with the Rails framework.
2
+ #
3
+ # Dec 2008 - Roy Wright
4
+ # created to support the Rails application framework
5
+ #
6
+ class RailsFramework
7
+ attr_reader :name, :migration_version
8
+
9
+ def initialize
10
+ require "config/environment"
11
+ @name = 'Rails'
12
+ @migration_version = ActiveRecord::Migrator.current_version
13
+ end
14
+
15
+ # is the given class a subclass of the application controller?
16
+ def is_application_subclass?(klass)
17
+ (ApplicationController.subclasses.include? klass.name)
18
+ end
19
+
20
+ # get the controller's files returning the application controller first in returned array
21
+ def get_controller_files(options)
22
+ files = []
23
+ files << 'app/controllers/application.rb'
24
+ files += Dir.glob("app/controllers/**/*_controller.rb") - options.exclude
25
+ files.uniq
26
+ end
27
+
28
+ # Extract class name from filename
29
+ def extract_class_name(filename)
30
+ class_name = File.basename(filename).chomp(".rb").camelize
31
+
32
+ if filename == 'app/controllers/application.rb'
33
+ # ApplicationController's file is 'application.rb'
34
+ class_name += 'Controller' if class_name == 'Application'
35
+ end
36
+ class_name
37
+ end
38
+
39
+ # convert the give string to a constant
40
+ def constantize(str)
41
+ str.constantize
42
+ end
43
+
44
+ end
45
+
@@ -0,0 +1,32 @@
1
+ SPEC = Gem::Specification.new do |s|
2
+ s.name = "railroad_xing"
3
+ s.version = "0.5.0.1"
4
+ s.authors = ["Javier Smaldone", "Roy Wright"]
5
+ s.email = "roy@wright.org"
6
+ s.homepage = "http://github.com/royw/railroad_xing"
7
+ # s.rubyforge_project = "railroad"
8
+ s.platform = Gem::Platform::RUBY
9
+ s.summary = "A DOT diagram generator for Ruby web applications (Rails, Merb)"
10
+ s.files = [
11
+ "ChangeLog",
12
+ "COPYING",
13
+ "railroad_xing.gemspec",
14
+ "lib/railroad/aasm_diagram.rb",
15
+ "lib/railroad/app_diagram.rb",
16
+ "lib/railroad/ar_model.rb",
17
+ "lib/railroad/controllers_diagram.rb",
18
+ "lib/railroad/diagram_graph.rb",
19
+ "lib/railroad/dm_model.rb",
20
+ "lib/railroad/framework_factory.rb",
21
+ "lib/railroad/merb_framework.rb",
22
+ "lib/railroad/model_factory.rb",
23
+ "lib/railroad/models_diagram.rb",
24
+ "lib/railroad/options_struct.rb",
25
+ "lib/railroad/rails_framework.rb"
26
+ ]
27
+ s.bindir = "bin"
28
+ s.executables = ["railroad"]
29
+ s.default_executable = "railroad"
30
+ s.has_rdoc = true
31
+ s.extra_rdoc_files = ["README", "COPYING"]
32
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: royw-railroad_xing
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Javier Smaldone
8
+ - Roy Wright
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2008-12-15 00:00:00 -08:00
14
+ default_executable: railroad
15
+ dependencies: []
16
+
17
+ description:
18
+ email: roy@wright.org
19
+ executables:
20
+ - railroad
21
+ extensions: []
22
+
23
+ extra_rdoc_files:
24
+ - README
25
+ - COPYING
26
+ files:
27
+ - ChangeLog
28
+ - COPYING
29
+ - railroad_xing.gemspec
30
+ - lib/railroad/aasm_diagram.rb
31
+ - lib/railroad/app_diagram.rb
32
+ - lib/railroad/ar_model.rb
33
+ - lib/railroad/controllers_diagram.rb
34
+ - lib/railroad/diagram_graph.rb
35
+ - lib/railroad/dm_model.rb
36
+ - lib/railroad/framework_factory.rb
37
+ - lib/railroad/merb_framework.rb
38
+ - lib/railroad/model_factory.rb
39
+ - lib/railroad/models_diagram.rb
40
+ - lib/railroad/options_struct.rb
41
+ - lib/railroad/rails_framework.rb
42
+ - README
43
+ has_rdoc: true
44
+ homepage: http://github.com/royw/railroad_xing
45
+ post_install_message:
46
+ rdoc_options: []
47
+
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: "0"
55
+ version:
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: "0"
61
+ version:
62
+ requirements: []
63
+
64
+ rubyforge_project:
65
+ rubygems_version: 1.2.0
66
+ signing_key:
67
+ specification_version: 2
68
+ summary: A DOT diagram generator for Ruby web applications (Rails, Merb)
69
+ test_files: []
70
+