irt 1.2.7 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/irt +8 -1
- data/lib/irt/commands/core.rb +2 -2
- data/lib/irt/directives/test.rb +8 -5
- data/lib/irt.rb +0 -7
- metadata +2 -3
- data/lib/irt/extensions/debugger.rb +0 -39
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.8
|
data/bin/irt
CHANGED
@@ -96,8 +96,10 @@ cmd_format = if File.exists?('./config/environment.rb') && !options[:no_rails]
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
99
|
+
rails_version = gemfile.match(/\bgem\b.+\brails\b.+3\.0\.\d/) ? '=3.0.*' : '>=3.1.*'
|
99
100
|
'rails c %s %s %s'
|
100
101
|
elsif File.exists?('./script/console')
|
102
|
+
rails_version = '2.*'
|
101
103
|
'ruby script/console --irb="irt_rails2 %2$s" %1$s %3$s'
|
102
104
|
end
|
103
105
|
else
|
@@ -107,6 +109,11 @@ cmd_format = if File.exists?('./config/environment.rb') && !options[:no_rails]
|
|
107
109
|
ENV['IRT_INTERACTIVE_EOF'] = options[:interactive_eof].inspect if options[:interactive_eof]
|
108
110
|
|
109
111
|
files.each do |file|
|
110
|
-
ENV['IRT_COMMAND'] =
|
112
|
+
ENV['IRT_COMMAND'] = case rails_version
|
113
|
+
when '2.*', '=3.0.*'
|
114
|
+
sprintf cmd_format, options[:irb_options], file, options[:rails_env]
|
115
|
+
when '>=3.1.*'
|
116
|
+
sprintf cmd_format, options[:rails_env], options[:irb_options], file
|
117
|
+
end
|
111
118
|
exit(1) unless system ENV['IRT_COMMAND']
|
112
119
|
end
|
data/lib/irt/commands/core.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
module IRT
|
2
2
|
module Commands
|
3
3
|
module Core
|
4
|
-
extend self
|
5
4
|
|
6
5
|
def irt(obj=nil)
|
7
|
-
context ||= IRB.CurrentContext
|
8
6
|
irt_mode = context.irt_mode
|
9
7
|
to_mode = case obj
|
10
8
|
when nil
|
@@ -46,6 +44,8 @@ module IRT
|
|
46
44
|
|
47
45
|
def rerun
|
48
46
|
ensure_session
|
47
|
+
Directives::Test.test_summary
|
48
|
+
Directives::Test.reset_variables
|
49
49
|
IRT::Session.run_file
|
50
50
|
end
|
51
51
|
alias_method :rr, :rerun
|
data/lib/irt/directives/test.rb
CHANGED
@@ -3,11 +3,14 @@ module IRT
|
|
3
3
|
module Test
|
4
4
|
extend self
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
def reset_variables
|
7
|
+
@@tests = 0
|
8
|
+
@@oks = 0
|
9
|
+
@@diffs = 0
|
10
|
+
@@errors = 0
|
11
|
+
@@last_desc = nil
|
12
|
+
end
|
13
|
+
reset_variables
|
11
14
|
|
12
15
|
def desc(description)
|
13
16
|
@@last_desc = description
|
data/lib/irt.rb
CHANGED
@@ -153,12 +153,6 @@ module IRT
|
|
153
153
|
|
154
154
|
end
|
155
155
|
|
156
|
-
# before we patch irb
|
157
|
-
if defined?(Debugger)
|
158
|
-
require 'ruby-debug/command'
|
159
|
-
require 'ruby-debug/commands/irb'
|
160
|
-
end
|
161
|
-
|
162
156
|
require 'irt/extensions/irb'
|
163
157
|
require 'irb/completion'
|
164
158
|
IRT.init_config
|
@@ -167,6 +161,5 @@ require 'irt/extensions/object'
|
|
167
161
|
require 'irt/extensions/method'
|
168
162
|
require 'irt/prompter'
|
169
163
|
require 'irt/extensions/rails' if defined?(ActiveSupport::BufferedLogger)
|
170
|
-
require 'irt/extensions/debugger' if defined?(Debugger)
|
171
164
|
|
172
165
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: irt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.2.
|
5
|
+
version: 1.2.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Domizio Demichelis
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-08-
|
13
|
+
date: 2011-08-05 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -80,7 +80,6 @@ files:
|
|
80
80
|
- lib/irt/differ.rb
|
81
81
|
- lib/irt/directives.rb
|
82
82
|
- lib/irt/directives/test.rb
|
83
|
-
- lib/irt/extensions/debugger.rb
|
84
83
|
- lib/irt/extensions/irb.rb
|
85
84
|
- lib/irt/extensions/irb/commands.rb
|
86
85
|
- lib/irt/extensions/irb/context.rb
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module IRB
|
2
|
-
|
3
|
-
def self.start_session(bind)
|
4
|
-
IRT.start
|
5
|
-
IRT::Session.enter :binding, bind
|
6
|
-
end
|
7
|
-
|
8
|
-
class Context
|
9
|
-
alias_method :evaluate_without_debugger, :evaluate
|
10
|
-
def evaluate(line, line_no)
|
11
|
-
$rdebug_irb_statements = line
|
12
|
-
evaluate_without_debugger line, line_no
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
module Kernel
|
19
|
-
alias_method :original_irt, :irt
|
20
|
-
def irt(bind=nil)
|
21
|
-
IRT.start
|
22
|
-
IRT::Commands::Core.irt(bind)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
module IRT
|
27
|
-
module Session
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def set_binding_file_pointers(context)
|
32
|
-
context.binding_file = Debugger.current_context.frame_file
|
33
|
-
context.binding_line_no = Debugger.current_context.frame_line
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
|