Skip to content

Commit 20cc949

Browse files
committed
migrate to bundler
1 parent 324dfd3 commit 20cc949

File tree

3 files changed

+67
-116
lines changed

3 files changed

+67
-116
lines changed

Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source "http://rubygems.org"
2+
3+
gemspec
4+
5+
group :test do
6+
gem 'test-unit'
7+
end

Rakefile

Lines changed: 8 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,29 @@
11
#!/usr/bin/env rake
22
# -*- Ruby -*-
33
require 'rubygems'
4-
require 'rake/gempackagetask'
4+
5+
require 'bundler/gem_tasks'
56
require 'rake/rdoctask'
67
require 'rake/testtask'
7-
#require 'rake/extensiontask'
8-
9-
#Rake::ExtensionTask.new('ruby_debug')
10-
11-
SO_NAME = "ruby_debug.so"
12-
13-
# ------- Default Package ----------
14-
RUBY_DEBUG_VERSION = open("ext/ruby_debug/ruby_debug.c") do |f|
15-
f.grep(/^#define DEBUG_VERSION/).first[/"(.+)"/,1]
16-
end
17-
18-
COMMON_FILES = FileList[
19-
'AUTHORS',
20-
'CHANGES',
21-
'LICENSE',
22-
'README',
23-
'Rakefile',
24-
]
258

269
BASE_TEST_FILE_LIST = %w(
2710
test/base/base.rb
2811
test/base/binding.rb
2912
test/base/catchpoint.rb)
30-
BASE_FILES = COMMON_FILES + FileList[
31-
'ext/ruby_debug/breakpoint.c',
32-
'ext/ruby_debug/extconf.rb',
33-
'ext/ruby_debug/ruby_debug.c',
34-
'ext/ruby_debug/ruby_debug.h',
35-
'ext/win32/*',
36-
'lib/**/*',
37-
BASE_TEST_FILE_LIST,
38-
]
39-
40-
# Base GEM Specification
41-
base_spec = Gem::Specification.new do |spec|
42-
spec.name = "ruby-debug-base19x"
43-
44-
spec.homepage = "http://rubyforge.org/projects/ruby-debug/"
45-
spec.summary = "Fast Ruby debugger - core component"
46-
spec.description = <<-EOF
47-
ruby-debug is a fast implementation of the standard Ruby debugger debug.rb.
48-
It is implemented by utilizing a new Ruby C API hook. The core component
49-
provides support that front-ends can build on. It provides breakpoint
50-
handling, bindings for stack frames among other things.
51-
EOF
52-
53-
spec.version = RUBY_DEBUG_VERSION
54-
55-
spec.author = "Kent Sibilev, Mark Moseley"
56-
spec.email = "[email protected]"
57-
spec.platform = Gem::Platform::RUBY
58-
spec.require_path = "lib"
59-
spec.extensions = ["ext/ruby_debug/extconf.rb"]
60-
spec.files = BASE_FILES.to_a
61-
62-
spec.required_ruby_version = '>= 1.8.2'
63-
spec.date = Time.now
64-
spec.rubyforge_project = 'ruby-debug19'
65-
spec.add_dependency('columnize', [">= 0.3.1"])
66-
spec.add_dependency('ruby_core_source', [">= 0.1.4"])
67-
spec.add_dependency('linecache19', [">= 0.5.11"])
68-
69-
spec.test_files = FileList[BASE_TEST_FILE_LIST]
70-
71-
# rdoc
72-
spec.has_rdoc = true
73-
spec.extra_rdoc_files = ['README', 'ext/ruby_debug/ruby_debug.c']
74-
end
7513

14+
task :default => [:test_base]
7615

77-
# Rake task to build the default package
78-
Rake::GemPackageTask.new(base_spec) do |pkg|
79-
pkg.need_tar = true
80-
end
81-
82-
task :default => [:package]
83-
84-
# Windows specification
85-
win_spec = base_spec.clone
86-
win_spec.extensions = []
87-
## win_spec.platform = Gem::Platform::WIN32 # deprecated
88-
win_spec.platform = 'mswin32'
89-
win_spec.files += ["lib/#{SO_NAME}"]
90-
91-
desc "Create Windows Gem"
92-
task :win32_gem do
93-
# Copy the win32 extension the top level directory
94-
current_dir = File.expand_path(File.dirname(__FILE__))
95-
source = File.join(current_dir, "ext", "win32", SO_NAME)
96-
target = File.join(current_dir, "lib", SO_NAME)
97-
cp(source, target)
98-
99-
# Create the gem, then move it to pkg.
100-
Gem::Builder.new(win_spec).build
101-
gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
102-
mv(gem_file, "pkg/#{gem_file}")
103-
104-
# Remove win extension from top level directory.
105-
rm(target)
106-
end
107-
108-
desc "Publish ruby-debug to RubyForge."
109-
task :publish do
110-
require 'rake/contrib/sshpublisher'
111-
112-
# Get ruby-debug path.
113-
ruby_debug_path = File.expand_path(File.dirname(__FILE__))
114-
115-
Rake::SshDirPublisher.new("[email protected]",
116-
"/var/www/gforge-projects/ruby-debug", ruby_debug_path)
117-
end
118-
119-
desc "Remove built files"
120-
task :clean do
121-
cd "ext" do
122-
if File.exists?("Makefile")
123-
sh "make clean"
124-
rm "Makefile"
125-
end
126-
derived_files = Dir.glob(".o") + Dir.glob("*.so")
127-
rm derived_files unless derived_files.empty?
16+
desc "Create the core ruby-debug shared library extension"
17+
task :lib do
18+
Dir.chdir("ext/ruby_debug") do
19+
system("#{Gem.ruby} extconf.rb && make")
12820
end
12921
end
13022

13123
desc "Test ruby-debug-base."
13224
task :test_base => :lib do
13325
Rake::TestTask.new(:test_base) do |t|
134-
t.libs += ['./ext', './lib']
26+
t.libs += ['./ext/ruby_debug', './lib']
13527
t.test_files = FileList[BASE_TEST_FILE_LIST]
13628
t.verbose = true
13729
end

ruby-debug-base19x.gemspec

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
RUBY_DEBUG_VERSION = open("ext/ruby_debug/ruby_debug.c") do |f|
2+
f.grep(/^#define DEBUG_VERSION/).first[/"(.+)"/,1]
3+
end unless defined? RUBY_DEBUG_VERSION
4+
5+
unless defined? FILES
6+
FILES = [
7+
'AUTHORS',
8+
'CHANGES',
9+
'LICENSE',
10+
'README',
11+
'Rakefile',
12+
'ext/ruby_debug/breakpoint.c',
13+
'ext/ruby_debug/extconf.rb',
14+
'ext/ruby_debug/ruby_debug.c',
15+
'ext/ruby_debug/ruby_debug.h',
16+
]
17+
FILES.push(*Dir['lib/**/*'])
18+
end
19+
20+
Gem::Specification.new do |spec|
21+
spec.name = "ruby-debug-base19x"
22+
23+
spec.homepage = "https://github.com/denofevil/ruby-debug-base19"
24+
spec.summary = "Fast Ruby debugger - core component"
25+
spec.description = <<-EOF
26+
ruby-debug is a fast implementation of the standard Ruby debugger debug.rb.
27+
It is implemented by utilizing a new Ruby C API hook. The core component
28+
provides support that front-ends can build on. It provides breakpoint
29+
handling, bindings for stack frames among other things.
30+
EOF
31+
32+
spec.version = RUBY_DEBUG_VERSION
33+
34+
spec.author = "Kent Sibilev, Mark Moseley"
35+
spec.email = "[email protected]"
36+
spec.platform = Gem::Platform::RUBY
37+
spec.require_path = "lib"
38+
spec.extensions = ["ext/ruby_debug/extconf.rb"]
39+
spec.files = FILES
40+
41+
spec.required_ruby_version = '>= 1.8.2'
42+
spec.date = Time.now
43+
spec.rubyforge_project = 'ruby-debug19'
44+
spec.add_dependency('columnize', [">= 0.3.1"])
45+
spec.add_dependency('ruby_core_source', [">= 0.1.4"])
46+
spec.add_dependency('linecache19', [">= 0.5.11"])
47+
spec.add_dependency("rake", ">= 0.8.1")
48+
49+
# rdoc
50+
spec.has_rdoc = true
51+
spec.extra_rdoc_files = ['README', 'ext/ruby_debug/ruby_debug.c']
52+
end

0 commit comments

Comments
 (0)