amalgalite 1.1.2-x86-mingw32 → 1.4.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/CONTRIBUTING.md +49 -0
- data/{HISTORY.rdoc → HISTORY.md} +102 -73
- data/LICENSE +2 -2
- data/Manifest.txt +104 -0
- data/README.md +73 -0
- data/Rakefile +25 -0
- data/TODO.md +49 -0
- data/ext/amalgalite/{amalgalite3.c → c/amalgalite.c} +12 -12
- data/ext/amalgalite/{amalgalite3.h → c/amalgalite.h} +5 -5
- data/ext/amalgalite/{amalgalite3_blob.c → c/amalgalite_blob.c} +2 -2
- data/ext/amalgalite/{amalgalite3_constants.c → c/amalgalite_constants.c} +2 -2
- data/ext/amalgalite/{amalgalite3_database.c → c/amalgalite_database.c} +49 -21
- data/ext/amalgalite/{amalgalite3_requires_bootstrap.c → c/amalgalite_requires_bootstrap.c} +131 -58
- data/ext/amalgalite/{amalgalite3_statement.c → c/amalgalite_statement.c} +2 -2
- data/ext/amalgalite/{extconf.rb → c/extconf.rb} +6 -5
- data/ext/amalgalite/{gen_constants.rb → c/gen_constants.rb} +3 -3
- data/ext/amalgalite/c/notes.txt +134 -0
- data/ext/amalgalite/{sqlite3.c → c/sqlite3.c} +111793 -83396
- data/ext/amalgalite/{sqlite3.h → c/sqlite3.h} +1597 -383
- data/ext/amalgalite/{sqlite3_options.h → c/sqlite3_options.h} +0 -0
- data/ext/amalgalite/{sqlite3ext.h → c/sqlite3ext.h} +114 -17
- data/lib/amalgalite.rb +13 -6
- data/lib/amalgalite/1.9/amalgalite.so +0 -0
- data/lib/amalgalite/2.0/amalgalite.so +0 -0
- data/lib/amalgalite/2.1/amalgalite.so +0 -0
- data/lib/amalgalite/column.rb +7 -5
- data/lib/amalgalite/database.rb +18 -10
- data/lib/amalgalite/packer.rb +5 -2
- data/lib/amalgalite/requires.rb +47 -16
- data/lib/amalgalite/schema.rb +63 -36
- data/lib/amalgalite/sqlite3/version.rb +0 -1
- data/lib/amalgalite/statement.rb +7 -5
- data/lib/amalgalite/table.rb +9 -8
- data/lib/amalgalite/type_maps/default_map.rb +0 -1
- data/lib/amalgalite/type_maps/storage_map.rb +0 -2
- data/lib/amalgalite/type_maps/text_map.rb +0 -1
- data/lib/amalgalite/version.rb +3 -32
- data/spec/aggregate_spec.rb +1 -1
- data/spec/amalgalite_spec.rb +1 -1
- data/spec/blob_spec.rb +1 -1
- data/spec/boolean_spec.rb +2 -1
- data/spec/busy_handler.rb +1 -1
- data/spec/database_spec.rb +18 -13
- data/spec/default_map_spec.rb +1 -1
- data/spec/function_spec.rb +1 -1
- data/spec/integeration_spec.rb +2 -1
- data/spec/packer_spec.rb +4 -4
- data/spec/paths_spec.rb +1 -1
- data/spec/progress_handler_spec.rb +4 -5
- data/spec/requires_spec.rb +36 -2
- data/spec/rtree_spec.rb +6 -5
- data/spec/schema_spec.rb +28 -20
- data/spec/spec_helper.rb +7 -7
- data/spec/sqlite3/constants_spec.rb +1 -1
- data/spec/sqlite3/database_status_spec.rb +4 -4
- data/spec/sqlite3/status_spec.rb +5 -5
- data/spec/sqlite3/version_spec.rb +12 -12
- data/spec/sqlite3_spec.rb +3 -3
- data/spec/statement_spec.rb +3 -4
- data/spec/storage_map_spec.rb +1 -1
- data/spec/tap_spec.rb +4 -4
- data/spec/text_map_spec.rb +1 -1
- data/spec/type_map_spec.rb +1 -1
- data/spec/version_spec.rb +3 -10
- data/tasks/custom.rake +102 -0
- data/tasks/default.rake +247 -0
- data/tasks/extension.rake +28 -202
- data/tasks/this.rb +206 -0
- metadata +194 -236
- data/README.rdoc +0 -54
- data/gemspec.rb +0 -63
- data/lib/amalgalite/1.8/amalgalite3.so +0 -0
- data/lib/amalgalite/1.9/amalgalite3.so +0 -0
- data/tasks/announce.rake +0 -44
- data/tasks/config.rb +0 -107
- data/tasks/distribution.rake +0 -77
- data/tasks/documentation.rake +0 -36
- data/tasks/rspec.rake +0 -30
- data/tasks/utils.rb +0 -80
data/README.rdoc
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
== Amalgalite
|
2
|
-
|
3
|
-
* Homepage[http://copiousfreetime.rubyforge.org/amalgalite]
|
4
|
-
* {Rubyforge Project}[http://rubyforge.org/projects/copiousfreetime/]
|
5
|
-
* email jeremy at copiousfreetime dot org
|
6
|
-
* git clone url git://github.com/copiousfreetime/amalgalite.git
|
7
|
-
* {Github}[http://github.com/copiousfreetime/amalgalite/]
|
8
|
-
|
9
|
-
== Articles
|
10
|
-
|
11
|
-
* {Writing SQL Functions in Ruby}[http://copiousfreetime.org/articles/2009/01/10/writing-sql-functions-in-ruby.html]
|
12
|
-
|
13
|
-
== INSTALL
|
14
|
-
|
15
|
-
* gem install amalgalite
|
16
|
-
|
17
|
-
== DESCRIPTION
|
18
|
-
|
19
|
-
Amalgalite embeds the SQLite database engine in a ruby extension. There is no
|
20
|
-
need to install SQLite separately.
|
21
|
-
|
22
|
-
Look in the examples/ directory to see
|
23
|
-
|
24
|
-
* general usage
|
25
|
-
* blob io
|
26
|
-
* schema information
|
27
|
-
* custom functions
|
28
|
-
* custom aggregates
|
29
|
-
* requiring ruby code from a database
|
30
|
-
* full text search
|
31
|
-
|
32
|
-
Also Scroll through Amalgalite::Database for a quick example, and a general
|
33
|
-
overview of the API.
|
34
|
-
|
35
|
-
Amalgalite adds in the following additional non-default SQLite extensions:
|
36
|
-
|
37
|
-
* {R*Tree index extension}[http://sqlite.org/rtree.html]
|
38
|
-
* {Full Text Search}[http://sqlite.org/fts3.html]
|
39
|
-
|
40
|
-
== CREDITS
|
41
|
-
|
42
|
-
* Jamis Buck for the first {ruby sqlite implementation}[http://www.rubyforge.org/projects/sqlite-ruby]
|
43
|
-
|
44
|
-
== CHANGES
|
45
|
-
|
46
|
-
Read the HISTORY.rdoc file.
|
47
|
-
|
48
|
-
== LICENSE
|
49
|
-
|
50
|
-
Copyright (c) 2008 Jeremy Hinegardner
|
51
|
-
|
52
|
-
All rights reserved.
|
53
|
-
|
54
|
-
See LICENSE and/or COPYING for details.
|
data/gemspec.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'amalgalite/version'
|
3
|
-
require 'tasks/config'
|
4
|
-
|
5
|
-
Amalgalite::GEM_SPEC = Gem::Specification.new do |spec|
|
6
|
-
proj = Configuration.for('project')
|
7
|
-
spec.name = proj.name
|
8
|
-
spec.version = Amalgalite::Version.to_s
|
9
|
-
|
10
|
-
spec.author = proj.author
|
11
|
-
spec.email = proj.email
|
12
|
-
spec.homepage = proj.homepage
|
13
|
-
spec.summary = proj.summary
|
14
|
-
spec.description = proj.description
|
15
|
-
spec.platform = Gem::Platform::RUBY
|
16
|
-
|
17
|
-
|
18
|
-
pkg = Configuration.for('packaging')
|
19
|
-
spec.files = pkg.files.all
|
20
|
-
spec.executables = pkg.files.bin.collect { |b| File.basename(b) }
|
21
|
-
|
22
|
-
# add dependencies here
|
23
|
-
spec.add_dependency("arrayfields", "~> 4.7.4")
|
24
|
-
spec.add_dependency("fastercsv", "~> 1.5.4")
|
25
|
-
|
26
|
-
spec.add_development_dependency("rake" , "~> 0.8.7")
|
27
|
-
spec.add_development_dependency("configuration", "~> 1.2.0")
|
28
|
-
spec.add_development_dependency("rspec" , "~> 2.5.1")
|
29
|
-
spec.add_development_dependency("rake-compiler", "~> 0.7.6")
|
30
|
-
spec.add_development_dependency('zip' , "~> 2.0.2")
|
31
|
-
spec.add_development_dependency('rcov' , "~> 0.9.9")
|
32
|
-
|
33
|
-
if ext_conf = Configuration.for_if_exist?("extension") then
|
34
|
-
spec.extensions << ext_conf.configs
|
35
|
-
spec.extensions.flatten!
|
36
|
-
end
|
37
|
-
|
38
|
-
if rdoc = Configuration.for_if_exist?('rdoc') then
|
39
|
-
spec.has_rdoc = true
|
40
|
-
spec.extra_rdoc_files = pkg.files.rdoc
|
41
|
-
spec.rdoc_options = rdoc.options + [ "--main" , rdoc.main_page ]
|
42
|
-
else
|
43
|
-
spec.has_rdoc = false
|
44
|
-
end
|
45
|
-
|
46
|
-
if test = Configuration.for_if_exist?('testing') then
|
47
|
-
spec.test_files = test.files
|
48
|
-
end
|
49
|
-
|
50
|
-
if rf = Configuration.for_if_exist?('rubyforge') then
|
51
|
-
spec.rubyforge_project = rf.project
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
Amalgalite::GEM_SPEC_MSWIN32 = Amalgalite::GEM_SPEC.clone
|
56
|
-
Amalgalite::GEM_SPEC_MSWIN32.platform = ::Gem::Platform.new( "i386-mswin32" )
|
57
|
-
Amalgalite::GEM_SPEC_MSWIN32.extensions = []
|
58
|
-
|
59
|
-
Amalgalite::GEM_SPEC_MINGW32= Amalgalite::GEM_SPEC.clone
|
60
|
-
Amalgalite::GEM_SPEC_MINGW32.platform = ::Gem::Platform.new( "i386-mingw32" )
|
61
|
-
Amalgalite::GEM_SPEC_MINGW32.extensions = []
|
62
|
-
|
63
|
-
Amalgalite::SPECS = [ Amalgalite::GEM_SPEC, Amalgalite::GEM_SPEC_MSWIN32, Amalgalite::GEM_SPEC_MINGW32 ]
|
Binary file
|
Binary file
|
data/tasks/announce.rake
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
#-------------------------------------------------------------------------------
|
3
|
-
# announcement methods
|
4
|
-
#-------------------------------------------------------------------------------
|
5
|
-
|
6
|
-
proj_config = Configuration.for('project')
|
7
|
-
namespace :announce do
|
8
|
-
desc "create email for ruby-talk"
|
9
|
-
task :email do
|
10
|
-
require 'time'
|
11
|
-
info = Utils.announcement
|
12
|
-
|
13
|
-
File.open("email.txt", "w") do |mail|
|
14
|
-
mail.puts "From: #{proj_config.author} <#{proj_config.email}>"
|
15
|
-
mail.puts "To: ruby-talk@ruby-lang.org"
|
16
|
-
mail.puts "Date: #{Time.now.rfc2822}"
|
17
|
-
mail.puts "Subject: [ANN] #{info[:subject]}"
|
18
|
-
mail.puts
|
19
|
-
mail.puts info[:title]
|
20
|
-
mail.puts
|
21
|
-
mail.puts "#{info[:urls]}"
|
22
|
-
mail.puts
|
23
|
-
mail.puts "=== Description"
|
24
|
-
mail.puts
|
25
|
-
mail.puts info[:description]
|
26
|
-
mail.puts
|
27
|
-
mail.puts "=== Installation"
|
28
|
-
mail.puts
|
29
|
-
mail.puts " gem install #{Amalgalite::GEM_SPEC.name}"
|
30
|
-
mail.puts
|
31
|
-
mail.puts "{{ Release notes for Version #{Amalgalite::VERSION} }}"
|
32
|
-
mail.puts
|
33
|
-
mail.puts info[:release_notes]
|
34
|
-
mail.puts
|
35
|
-
end
|
36
|
-
puts "Created the following as email.txt:"
|
37
|
-
puts "-" * 72
|
38
|
-
puts File.read("email.txt")
|
39
|
-
puts "-" * 72
|
40
|
-
end
|
41
|
-
|
42
|
-
CLOBBER << "email.txt"
|
43
|
-
end
|
44
|
-
|
data/tasks/config.rb
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
require 'configuration'
|
2
|
-
require 'yaml'
|
3
|
-
|
4
|
-
require 'rake'
|
5
|
-
require 'tasks/utils'
|
6
|
-
|
7
|
-
#-----------------------------------------------------------------------
|
8
|
-
# General project configuration
|
9
|
-
#-----------------------------------------------------------------------
|
10
|
-
Configuration.for('project') {
|
11
|
-
name "amalgalite"
|
12
|
-
version Amalgalite::Version.to_s
|
13
|
-
author "Jeremy Hinegardner"
|
14
|
-
email "jeremy at copiousfreetime dot org"
|
15
|
-
homepage "http://www.copiousfreetime.org/projects/amalgalite/"
|
16
|
-
description Utils.section_of("README.rdoc", "description")
|
17
|
-
summary description.split(".").first
|
18
|
-
history "HISTORY.rdoc"
|
19
|
-
license ::FileList["LICENSE"]
|
20
|
-
readme "README.rdoc"
|
21
|
-
}
|
22
|
-
|
23
|
-
#-----------------------------------------------------------------------
|
24
|
-
# Packaging
|
25
|
-
#-----------------------------------------------------------------------
|
26
|
-
Configuration.for('packaging') {
|
27
|
-
# files in the project
|
28
|
-
proj_conf = Configuration.for('project')
|
29
|
-
files {
|
30
|
-
bin ::FileList["bin/*"]
|
31
|
-
ext ::FileList["ext/amalgalite/*.{c,h,rb}"]
|
32
|
-
examples ::FileList["examples/*"]
|
33
|
-
lib ::FileList["lib/**/*.rb"]
|
34
|
-
test ::FileList["spec/**/*.rb", "test/**/*.rb", ]
|
35
|
-
data ::FileList["data/**/*", "spec/data/*.{sql,txt,sh}"]
|
36
|
-
tasks ::FileList["tasks/**/*.r{ake,b}"]
|
37
|
-
rdoc ::FileList[proj_conf.readme, proj_conf.history,
|
38
|
-
proj_conf.license] + lib + ::FileList["ext/amalgalite3*.c"]
|
39
|
-
all bin + ext + examples + lib + test + data + rdoc + tasks
|
40
|
-
}
|
41
|
-
|
42
|
-
# ways to package the results
|
43
|
-
formats {
|
44
|
-
tgz true
|
45
|
-
zip true
|
46
|
-
rubygem Configuration::Table.has_key?('rubygem')
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
#-----------------------------------------------------------------------
|
51
|
-
# Gem packaging
|
52
|
-
#-----------------------------------------------------------------------
|
53
|
-
Configuration.for("rubygem") {
|
54
|
-
spec "gemspec.rb"
|
55
|
-
Configuration.for('packaging').files.all << spec
|
56
|
-
}
|
57
|
-
|
58
|
-
#-----------------------------------------------------------------------
|
59
|
-
# Testing
|
60
|
-
# - change mode to 'testunit' to use unit testing
|
61
|
-
#-----------------------------------------------------------------------
|
62
|
-
Configuration.for('test') {
|
63
|
-
mode "spec"
|
64
|
-
files Configuration.for("packaging").files.test
|
65
|
-
options %w[ --format documentation --color ]
|
66
|
-
ruby_opts %w[ ]
|
67
|
-
}
|
68
|
-
|
69
|
-
#-----------------------------------------------------------------------
|
70
|
-
# Rcov
|
71
|
-
#-----------------------------------------------------------------------
|
72
|
-
Configuration.for('rcov') {
|
73
|
-
libs %w[ lib ]
|
74
|
-
rcov_opts %w[ --html -o coverage ]
|
75
|
-
ruby_opts %w[ ]
|
76
|
-
test_files Configuration.for('packaging').files.test
|
77
|
-
}
|
78
|
-
#
|
79
|
-
#-----------------------------------------------------------------------
|
80
|
-
# Rdoc
|
81
|
-
#-----------------------------------------------------------------------
|
82
|
-
Configuration.for('rdoc') {
|
83
|
-
files Configuration.for('packaging').files.rdoc
|
84
|
-
main_page files.first
|
85
|
-
title Configuration.for('project').name
|
86
|
-
options %w[ ]
|
87
|
-
output_dir "doc"
|
88
|
-
}
|
89
|
-
|
90
|
-
#-----------------------------------------------------------------------
|
91
|
-
# Extensions
|
92
|
-
#-----------------------------------------------------------------------
|
93
|
-
Configuration.for('extension') {
|
94
|
-
configs Configuration.for('packaging').files.ext.find_all { |x| %w[ extconf.rb ].include?(File.basename(x)) }
|
95
|
-
cross_rbconfig ::YAML.load_file( File.expand_path("~/.rake-compiler/config.yml"))
|
96
|
-
}
|
97
|
-
|
98
|
-
#-----------------------------------------------------------------------
|
99
|
-
# Rubyforge
|
100
|
-
#-----------------------------------------------------------------------
|
101
|
-
Configuration.for('rubyforge') {
|
102
|
-
project "copiousfreetime"
|
103
|
-
user "jjh"
|
104
|
-
host "rubyforge.org"
|
105
|
-
rdoc_location "#{user}@#{host}:/var/www/gforge-projects/#{project}/amalgalite/"
|
106
|
-
}
|
107
|
-
|
data/tasks/distribution.rake
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
|
3
|
-
#-------------------------------------------------------------------------------
|
4
|
-
# Distribution and Packaging
|
5
|
-
#-------------------------------------------------------------------------------
|
6
|
-
if pkg_config = Configuration.for_if_exist?("packaging") then
|
7
|
-
|
8
|
-
require 'gemspec'
|
9
|
-
require 'rake/gempackagetask'
|
10
|
-
require 'rake/contrib/sshpublisher'
|
11
|
-
|
12
|
-
namespace :dist do
|
13
|
-
|
14
|
-
Rake::GemPackageTask.new(Amalgalite::GEM_SPEC) do |pkg|
|
15
|
-
pkg.need_tar = pkg_config.formats.tgz
|
16
|
-
pkg.need_zip = pkg_config.formats.zip
|
17
|
-
end
|
18
|
-
|
19
|
-
desc "Install as a gem"
|
20
|
-
task :install => [:clobber, :package] do
|
21
|
-
sh "sudo gem install --local pkg/#{Amalgalite::GEM_SPEC.full_name}.gem --no-rdoc --no-ri"
|
22
|
-
end
|
23
|
-
|
24
|
-
desc "Uninstall gem"
|
25
|
-
task :uninstall do
|
26
|
-
sh "sudo gem uninstall -i #{Amalgalite::GEM_SPEC.name} -x"
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "dump gemspec"
|
30
|
-
task :gemspec do
|
31
|
-
puts Amalgalite::GEM_SPEC.to_ruby
|
32
|
-
end
|
33
|
-
|
34
|
-
desc "dump gemspec for win"
|
35
|
-
task :gemspec_win do
|
36
|
-
puts Amalgalite::GEM_SPEC_MINGW32.to_ruby
|
37
|
-
end
|
38
|
-
|
39
|
-
desc "reinstall gem"
|
40
|
-
task :reinstall => [:uninstall, :repackage, :install]
|
41
|
-
|
42
|
-
desc "package up a windows gem"
|
43
|
-
task :package_win => :clean do
|
44
|
-
Configuration.for("extension").cross_rbconfig.keys.each do |rbconfig|
|
45
|
-
v = rbconfig.split("-").last
|
46
|
-
s = v.sub(/\.\d$/,'')
|
47
|
-
sh "rake ext:build_win-#{v}"
|
48
|
-
mkdir_p "lib/amalgalite/#{s}", :verbose => true
|
49
|
-
cp "ext/amalgalite/amalgalite3.so", "lib/amalgalite/#{s}/", :verbose => true
|
50
|
-
end
|
51
|
-
|
52
|
-
Amalgalite::SPECS.each do |spec|
|
53
|
-
next if spec.platform == "ruby"
|
54
|
-
spec.files += FileList["lib/amalgalite/{1.8,1.9}/**.{dll,so}"]
|
55
|
-
Gem::Builder.new( spec ).build
|
56
|
-
mkdir "pkg" unless File.directory?( 'pkg' )
|
57
|
-
mv Dir["*.gem"].first, "pkg"
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
task :clobber do
|
62
|
-
rm_rf 'lib/amalgalite/1.8'
|
63
|
-
rm_rf 'lib/amalgalite/1.9'
|
64
|
-
end
|
65
|
-
|
66
|
-
task :prep => [:clobber, :package, :package_win ]
|
67
|
-
|
68
|
-
desc "distribute copiously"
|
69
|
-
task :copious => :prep do
|
70
|
-
gems = Amalgalite::SPECS.collect { |s| "#{s.full_name}.gem" }
|
71
|
-
Rake::SshFilePublisher.new('jeremy@copiousfreetime.org',
|
72
|
-
'/var/www/vhosts/www.copiousfreetime.org/htdocs/gems/gems',
|
73
|
-
'pkg', *gems).upload
|
74
|
-
sh "ssh jeremy@copiousfreetime.org rake -f /var/www/vhosts/www.copiousfreetime.org/htdocs/gems/Rakefile"
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
data/tasks/documentation.rake
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'tasks/config'
|
2
|
-
|
3
|
-
#-----------------------------------------------------------------------
|
4
|
-
# Documentation
|
5
|
-
#-----------------------------------------------------------------------
|
6
|
-
|
7
|
-
if rdoc_config = Configuration.for_if_exist?('rdoc') then
|
8
|
-
|
9
|
-
namespace :doc do
|
10
|
-
|
11
|
-
require 'rdoc'
|
12
|
-
require 'rake/rdoctask'
|
13
|
-
|
14
|
-
# generating documentation locally
|
15
|
-
Rake::RDocTask.new do |rdoc|
|
16
|
-
rdoc.rdoc_dir = rdoc_config.output_dir
|
17
|
-
rdoc.options = rdoc_config.options
|
18
|
-
rdoc.rdoc_files = rdoc_config.files
|
19
|
-
rdoc.title = rdoc_config.title
|
20
|
-
rdoc.main = rdoc_config.main_page
|
21
|
-
end
|
22
|
-
|
23
|
-
if rubyforge_config = Configuration.for_if_exist?('rubyforge') then
|
24
|
-
desc "Deploy the RDoc documentation to ENV['RDOC_DEPLOY']"
|
25
|
-
task :deploy => :rerdoc do
|
26
|
-
if ENV['RDOC_DEPLOY'] then
|
27
|
-
sh "rsync -zav --delete #{rdoc_config.output_dir}/ #{ENV['RDOC_DEPLOY']}"
|
28
|
-
else
|
29
|
-
puts "To Deploy RDOC set the RDOC_DEPLOY environment variable"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
data/tasks/rspec.rake
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'tasks/config'
|
3
|
-
|
4
|
-
#--------------------------------------------------------------------------------
|
5
|
-
# configuration for running rspec. This shows up as the test:default task
|
6
|
-
#--------------------------------------------------------------------------------
|
7
|
-
if spec_config = Configuration.for_if_exist?("test") then
|
8
|
-
if spec_config.mode == "spec" then
|
9
|
-
namespace :test do
|
10
|
-
|
11
|
-
task :default => :spec
|
12
|
-
|
13
|
-
require 'rspec/core/rake_task'
|
14
|
-
rs = RSpec::Core::RakeTask.new do |r|
|
15
|
-
r.ruby_opts = spec_config.ruby_opts
|
16
|
-
#r.rspec_path = [ Amalgalite::Paths.lib_path,
|
17
|
-
#Amalgalite::Paths.ext_path,
|
18
|
-
#Amalgalite::Paths.root_dir ]
|
19
|
-
r.rspec_opts = spec_config.options
|
20
|
-
|
21
|
-
if rcov_config = Configuration.for_if_exist?('rcov') then
|
22
|
-
r.rcov = false
|
23
|
-
r.rcov_opts = rcov_config.rcov_opts
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
task :spec => 'ext:build'
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/tasks/utils.rb
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
require 'amalgalite/version'
|
2
|
-
|
3
|
-
#-------------------------------------------------------------------------------
|
4
|
-
# Additions to the Configuration class that are useful
|
5
|
-
#-------------------------------------------------------------------------------
|
6
|
-
class Configuration
|
7
|
-
class << self
|
8
|
-
def exist?( name )
|
9
|
-
Configuration::Table.has_key?( name )
|
10
|
-
end
|
11
|
-
|
12
|
-
def for_if_exist?( name )
|
13
|
-
if self.exist?( name ) then
|
14
|
-
self.for( name )
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
#-------------------------------------------------------------------------------
|
21
|
-
# some useful utilitiy methods for the tasks
|
22
|
-
#-------------------------------------------------------------------------------
|
23
|
-
module Utils
|
24
|
-
class << self
|
25
|
-
|
26
|
-
# Try to load the given _library_ using the built-in require, but do not
|
27
|
-
# raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
|
28
|
-
# successfully loaded; returns +false+ otherwise.
|
29
|
-
#
|
30
|
-
def try_require( lib )
|
31
|
-
require lib
|
32
|
-
true
|
33
|
-
rescue LoadError
|
34
|
-
false
|
35
|
-
end
|
36
|
-
|
37
|
-
# partition an rdoc file into sections, and return the text of the section
|
38
|
-
# given.
|
39
|
-
def section_of(file, section_name)
|
40
|
-
File.read(file).split(/^(?==)/).each do |section|
|
41
|
-
lines = section.split("\n")
|
42
|
-
return lines[1..-1].join("\n").strip if lines.first =~ /#{section_name}/i
|
43
|
-
end
|
44
|
-
nil
|
45
|
-
end
|
46
|
-
|
47
|
-
# Get an array of all the changes in the application for a particular
|
48
|
-
# release. This is done by looking in the history file and grabbing the
|
49
|
-
# information for the most recent release. The history file is assumed to
|
50
|
-
# be in RDoc format and version release are 2nd tier sections separated by
|
51
|
-
# '== Version X.Y.Z'
|
52
|
-
#
|
53
|
-
# returns:: A hash of notes keyed by version number
|
54
|
-
#
|
55
|
-
def release_notes_from(history_file)
|
56
|
-
releases = {}
|
57
|
-
File.read(history_file).split(/^(?=== Version)/).each do |section|
|
58
|
-
lines = section.split("\n")
|
59
|
-
md = %r{Version ((\w+\.)+\w+)}.match(lines.first)
|
60
|
-
next unless md
|
61
|
-
releases[md[1]] = lines[1..-1].join("\n").strip
|
62
|
-
end
|
63
|
-
return releases
|
64
|
-
end
|
65
|
-
|
66
|
-
# return a hash of useful information for the latest release
|
67
|
-
# urls, subject, title, description and latest release notes
|
68
|
-
#
|
69
|
-
def announcement
|
70
|
-
cfg = Configuration.for("project")
|
71
|
-
{
|
72
|
-
:subject => "#{cfg.name} #{Amalgalite::VERSION} Released",
|
73
|
-
:title => "#{cfg.name} version #{Amalgalite::VERSION} has been released.",
|
74
|
-
:urls => "#{cfg.homepage}",
|
75
|
-
:description => "#{cfg.description.rstrip}",
|
76
|
-
:release_notes => Utils.release_notes_from(cfg.history)[Amalgalite::VERSION].rstrip
|
77
|
-
}
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end # << self
|