gorp 0.18.2 → 0.18.3
Sign up to get free protection for your applications and to get access to all the features.
- data/gorp.gemspec +2 -2
- data/lib/gorp/edit.rb +5 -1
- data/lib/gorp/rails.rb +6 -3
- data/lib/gorp/test.rb +24 -21
- data/lib/version.rb +1 -1
- metadata +2 -2
data/gorp.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{gorp}
|
5
|
-
s.version = "0.18.
|
5
|
+
s.version = "0.18.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sam Ruby"]
|
9
|
-
s.date = %q{2010-01-
|
9
|
+
s.date = %q{2010-01-02}
|
10
10
|
s.description = %q{ Enables the creation of scenarios that involve creating a rails project,
|
11
11
|
starting and stoppping of servers, generating projects, editing files,
|
12
12
|
issuing http requests, running of commands, etc. Output is captured as
|
data/lib/gorp/edit.rb
CHANGED
@@ -54,7 +54,7 @@ module Gorp
|
|
54
54
|
base.extend Gorp::StringEditingFunctions
|
55
55
|
yield base if block_given?
|
56
56
|
base.highlight if options.include? :highlight
|
57
|
-
base.mark(options.last[:mark]) if options.last.respond_to? :
|
57
|
+
base.mark(options.last[:mark]) if options.last.respond_to? :keys
|
58
58
|
base
|
59
59
|
end
|
60
60
|
end
|
@@ -72,6 +72,10 @@ module Gorp
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
+
def dup
|
76
|
+
super.extend(Gorp::StringEditingFunctions)
|
77
|
+
end
|
78
|
+
|
75
79
|
def clear_highlights
|
76
80
|
self.gsub! /^\s*(#|<!--)\s*(START|END)_HIGHLIGHT(\s*-->)?\n/, ''
|
77
81
|
end
|
data/lib/gorp/rails.rb
CHANGED
@@ -30,11 +30,14 @@ else
|
|
30
30
|
end
|
31
31
|
|
32
32
|
if $?.success?
|
33
|
-
#
|
34
|
-
FileUtils.
|
33
|
+
# setup vendored environment
|
34
|
+
FileUtils.mkdir_p File.join($WORK, 'vendor', 'gems')
|
35
|
+
FileUtils.rm_f File.join($WORK, 'vendor', 'rails')
|
35
36
|
unless $rails =~ /^rails( |$)/
|
36
|
-
FileUtils.ln_s $rails, File.join($WORK, 'rails')
|
37
|
+
FileUtils.ln_s $rails, File.join($WORK, 'vendor', 'rails')
|
37
38
|
end
|
39
|
+
FileUtils.cp File.join(File.dirname(__FILE__), 'rails.env'),
|
40
|
+
File.join($WORK, 'vendor', 'gems', 'environment.rb')
|
38
41
|
else
|
39
42
|
puts "Install rails or specify path to git clone of rails as the " +
|
40
43
|
"first argument."
|
data/lib/gorp/test.rb
CHANGED
@@ -1,14 +1,32 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require 'builder'
|
3
3
|
require 'gorp/env'
|
4
|
+
require 'gorp/edit'
|
4
5
|
require 'gorp/rails'
|
5
6
|
require 'gorp/commands'
|
6
7
|
|
7
|
-
|
8
|
-
require
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
if File.exist? "#{$WORK}/vendor/gems/environment.rb"
|
9
|
+
require "#{$WORK}/vendor/gems/environment.rb"
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'active_support'
|
13
|
+
require 'active_support/version'
|
14
|
+
require 'active_support/test_case'
|
15
|
+
|
16
|
+
# just enough infrastructure to get 'assert_select' to work
|
17
|
+
require 'action_controller'
|
18
|
+
begin
|
19
|
+
# Rails (2.3.3 ish)
|
20
|
+
require 'action_controller/assertions/selector_assertions'
|
21
|
+
include ActionController::Assertions::SelectorAssertions
|
22
|
+
rescue LoadError
|
23
|
+
# Rails (3.0 ish)
|
24
|
+
require 'action_dispatch/testing/assertions'
|
25
|
+
require 'action_dispatch/testing/assertions/selector'
|
26
|
+
include ActionDispatch::Assertions::SelectorAssertions
|
27
|
+
end
|
28
|
+
require 'action_controller/vendor/html-scanner/html/tokenizer'
|
29
|
+
require 'action_controller/vendor/html-scanner/html/document'
|
12
30
|
|
13
31
|
module Gorp
|
14
32
|
class BuilderTee < BlankSlate
|
@@ -25,21 +43,6 @@ module Gorp
|
|
25
43
|
end
|
26
44
|
|
27
45
|
class Gorp::TestCase < ActiveSupport::TestCase
|
28
|
-
# just enough infrastructure to get 'assert_select' to work
|
29
|
-
$:.unshift "#{$WORK}/rails/actionpack/lib"
|
30
|
-
require 'action_controller'
|
31
|
-
begin
|
32
|
-
# Rails (2.3.3 ish)
|
33
|
-
require 'action_controller/assertions/selector_assertions'
|
34
|
-
include ActionController::Assertions::SelectorAssertions
|
35
|
-
rescue LoadError
|
36
|
-
# Rails (3.0 ish)
|
37
|
-
require 'action_dispatch/testing/assertions'
|
38
|
-
require 'action_dispatch/testing/assertions/selector'
|
39
|
-
include ActionDispatch::Assertions::SelectorAssertions
|
40
|
-
end
|
41
|
-
require 'action_controller/vendor/html-scanner/html/tokenizer'
|
42
|
-
require 'action_controller/vendor/html-scanner/html/document'
|
43
46
|
|
44
47
|
# micro DSL allowing the definition of optional tests
|
45
48
|
def self.section number, title, &tests
|
@@ -139,7 +142,7 @@ class Gorp::TestCase < ActiveSupport::TestCase
|
|
139
142
|
@@base = Object.new.extend(Gorp::Commands)
|
140
143
|
include Gorp::Commands
|
141
144
|
|
142
|
-
%w(cmd rake).each do |method|
|
145
|
+
%w(cmd get post rake ruby).each do |method|
|
143
146
|
define_method(method) do |*args, &block|
|
144
147
|
begin
|
145
148
|
$y = Builder::XmlMarkup.new(:indent => 2)
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-02 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|