rtml 2.0.1 → 2.0.2

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.
@@ -1,4 +1,6 @@
1
+ $root_dir = Dir.pwd
1
2
  unless defined?(Rtml) && defined?(Rails)
3
+ $rtml_external = true
2
4
  # Now, for some reason, Rails (ActiveSupport?) is removing a lot of existing directories from
3
5
  # the load path. Probably for optimization, but kind of counterproductive for this edge case.
4
6
  # So I'm going to back them up, and then re-add them.
@@ -77,6 +79,4 @@ unless defined?(Rtml) && defined?(Rails)
77
79
  load File.join(File.dirname(__FILE__), '../../tasks/db.rake')
78
80
  load 'tasks/routes.rake'
79
81
  end
80
-
81
- Dir.chdir RAILS_ROOT
82
82
  end
@@ -2,7 +2,7 @@ module Rtml
2
2
  module VERSION
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = (defined?(PRE) ? [MAJOR, MINOR, TINY, PRE] : [MAJOR, MINOR, TINY]).join('.')
8
8
  end
@@ -16,10 +16,9 @@ namespace :rtml do
16
16
  desc "Generates RTML rdoc documentation in ./doc/rtml"
17
17
  Rake::RDocTask.new(:docs) do |rdoc|
18
18
  target_dir = File.expand_path(".")
19
- chdir Rtml.root
20
19
  accessors = Rtml::Widget::RDOC_ACCESSORS.collect { |k,v| "#{k}=#{v}" }.join(",")
21
- files = ['README.rdoc', 'History.txt', 'lib/**/*.rb', 'doc/**/*.rdoc', 'builtin/**/*.rb',
22
- 'rails_generators/*/*.rb']
20
+ files = FileList.new(['README.rdoc', 'History.txt', 'lib/**/*.rb', 'doc/**/*.rdoc', 'builtin/**/*.rb',
21
+ 'rails_generators/*/*.rb'].collect { |fi| File.join(Rtml.root, fi) })
23
22
  rdoc.rdoc_files.add(files)
24
23
  rdoc.main = 'README.rdoc'
25
24
  rdoc.title = 'RubyTML 2.0 Documentation'
@@ -49,6 +48,12 @@ namespace :rtml do
49
48
  if File.exist?(opts)
50
49
  t.spec_opts = ['--options', opts]
51
50
  end
51
+ if $root_dir
52
+ t.ruby_opts << ['-r', File.join(Rtml.root, 'lib/rtml/init')]
53
+ end
54
+ if File.file?(File.join(RAILS_ROOT, "spec/spec_helper"))
55
+ t.ruby_opts << ['-r', File.join(RAILS_ROOT, "spec/spec_helper")]
56
+ end
52
57
  t.spec_files = FileList[File.join(Rtml.root, "spec/**/*_spec.rb")]
53
58
  end
54
59
  else
@@ -56,8 +61,13 @@ namespace :rtml do
56
61
  puts "You need to have rspec, rspec-rails and webrat installed before you can run"
57
62
  puts "in-place testing."
58
63
  puts
59
- puts "Make sure you've also run script/generate rspec, or you'll just see this"
60
- puts "message again."
64
+ if defined?(RAILS_ROOT) && !$rtml_external
65
+ puts "Make sure you've also run script/generate rspec, or you'll just see this"
66
+ puts "message again."
67
+ else
68
+ puts "Make sure you've also got a spec folder, or you'll just see this message"
69
+ puts "again."
70
+ end
61
71
  end
62
72
  end
63
73
 
@@ -2,9 +2,6 @@ unless $rtml_spec_helper_already_loaded
2
2
  $rtml_spec_helper_already_loaded = 1
3
3
  $LOAD_PATH << File.join(File.dirname(__FILE__), 'support/app/controllers')
4
4
 
5
- # this loads the Rails spec helper, if any, and reloads the current spec helper if run outside of a Rails project
6
- # (ie, in the RTML working project dir). Reloading this file is safe thanks to $rtml_spec_helper_already_loaded == 1.
7
- require 'spec_helper'
8
5
  unless defined?(RAILS_ROOT)
9
6
  require File.join(File.dirname(__FILE__), 'support/rails')
10
7
  gem 'rspec-rails'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 1
9
- version: 2.0.1
8
+ - 2
9
+ version: 2.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Colin MacKenzie IV