gorp 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -1,8 +0,0 @@
1
- Manifest
2
- README
3
- Rakefile
4
- gorp.gemspec
5
- lib/gorp.rb
6
- lib/gorp/env.rb
7
- lib/gorp/test.rb
8
- lib/version.rb
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.9.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-02}
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
- next if !ranges.empty? and !secinclude(ranges, section)
652
- next if secinclude($omit, section)
653
- head section, title
654
- steps.call
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
- begin
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
- $:.shift
11
- rescue LoadError
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 ARGV.include? 'partial' and !@@sections.has_key? number.to_s
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
@@ -1,7 +1,7 @@
1
1
  module Gorp
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 9
4
+ MINOR = 10
5
5
  TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
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.9.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-02 00:00:00 -05:00
12
+ date: 2009-12-03 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency