rake-compiler 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +32 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +258 -0
- data/Rakefile +23 -0
- data/bin/rake-compiler +24 -0
- data/cucumber.yml +1 -0
- data/features/compile.feature +71 -0
- data/features/cross-compile.feature +13 -0
- data/features/cross-package.feature +14 -0
- data/features/package.feature +40 -0
- data/features/step_definitions/compilation.rb +43 -0
- data/features/step_definitions/cross_compilation.rb +21 -0
- data/features/step_definitions/execution.rb +30 -0
- data/features/step_definitions/folders.rb +32 -0
- data/features/step_definitions/gem.rb +29 -0
- data/features/support/env.rb +7 -0
- data/features/support/file_templates.rb +88 -0
- data/features/support/generators.rb +77 -0
- data/lib/rake/extensiontask.rb +270 -0
- data/spec/lib/rake/extensiontask_spec.rb +352 -0
- data/spec/spec_helper.rb +9 -0
- data/tasks/bin/cross-ruby.rake +159 -0
- data/tasks/common.rake +13 -0
- data/tasks/cucumber.rake +14 -0
- data/tasks/gem.rake +59 -0
- data/tasks/rdoc.rake +9 -0
- data/tasks/release.rake +79 -0
- data/tasks/rspec.rake +33 -0
- metadata +97 -0
data/tasks/release.rake
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
begin
|
2
|
+
gem 'rubyforge', '~> 1.0.1'
|
3
|
+
require 'rubyforge'
|
4
|
+
rescue Exception
|
5
|
+
nil
|
6
|
+
end
|
7
|
+
|
8
|
+
if defined?(RubyForge) then
|
9
|
+
if defined?(GEM_SPEC) then
|
10
|
+
task :release => [:clobber, :package] do |t|
|
11
|
+
ver = ENV['VERSION'] or fail "Must supply VERSION (rake release VERSION=x.y.z)."
|
12
|
+
|
13
|
+
# compare versions to avoid mistakes
|
14
|
+
unless ver == GEM_SPEC.version.to_s then
|
15
|
+
fail "Version mismatch (supplied and specification versions differ)."
|
16
|
+
end
|
17
|
+
|
18
|
+
# no rubyforge project? no release for you!
|
19
|
+
if GEM_SPEC.rubyforge_project == 'TODO' or GEM_SPEC.rubyforge_project.nil? then
|
20
|
+
fail "Must define rubyforge_project in your gem specification."
|
21
|
+
end
|
22
|
+
|
23
|
+
# instantiate a RubyForge object
|
24
|
+
rf = RubyForge.new
|
25
|
+
|
26
|
+
# read project info and overview
|
27
|
+
notes = begin
|
28
|
+
r = File.read("README.rdoc")
|
29
|
+
r.split(/^(=+ .*)/)[1..4].join.strip
|
30
|
+
rescue
|
31
|
+
warn "Missing README.rdoc"
|
32
|
+
''
|
33
|
+
end
|
34
|
+
|
35
|
+
# read changes
|
36
|
+
changes = begin
|
37
|
+
h = File.read("History.txt")
|
38
|
+
h.split(/^(==.*)/)[1..2].join.strip
|
39
|
+
rescue
|
40
|
+
warn "Missing History.txt"
|
41
|
+
''
|
42
|
+
end
|
43
|
+
|
44
|
+
# build the configuration for the release
|
45
|
+
config = Hash.new
|
46
|
+
config["release_notes"] = notes
|
47
|
+
config["release_changes"] = changes
|
48
|
+
config["preformatted"] = true
|
49
|
+
|
50
|
+
# prepare configuration
|
51
|
+
rf.configure config
|
52
|
+
|
53
|
+
# ensure this was not released before
|
54
|
+
releases = rf.autoconfig['release_ids']
|
55
|
+
if releases.has_key?(GEM_SPEC.name) and releases[GEM_SPEC.name][GEM_SPEC.version] then
|
56
|
+
fail "Release #{GEM_SPEC.version} already exist. Unable to release."
|
57
|
+
end
|
58
|
+
|
59
|
+
files = FileList["pkg/#{GEM_SPEC.name}-#{GEM_SPEC.version}*.*"].to_a
|
60
|
+
fail "No files found for the release." if files.empty?
|
61
|
+
|
62
|
+
puts "Logging in RubyForge..."
|
63
|
+
rf.login
|
64
|
+
|
65
|
+
puts "Files to upload:"
|
66
|
+
files.each do |f|
|
67
|
+
puts " * #{f}"
|
68
|
+
end
|
69
|
+
|
70
|
+
puts "Releasing #{GEM_SPEC.name} version #{GEM_SPEC.version}..."
|
71
|
+
rf.add_release GEM_SPEC.rubyforge_project, GEM_SPEC.name, GEM_SPEC.version, *files
|
72
|
+
puts "Done."
|
73
|
+
end
|
74
|
+
else
|
75
|
+
warn "no GEM_SPEC is found or defined. 'release' task cannot work without it."
|
76
|
+
end
|
77
|
+
else
|
78
|
+
warn "rubyforge gem is required to generate releases, please install it (gem install rubyforge)."
|
79
|
+
end
|
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
begin
|
2
|
+
gem 'rspec', '~> 1.1.9'
|
3
|
+
gem 'rcov', '~> 0.8.1'
|
4
|
+
require 'spec/rake/spectask'
|
5
|
+
require 'rcov'
|
6
|
+
rescue Exception
|
7
|
+
nil
|
8
|
+
end
|
9
|
+
|
10
|
+
if defined?(Spec)
|
11
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
12
|
+
t.spec_opts = ["--options", "spec/spec.opts"]
|
13
|
+
t.spec_files = FileList["spec/**/*_spec.rb"]
|
14
|
+
end
|
15
|
+
|
16
|
+
if defined?(Rcov)
|
17
|
+
CLOBBER.include('coverage')
|
18
|
+
|
19
|
+
namespace :spec do
|
20
|
+
desc "Run all specs in spec directory with RCov"
|
21
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
22
|
+
t.spec_opts = ["--options", "spec/spec.opts"]
|
23
|
+
t.spec_files = FileList["spec/**/*_spec.rb"]
|
24
|
+
t.rcov = true
|
25
|
+
t.rcov_opts = ["--exclude", "spec/*,features/*,gems/*"]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
else
|
29
|
+
warn "RCov gem is required, please install it (gem install rcov)."
|
30
|
+
end
|
31
|
+
else
|
32
|
+
warn "RSpec gem is required, please install it (gem install rspec)."
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rake-compiler
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Luis Lavena
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-12-07 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.8.3
|
24
|
+
- - <
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: "0.9"
|
27
|
+
version:
|
28
|
+
description: Provide a standard and simplified way to build and package Ruby C extensions using Rake as glue.
|
29
|
+
email: luislavena@gmail.com
|
30
|
+
executables:
|
31
|
+
- rake-compiler
|
32
|
+
extensions: []
|
33
|
+
|
34
|
+
extra_rdoc_files:
|
35
|
+
- README.rdoc
|
36
|
+
- LICENSE.txt
|
37
|
+
- History.txt
|
38
|
+
files:
|
39
|
+
- features/compile.feature
|
40
|
+
- features/cross-compile.feature
|
41
|
+
- features/cross-package.feature
|
42
|
+
- features/package.feature
|
43
|
+
- features/step_definitions/compilation.rb
|
44
|
+
- features/step_definitions/cross_compilation.rb
|
45
|
+
- features/step_definitions/execution.rb
|
46
|
+
- features/step_definitions/folders.rb
|
47
|
+
- features/step_definitions/gem.rb
|
48
|
+
- features/support/env.rb
|
49
|
+
- features/support/file_templates.rb
|
50
|
+
- features/support/generators.rb
|
51
|
+
- bin/rake-compiler
|
52
|
+
- lib/rake/extensiontask.rb
|
53
|
+
- spec/lib/rake/extensiontask_spec.rb
|
54
|
+
- spec/spec_helper.rb
|
55
|
+
- tasks/bin/cross-ruby.rake
|
56
|
+
- tasks/common.rake
|
57
|
+
- tasks/cucumber.rake
|
58
|
+
- tasks/gem.rake
|
59
|
+
- tasks/rdoc.rake
|
60
|
+
- tasks/release.rake
|
61
|
+
- tasks/rspec.rake
|
62
|
+
- Rakefile
|
63
|
+
- README.rdoc
|
64
|
+
- History.txt
|
65
|
+
- LICENSE.txt
|
66
|
+
- cucumber.yml
|
67
|
+
has_rdoc: true
|
68
|
+
homepage: http://github.com/luislavena/rake-compiler
|
69
|
+
post_install_message:
|
70
|
+
rdoc_options:
|
71
|
+
- --main
|
72
|
+
- README.rdoc
|
73
|
+
- --title
|
74
|
+
- rake-compiler -- Documentation
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: "0"
|
82
|
+
version:
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: "0"
|
88
|
+
version:
|
89
|
+
requirements: []
|
90
|
+
|
91
|
+
rubyforge_project: rake-compiler
|
92
|
+
rubygems_version: 1.3.0
|
93
|
+
signing_key:
|
94
|
+
specification_version: 2
|
95
|
+
summary: Rake-based Ruby C Extension task generator.
|
96
|
+
test_files: []
|
97
|
+
|