Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ os:
- osx

rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1.10
Expand All @@ -25,6 +26,9 @@ matrix:
- os: osx
rvm: 2.0.0

- os: osx
rvm: 1.8.7

# include:
# - os: osx
# rvm: 1.9.3
Expand Down
26 changes: 18 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ source "http://rubygems.org"
# @param [Array<String>] versions compatible ruby versions
# @return [Array<String>] an array with mri platforms of given versions
def mries(*versions)
versions.flat_map do |v|
%w(ruby mingw x64_mingw)
.map { |platform| "#{platform}_#{v}".to_sym unless platform == "x64_mingw" && v < "2.0" }
.delete_if &:nil?
end
versions.map do |v|
%w(ruby mingw x64_mingw).map do |platform|
"#{platform}_#{v}".to_sym unless platform == "x64_mingw" && v < "2.0"
end.delete_if &:nil?
end.flatten
end

if RUBY_VERSION < '1.9' || defined?(JRUBY_VERSION)
gem "ruby-debug-base", :platforms => [:jruby, *mries('18')]
end

if RUBY_VERSION && RUBY_VERSION >= "1.9"
gem "ruby-debug-base19x", ">= 0.11.32", :platforms => mries('19')
end

gem "ruby-debug-base", :platforms => [:jruby, *mries('18')]
gem "ruby-debug-base19x", ">= 0.11.32", :platforms => mries('19')
if RUBY_VERSION && RUBY_VERSION >= "2.0"
gem "debase", "~> 0.2", ">= 0.2.2", :platforms => mries('20', '21', '22', '23', '24', '25')
end
Expand All @@ -23,6 +29,10 @@ group :development do
end

group :test do
gem "test-unit"
if RUBY_VERSION < "1.9"
gem "test-unit", "~> 2.1.2"
else
gem "test-unit"
end
end

2 changes: 1 addition & 1 deletion lib/ruby-debug-ide/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Debugger
IDE_VERSION='0.7.0.beta6'
IDE_VERSION='0.7.0.beta7'
end
3 changes: 1 addition & 2 deletions lib/ruby-debug-ide/xml_printer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,7 @@ def print_load_result(file, exception = nil)
end

def print_element(name, additional_tags = nil)
additional_tags_presentation = additional_tags.nil? ? ''
: additional_tags.map {|tag, value| " #{tag}=\"#{value}\""}.reduce(:+)
additional_tags_presentation = additional_tags.nil? ? '' : additional_tags.map {|tag, value| " #{tag}=\"#{value}\""}.reduce(:+)

print("<#{name}#{additional_tags_presentation}>")
begin
Expand Down
4 changes: 4 additions & 0 deletions test-base/inspect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def test_inspect_expr_with_timeout
end

def test_inspect_failing_expr_with_timeout
if RUBY_VERSION < "1.9"
@process_finished = true
return
end
create_socket ["require 'timeout'", "puts 'test'"]
run_to_line(2)
send_ruby("v inspect (Timeout::timeout(0.1) { sleep 0.2 })")
Expand Down
9 changes: 6 additions & 3 deletions test-base/test_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ def TestBase.find_free_port(port = 1098)
end

def create_file(script_name, lines)
script_path = File.realdirpath(File.join(TMP_DIR, script_name))

file = File.join(TMP_DIR, script_name)
script_path = RUBY_VERSION >= "1.9" ? File.realdirpath(file) : file.to_s

File.open(script_path, "w") do |script|
script.printf(lines.join("\n"))
end
Expand All @@ -142,7 +143,9 @@ def create_file(script_name, lines)

def create_test2(lines)
@test2_name = "test2.rb"
@test2_path = create_file(@test2_name, lines).force_encoding(Encoding::UTF_8)
@test2_path = create_file(@test2_name, lines)

@test2_path = @test2_path.force_encoding(Encoding::UTF_8) if RUBY_VERSION >= "1.9"
end

# Creates test.rb with the given lines, set up @test_name and @test_path
Expand Down
20 changes: 17 additions & 3 deletions test-base/variables_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def test_variable_local
end

def test_variable_instance
create_socket ["require_relative 'test2.rb'", "custom_object=Test2.new", "puts custom_object"]
require_string = RUBY_VERSION < "1.9" ? "require" : "require_relative"

create_socket ["#{require_string} 'test2.rb'", "custom_object=Test2.new", "puts custom_object"]
create_test2 ["class Test2", "def initialize", "@y=5", "end", "def to_s", "'test'", "end", "end"]
run_to("test2.rb", 6)
frame_number = 3
Expand Down Expand Up @@ -130,8 +132,9 @@ def test_variable_hash_with_string_keys
assert_variables(read_variables, 1,
{:name => "hash", :hasChildren => true})
send_ruby("v i hash")
expected_name = CGI::escapeHTML("'a'")
assert_variables(read_variables, 2,
{:name => CGI.escape_html("'a'"), :value => "z", :type => "String"})
{:name => expected_name, :value => "z", :type => "String"})
send_cont
end

Expand Down Expand Up @@ -228,7 +231,13 @@ def test_new_hash_presentation

send_ruby("v i b")

assert_variables(read_variables, 6,
variables = []

read_variables.each_slice(2) do |var|
variables << var
end

assert_variables(variables.sort_by{|a| a[0].value}.flatten, 6,
{:name => "key", :value => "1"},
{:name => "value", :value => "A instance", :type => "A"},

Expand All @@ -241,6 +250,11 @@ def test_new_hash_presentation
end

def test_to_s_timelimit
#no TracePointApi for old versions
if RUBY_VERSION <= "1.9"
@process_finished = true
return
end
create_socket ['class A',
'def to_s',
'a = 1',
Expand Down