gorp 0.9.0 → 0.10.0
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.
- data/Manifest +0 -8
- data/gorp.gemspec +2 -2
- data/lib/gorp.rb +11 -8
- data/lib/gorp/test.rb +7 -13
- data/lib/version.rb +1 -1
- metadata +2 -2
data/Manifest
CHANGED
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.
|
5
|
+
s.version = "0.10.0"
|
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{2009-12-
|
9
|
+
s.date = %q{2009-12-03}
|
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.rb
CHANGED
@@ -16,12 +16,9 @@ $ruby = File.join(Config::CONFIG["bindir"], Config::CONFIG["RUBY_INSTALL_NAME"])
|
|
16
16
|
# indicate that a given step should be omitted
|
17
17
|
def omit *sections
|
18
18
|
sections.each do |section|
|
19
|
-
STDERR.puts section.inspect
|
20
19
|
section = [section] unless section.respond_to? :include?
|
21
|
-
STDERR.puts section.inspect
|
22
20
|
$omit << Range.new(secsplit(section.first), secsplit(section.last))
|
23
21
|
end
|
24
|
-
STDERR.puts $omit.inspect
|
25
22
|
end
|
26
23
|
|
27
24
|
# Micro DSL for declaring an ordered set of book sections
|
@@ -629,7 +626,6 @@ at_exit do
|
|
629
626
|
bounds = arg.split(/-|\.\./)
|
630
627
|
Range.new(secsplit(bounds.first), secsplit(bounds.last))
|
631
628
|
end
|
632
|
-
ARGV.push 'partial' unless ranges.empty? and $omit.empty?
|
633
629
|
|
634
630
|
# optionally save a snapshot
|
635
631
|
if ARGV.include? 'restore'
|
@@ -648,10 +644,17 @@ at_exit do
|
|
648
644
|
e = nil
|
649
645
|
begin
|
650
646
|
$sections.each do |section, title, steps|
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
647
|
+
omit = secinclude($omit, section)
|
648
|
+
omit ||= (!ranges.empty? and !secinclude(ranges, section))
|
649
|
+
|
650
|
+
if omit
|
651
|
+
$x.a(:class => 'omit', :id => "section-#{section}") do
|
652
|
+
$x.comment! title
|
653
|
+
end
|
654
|
+
else
|
655
|
+
head section, title
|
656
|
+
steps.call
|
657
|
+
end
|
655
658
|
end
|
656
659
|
rescue Exception => e
|
657
660
|
$x.pre :class => 'traceback' do
|
data/lib/gorp/test.rb
CHANGED
@@ -2,20 +2,11 @@ require 'test/unit'
|
|
2
2
|
require 'builder'
|
3
3
|
require 'gorp/env'
|
4
4
|
|
5
|
-
|
6
|
-
# installed Rails (2.3.3 ish)
|
5
|
+
$:.unshift "#{$WORK}/depot/vendor/rails/activesupport/lib"
|
7
6
|
require 'active_support'
|
8
|
-
$:.unshift "#{$WORK}/depot/vendor/rails/activesupport/lib"
|
9
7
|
require 'active_support/version'
|
10
|
-
|
11
|
-
|
12
|
-
# testing Rails (3.0 ish)
|
13
|
-
$:.unshift "#{$WORK}/depot/vendor/rails/activesupport/lib"
|
14
|
-
require 'active_support'
|
15
|
-
require 'active_support/version'
|
16
|
-
end
|
17
|
-
|
18
|
-
require 'active_support/test_case'
|
8
|
+
require 'active_support/test_case'
|
9
|
+
$:.shift
|
19
10
|
|
20
11
|
module Book
|
21
12
|
end
|
@@ -42,7 +33,7 @@ class Book::TestCase < ActiveSupport::TestCase
|
|
42
33
|
# micro DSL allowing the definition of optional tests
|
43
34
|
def self.section number, title, &tests
|
44
35
|
number = (sprintf "%f", number).sub(/0+$/,'') if number.kind_of? Float
|
45
|
-
return if
|
36
|
+
return if @@omit.include? number.to_s
|
46
37
|
test "#{number} #{title}" do
|
47
38
|
instance_eval {select number}
|
48
39
|
instance_eval &tests
|
@@ -61,6 +52,9 @@ class Book::TestCase < ActiveSupport::TestCase
|
|
61
52
|
@@sections[-1], env = @@sections.last.split(/<a class="toc" id="env">/)
|
62
53
|
env, todos = env.split(/<a class="toc" id="todos">/)
|
63
54
|
|
55
|
+
# split into sections
|
56
|
+
@@omit = body.split(/<a class="omit" id="section-(.*?)">/)
|
57
|
+
|
64
58
|
# convert to a Hash
|
65
59
|
@@sections = Hash[*@@sections.unshift(:contents)]
|
66
60
|
@@sections[:head] = head
|
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.
|
4
|
+
version: 0.10.0
|
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: 2009-12-
|
12
|
+
date: 2009-12-03 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|