gorp 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -0
- data/gorp.gemspec +8 -2
- data/lib/gorp.rb +3 -69
- data/lib/gorp/env.rb +1 -1
- data/lib/gorp/test.rb +2 -1
- data/lib/version.rb +1 -1
- metadata +22 -2
data/Rakefile
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.15.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-25}
|
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
|
@@ -32,30 +32,36 @@ Gem::Specification.new do |s|
|
|
32
32
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
33
33
|
s.add_runtime_dependency(%q<builder>, [">= 0"])
|
34
34
|
s.add_runtime_dependency(%q<erubis>, [">= 0"])
|
35
|
+
s.add_runtime_dependency(%q<i18n>, [">= 0"])
|
35
36
|
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
36
37
|
s.add_runtime_dependency(%q<rack-mount>, [">= 0"])
|
37
38
|
s.add_runtime_dependency(%q<rack-test>, [">= 0"])
|
38
39
|
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
39
40
|
s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 0"])
|
41
|
+
s.add_runtime_dependency(%q<test-unit>, [">= 0"])
|
40
42
|
s.add_runtime_dependency(%q<tzinfo>, [">= 0"])
|
41
43
|
else
|
42
44
|
s.add_dependency(%q<builder>, [">= 0"])
|
43
45
|
s.add_dependency(%q<erubis>, [">= 0"])
|
46
|
+
s.add_dependency(%q<i18n>, [">= 0"])
|
44
47
|
s.add_dependency(%q<rack>, [">= 0"])
|
45
48
|
s.add_dependency(%q<rack-mount>, [">= 0"])
|
46
49
|
s.add_dependency(%q<rack-test>, [">= 0"])
|
47
50
|
s.add_dependency(%q<rake>, [">= 0"])
|
48
51
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
52
|
+
s.add_dependency(%q<test-unit>, [">= 0"])
|
49
53
|
s.add_dependency(%q<tzinfo>, [">= 0"])
|
50
54
|
end
|
51
55
|
else
|
52
56
|
s.add_dependency(%q<builder>, [">= 0"])
|
53
57
|
s.add_dependency(%q<erubis>, [">= 0"])
|
58
|
+
s.add_dependency(%q<i18n>, [">= 0"])
|
54
59
|
s.add_dependency(%q<rack>, [">= 0"])
|
55
60
|
s.add_dependency(%q<rack-mount>, [">= 0"])
|
56
61
|
s.add_dependency(%q<rack-test>, [">= 0"])
|
57
62
|
s.add_dependency(%q<rake>, [">= 0"])
|
58
63
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
64
|
+
s.add_dependency(%q<test-unit>, [">= 0"])
|
59
65
|
s.add_dependency(%q<tzinfo>, [">= 0"])
|
60
66
|
end
|
61
67
|
end
|
data/lib/gorp.rb
CHANGED
@@ -8,10 +8,12 @@ require 'open3'
|
|
8
8
|
require 'net/http'
|
9
9
|
require 'builder'
|
10
10
|
require 'stringio'
|
11
|
-
require 'gorp/env'
|
12
11
|
require 'time'
|
13
12
|
require 'cgi'
|
14
13
|
|
14
|
+
require 'gorp/env'
|
15
|
+
require 'gorp/edit'
|
16
|
+
|
15
17
|
require 'rbconfig'
|
16
18
|
$ruby = File.join(Config::CONFIG["bindir"], Config::CONFIG["RUBY_INSTALL_NAME"])
|
17
19
|
|
@@ -48,19 +50,6 @@ RUNFILE = File.join($WORK, 'status.run')
|
|
48
50
|
open(RUNFILE,'w') {|running| running.puts(Process.pid)}
|
49
51
|
at_exit { FileUtils.rm_f RUNFILE }
|
50
52
|
|
51
|
-
class String
|
52
|
-
def unindent(n)
|
53
|
-
gsub Regexp.new("^#{' '*n}"), ''
|
54
|
-
end
|
55
|
-
def indent(n)
|
56
|
-
gsub /^/, ' '*n
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def read name
|
61
|
-
open(File.join($DATA, name)) {|file| file.read}
|
62
|
-
end
|
63
|
-
|
64
53
|
def overview message
|
65
54
|
$x.p message.gsub(/(^|\n)\s+/, ' ').strip, :class=>'overview'
|
66
55
|
end
|
@@ -203,61 +192,6 @@ def irb file
|
|
203
192
|
end
|
204
193
|
end
|
205
194
|
|
206
|
-
def edit filename, tag=nil
|
207
|
-
$x.pre "edit #{filename}", :class=>'stdin'
|
208
|
-
|
209
|
-
stale = File.mtime(filename) rescue Time.now-2
|
210
|
-
data = open(filename) {|file| file.read} rescue ''
|
211
|
-
before = data.split("\n")
|
212
|
-
|
213
|
-
begin
|
214
|
-
yield data
|
215
|
-
|
216
|
-
now = Time.now
|
217
|
-
usec = now.usec/1000000.0
|
218
|
-
sleep 1-usec if now-usec <= stale
|
219
|
-
open(filename,'w') {|file| file.write data}
|
220
|
-
File.utime(stale+2, stale+2, filename) if File.mtime(filename) <= stale
|
221
|
-
|
222
|
-
rescue Exception => e
|
223
|
-
$x.pre :class => 'traceback' do
|
224
|
-
STDERR.puts e.inspect
|
225
|
-
$x.text! "#{e.inspect}\n"
|
226
|
-
e.backtrace.each {|line| $x.text! " #{line}\n"}
|
227
|
-
end
|
228
|
-
tag = nil
|
229
|
-
|
230
|
-
ensure
|
231
|
-
log :edit, filename
|
232
|
-
|
233
|
-
include = tag.nil?
|
234
|
-
hilight = false
|
235
|
-
data.split("\n").each do |line|
|
236
|
-
if line =~ /START:(\w+)/
|
237
|
-
include = true if $1 == tag
|
238
|
-
elsif line =~ /END:(\w+)/
|
239
|
-
include = false if $1 == tag
|
240
|
-
elsif line =~ /START_HIGHLIGHT/
|
241
|
-
hilight = true
|
242
|
-
elsif line =~ /END_HIGHLIGHT/
|
243
|
-
hilight = false
|
244
|
-
elsif include
|
245
|
-
if hilight or ! before.include?(line)
|
246
|
-
outclass='hilight'
|
247
|
-
else
|
248
|
-
outclass='stdout'
|
249
|
-
end
|
250
|
-
|
251
|
-
if line.empty?
|
252
|
-
$x.pre ' ', :class=>outclass
|
253
|
-
else
|
254
|
-
$x.pre line, :class=>outclass
|
255
|
-
end
|
256
|
-
end
|
257
|
-
end
|
258
|
-
end
|
259
|
-
end
|
260
|
-
|
261
195
|
# pluggable XML parser support
|
262
196
|
begin
|
263
197
|
raise LoadError if ARGV.include? 'rexml'
|
data/lib/gorp/env.rb
CHANGED
data/lib/gorp/test.rb
CHANGED
@@ -88,8 +88,9 @@ class Book::TestCase < ActiveSupport::TestCase
|
|
88
88
|
@raw =~ /<pre\sclass="stdin">edit\s([\w\/.]+)<\/pre>\s+
|
89
89
|
<pre\sclass="traceback">\s+
|
90
90
|
\#<IndexError:\sregexp\snot\smatched>\s+
|
91
|
+
(.*gorp\/lib\/gorp\/edit.rb.*\n\s+)*
|
91
92
|
([\w\/.]+:\d+)/x
|
92
|
-
fail "
|
93
|
+
fail "Edit #{$1} failed at #{$3}" if $1
|
93
94
|
end
|
94
95
|
|
95
96
|
attr_reader :raw
|
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.15.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-25 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -32,6 +32,16 @@ dependencies:
|
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: "0"
|
34
34
|
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: i18n
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
35
45
|
- !ruby/object:Gem::Dependency
|
36
46
|
name: rack
|
37
47
|
type: :runtime
|
@@ -82,6 +92,16 @@ dependencies:
|
|
82
92
|
- !ruby/object:Gem::Version
|
83
93
|
version: "0"
|
84
94
|
version:
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: test-unit
|
97
|
+
type: :runtime
|
98
|
+
version_requirement:
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: "0"
|
104
|
+
version:
|
85
105
|
- !ruby/object:Gem::Dependency
|
86
106
|
name: tzinfo
|
87
107
|
type: :runtime
|