royw-railroad_xing 0.5.0.2 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ *~
2
+ pkg/
data/AUTHORS ADDED
@@ -0,0 +1,13 @@
1
+ Author:
2
+ Javier Smaldone
3
+ (javier |at| smaldone |dot| com |dot| ar)
4
+
5
+ Project site:
6
+ http://railroad.rubyforge.org
7
+
8
+ Contributors (in order of appearance):
9
+ Elliot Smith
10
+ Juan Ignacio Pumarino
11
+ Hajime Baba
12
+ Ana Nelson
13
+ and many testers...
data/INSTALL ADDED
@@ -0,0 +1,66 @@
1
+ Installation Instructions
2
+
3
+ 1) Install railroad-0.5.0 gem:
4
+
5
+ sudo gem install railroad
6
+
7
+ 2) Replace the railroad gem directory with this get repository:
8
+
9
+ # clone the repository
10
+
11
+ cd path/for/repository
12
+ git clone git://github.com/royw/railroad.git
13
+
14
+ # replace the railroad system gem
15
+
16
+ cd path/to/system/gems
17
+ sudo mv railroad-0.5.0 railroad-0.5.0.orig
18
+ sudo ln -s /path/for/repository/railroad railroad-0.5.0
19
+
20
+ That should do it.
21
+
22
+
23
+ Notes
24
+
25
+ 1) Tested on Merb 1.0.4 and DataMapper 0.9.7.
26
+
27
+ 2) Only generation for Models and Controllers is supported. The AASM is a rails plugin so did not support AASM graphs.
28
+ There is a similar plugin for datamapper (dm-is-state_machine) if anyone wants to tackle it.
29
+
30
+ 3) One caveat, RailRoad needs to be installed as a system gem, not installed into your application. If you really must
31
+ have railroad installed as an application gem, then you will need to move:
32
+
33
+ from your_app/gems/gems/railroad-x.x.x/lib/railroad/merb_framework.rb:
34
+
35
+ require 'merb-core'
36
+ Merb.start_environment(:testing => true, :adapter => 'runner', :environment => ENV['MERB_ENV'] || 'test')
37
+
38
+ to your_app/bin/railroad after the require statements and before the gem directory stuff.
39
+
40
+ 4) Example merb rake task:
41
+
42
+ your_app/lib/tasks/doc.rake:
43
+
44
+ namespace :diagram do
45
+ desc 'generate model diagrams'
46
+ task :models do
47
+ sh "railroad -i -l -a -m -M | neato -Tsvg | sed 's/font-size:14.00/font-size:11.00/g' >
48
+ doc/models.svg"
49
+ end
50
+
51
+ desc 'generate controller diagrams'
52
+ task :controllers do
53
+ sh "railroad -i -l -C | neato -Tsvg | sed 's/font-size:14.00/font-size:11.00/g' >
54
+ doc/controllers.svg"
55
+ end
56
+ end
57
+
58
+ desc 'generate model and controller diagrams'
59
+ task :diagrams => %w(diagram:models diagram:controllers)
60
+
61
+
62
+ 5) The merb environment detection assumes that your application has a merb sub-directory (your_app/merb/). The current version of merb-gen does create this sub-directory but older projects may need to:
63
+
64
+ cd your_app
65
+ touch merb
66
+
data/Rakefile ADDED
@@ -0,0 +1,48 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "railroad_xing"
8
+ gem.summary = %Q{A DOT diagram generator for Ruby web applications (Rails, Merb)}
9
+ gem.email = "roy@wright.org"
10
+ gem.homepage = "http://github.com/royw/railroad_xing"
11
+ gem.authors = ["royw"]
12
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
13
+ end
14
+
15
+ rescue LoadError
16
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
17
+ end
18
+
19
+ require 'spec/rake/spectask'
20
+ Spec::Rake::SpecTask.new(:spec) do |spec|
21
+ spec.libs << 'lib' << 'spec'
22
+ spec.spec_files = FileList['spec/**/*_spec.rb']
23
+ end
24
+
25
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
26
+ spec.libs << 'lib' << 'spec'
27
+ spec.pattern = 'spec/**/*_spec.rb'
28
+ spec.rcov = true
29
+ end
30
+
31
+
32
+ task :default => :spec
33
+
34
+ require 'rake/rdoctask'
35
+ Rake::RDocTask.new do |rdoc|
36
+ if File.exist?('VERSION.yml')
37
+ config = YAML.load(File.read('VERSION.yml'))
38
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
39
+ else
40
+ version = ""
41
+ end
42
+
43
+ rdoc.rdoc_dir = 'rdoc'
44
+ rdoc.title = "spec2merb #{version}"
45
+ rdoc.rdoc_files.include('README*')
46
+ rdoc.rdoc_files.include('lib/**/*.rb')
47
+ end
48
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.5.1
@@ -37,7 +37,14 @@ class MerbFramework
37
37
 
38
38
  # Extract class name from filename
39
39
  def extract_class_name(filename)
40
- File.basename(filename).chomp(".rb").camel_case
40
+ # handle subdirectories as modules
41
+ # i.e., app/controllers/foo/bar.rb => Foo::Bar
42
+ if filename =~ /^app\/controllers\/(.*)\.rb$/
43
+ class_name = $1.split('/').collect {|part| part.camel_case}.join('::')
44
+ else
45
+ class_name = File.basename(filename).chomp(".rb").camel_case
46
+ end
47
+ class_name
41
48
  end
42
49
 
43
50
  # convert the give string to a constant
@@ -28,7 +28,13 @@ class RailsFramework
28
28
 
29
29
  # Extract class name from filename
30
30
  def extract_class_name(filename)
31
- class_name = File.basename(filename).chomp(".rb").camelize
31
+ # handle subdirectories as modules
32
+ # i.e., app/controllers/foo/bar.rb => Foo::Bar
33
+ if filename =~ /^app\/controllers\/(.*)\.rb$/
34
+ class_name = $1.split('/').collect {|part| part.camel_case}.join('::')
35
+ else
36
+ class_name = File.basename(filename).chomp(".rb").camel_case
37
+ end
32
38
 
33
39
  if filename == 'app/controllers/application.rb'
34
40
  # ApplicationController's file is 'application.rb'
@@ -1,32 +1,56 @@
1
- SPEC = Gem::Specification.new do |s|
2
- s.name = "railroad_xing"
3
- s.version = "0.5.0.2"
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"]
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{railroad_xing}
5
+ s.version = "0.5.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["royw"]
9
+ s.date = %q{2009-06-06}
10
+ s.default_executable = %q{railroad}
11
+ s.email = %q{roy@wright.org}
12
+ s.executables = ["railroad"]
13
+ s.extra_rdoc_files = [
14
+ "ChangeLog",
15
+ "README"
16
+ ]
17
+ s.files = [
18
+ ".gitignore",
19
+ "AUTHORS",
20
+ "COPYING",
21
+ "ChangeLog",
22
+ "INSTALL",
23
+ "README",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "bin/railroad",
27
+ "lib/railroad/aasm_diagram.rb",
28
+ "lib/railroad/app_diagram.rb",
29
+ "lib/railroad/ar_model.rb",
30
+ "lib/railroad/controllers_diagram.rb",
31
+ "lib/railroad/diagram_graph.rb",
32
+ "lib/railroad/dm_model.rb",
33
+ "lib/railroad/framework_factory.rb",
34
+ "lib/railroad/merb_framework.rb",
35
+ "lib/railroad/model_factory.rb",
36
+ "lib/railroad/models_diagram.rb",
37
+ "lib/railroad/options_struct.rb",
38
+ "lib/railroad/rails_framework.rb",
39
+ "railroad_xing.gemspec"
40
+ ]
41
+ s.homepage = %q{http://github.com/royw/railroad_xing}
42
+ s.rdoc_options = ["--charset=UTF-8"]
43
+ s.require_paths = ["lib"]
44
+ s.rubygems_version = %q{1.3.4}
45
+ s.summary = %q{A DOT diagram generator for Ruby web applications (Rails, Merb)}
46
+
47
+ if s.respond_to? :specification_version then
48
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
49
+ s.specification_version = 3
50
+
51
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
52
+ else
53
+ end
54
+ else
55
+ end
32
56
  end
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: royw-railroad_xing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.2
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
- - Javier Smaldone
8
- - Roy Wright
7
+ - royw
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
11
 
13
- date: 2009-05-16 00:00:00 -07:00
12
+ date: 2009-06-06 00:00:00 -07:00
14
13
  default_executable: railroad
15
14
  dependencies: []
16
15
 
@@ -21,12 +20,18 @@ executables:
21
20
  extensions: []
22
21
 
23
22
  extra_rdoc_files:
23
+ - ChangeLog
24
24
  - README
25
- - COPYING
26
25
  files:
27
- - ChangeLog
26
+ - .gitignore
27
+ - AUTHORS
28
28
  - COPYING
29
- - railroad_xing.gemspec
29
+ - ChangeLog
30
+ - INSTALL
31
+ - README
32
+ - Rakefile
33
+ - VERSION
34
+ - bin/railroad
30
35
  - lib/railroad/aasm_diagram.rb
31
36
  - lib/railroad/app_diagram.rb
32
37
  - lib/railroad/ar_model.rb
@@ -39,12 +44,12 @@ files:
39
44
  - lib/railroad/models_diagram.rb
40
45
  - lib/railroad/options_struct.rb
41
46
  - lib/railroad/rails_framework.rb
42
- - README
43
- has_rdoc: true
47
+ - railroad_xing.gemspec
48
+ has_rdoc: false
44
49
  homepage: http://github.com/royw/railroad_xing
45
50
  post_install_message:
46
- rdoc_options: []
47
-
51
+ rdoc_options:
52
+ - --charset=UTF-8
48
53
  require_paths:
49
54
  - lib
50
55
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -64,7 +69,7 @@ requirements: []
64
69
  rubyforge_project:
65
70
  rubygems_version: 1.2.0
66
71
  signing_key:
67
- specification_version: 2
72
+ specification_version: 3
68
73
  summary: A DOT diagram generator for Ruby web applications (Rails, Merb)
69
74
  test_files: []
70
75