amalgalite 0.10.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. data/HISTORY +201 -0
  2. data/LICENSE +29 -0
  3. data/README +51 -0
  4. data/bin/amalgalite-pack +126 -0
  5. data/examples/a.rb +9 -0
  6. data/examples/blob.rb +88 -0
  7. data/examples/bootstrap.rb +36 -0
  8. data/examples/define_aggregate.rb +75 -0
  9. data/examples/define_function.rb +104 -0
  10. data/examples/gem-db.rb +94 -0
  11. data/examples/gems.db +0 -0
  12. data/examples/require_me.rb +11 -0
  13. data/examples/requires.rb +42 -0
  14. data/examples/schema-info.rb +34 -0
  15. data/ext/amalgalite/amalgalite3.c +290 -0
  16. data/ext/amalgalite/amalgalite3.h +151 -0
  17. data/ext/amalgalite/amalgalite3_blob.c +240 -0
  18. data/ext/amalgalite/amalgalite3_constants.c +221 -0
  19. data/ext/amalgalite/amalgalite3_database.c +1148 -0
  20. data/ext/amalgalite/amalgalite3_requires_bootstrap.c +210 -0
  21. data/ext/amalgalite/amalgalite3_statement.c +639 -0
  22. data/ext/amalgalite/extconf.rb +36 -0
  23. data/ext/amalgalite/gen_constants.rb +130 -0
  24. data/ext/amalgalite/sqlite3.c +106729 -0
  25. data/ext/amalgalite/sqlite3.h +5626 -0
  26. data/ext/amalgalite/sqlite3_options.h +4 -0
  27. data/ext/amalgalite/sqlite3ext.h +380 -0
  28. data/gemspec.rb +60 -0
  29. data/lib/amalgalite.rb +43 -0
  30. data/lib/amalgalite/1.8/amalgalite3.so +0 -0
  31. data/lib/amalgalite/1.9/amalgalite3.so +0 -0
  32. data/lib/amalgalite/aggregate.rb +67 -0
  33. data/lib/amalgalite/blob.rb +186 -0
  34. data/lib/amalgalite/boolean.rb +42 -0
  35. data/lib/amalgalite/busy_timeout.rb +47 -0
  36. data/lib/amalgalite/column.rb +97 -0
  37. data/lib/amalgalite/core_ext/kernel/require.rb +21 -0
  38. data/lib/amalgalite/database.rb +947 -0
  39. data/lib/amalgalite/function.rb +61 -0
  40. data/lib/amalgalite/index.rb +43 -0
  41. data/lib/amalgalite/packer.rb +226 -0
  42. data/lib/amalgalite/paths.rb +70 -0
  43. data/lib/amalgalite/profile_tap.rb +131 -0
  44. data/lib/amalgalite/progress_handler.rb +21 -0
  45. data/lib/amalgalite/requires.rb +120 -0
  46. data/lib/amalgalite/schema.rb +191 -0
  47. data/lib/amalgalite/sqlite3.rb +6 -0
  48. data/lib/amalgalite/sqlite3/constants.rb +80 -0
  49. data/lib/amalgalite/sqlite3/database/function.rb +48 -0
  50. data/lib/amalgalite/sqlite3/database/status.rb +68 -0
  51. data/lib/amalgalite/sqlite3/status.rb +60 -0
  52. data/lib/amalgalite/sqlite3/version.rb +37 -0
  53. data/lib/amalgalite/statement.rb +414 -0
  54. data/lib/amalgalite/table.rb +90 -0
  55. data/lib/amalgalite/taps.rb +2 -0
  56. data/lib/amalgalite/taps/console.rb +27 -0
  57. data/lib/amalgalite/taps/io.rb +71 -0
  58. data/lib/amalgalite/trace_tap.rb +35 -0
  59. data/lib/amalgalite/type_map.rb +63 -0
  60. data/lib/amalgalite/type_maps/default_map.rb +167 -0
  61. data/lib/amalgalite/type_maps/storage_map.rb +40 -0
  62. data/lib/amalgalite/type_maps/text_map.rb +22 -0
  63. data/lib/amalgalite/version.rb +37 -0
  64. data/lib/amalgalite/view.rb +26 -0
  65. data/spec/aggregate_spec.rb +169 -0
  66. data/spec/amalgalite_spec.rb +4 -0
  67. data/spec/blob_spec.rb +81 -0
  68. data/spec/boolean_spec.rb +23 -0
  69. data/spec/busy_handler.rb +165 -0
  70. data/spec/database_spec.rb +494 -0
  71. data/spec/default_map_spec.rb +87 -0
  72. data/spec/function_spec.rb +94 -0
  73. data/spec/integeration_spec.rb +111 -0
  74. data/spec/packer_spec.rb +60 -0
  75. data/spec/paths_spec.rb +28 -0
  76. data/spec/progress_handler_spec.rb +105 -0
  77. data/spec/requires_spec.rb +23 -0
  78. data/spec/rtree_spec.rb +71 -0
  79. data/spec/schema_spec.rb +120 -0
  80. data/spec/spec_helper.rb +27 -0
  81. data/spec/sqlite3/constants_spec.rb +65 -0
  82. data/spec/sqlite3/database_status_spec.rb +36 -0
  83. data/spec/sqlite3/status_spec.rb +18 -0
  84. data/spec/sqlite3/version_spec.rb +14 -0
  85. data/spec/sqlite3_spec.rb +53 -0
  86. data/spec/statement_spec.rb +161 -0
  87. data/spec/storage_map_spec.rb +41 -0
  88. data/spec/tap_spec.rb +59 -0
  89. data/spec/text_map_spec.rb +23 -0
  90. data/spec/type_map_spec.rb +17 -0
  91. data/spec/version_spec.rb +15 -0
  92. data/tasks/announce.rake +43 -0
  93. data/tasks/config.rb +107 -0
  94. data/tasks/distribution.rake +77 -0
  95. data/tasks/documentation.rake +32 -0
  96. data/tasks/extension.rake +141 -0
  97. data/tasks/rspec.rake +33 -0
  98. data/tasks/rubyforge.rake +59 -0
  99. data/tasks/utils.rb +80 -0
  100. metadata +237 -0
data/tasks/rspec.rake ADDED
@@ -0,0 +1,33 @@
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 'spec/rake/spectask'
14
+ rs = Spec::Rake::SpecTask.new do |r|
15
+ r.ruby_opts = spec_config.ruby_opts
16
+ r.libs = [ Amalgalite::Paths.lib_path,
17
+ Amalgalite::Paths.ext_path,
18
+ Amalgalite::Paths.root_dir ]
19
+ r.spec_files = spec_config.files
20
+ r.spec_opts = spec_config.options
21
+ #r.warning = true
22
+
23
+ if rcov_config = Configuration.for_if_exist?('rcov') then
24
+ r.rcov = true
25
+ r.rcov_dir = rcov_config.output_dir
26
+ r.rcov_opts = rcov_config.rcov_opts
27
+ end
28
+ end
29
+
30
+ task :spec => 'ext:build'
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,59 @@
1
+ require 'tasks/config'
2
+
3
+ #-----------------------------------------------------------------------
4
+ # Rubyforge additions to the task library
5
+ #-----------------------------------------------------------------------
6
+ if rf_conf = Configuration.for_if_exist?("rubyforge") then
7
+
8
+ abort("rubyforge gem not installed 'gem install rubyforge'") unless Utils.try_require('rubyforge')
9
+
10
+ proj_conf = Configuration.for('project')
11
+
12
+ namespace :dist do
13
+ desc "Release files to rubyforge"
14
+ task :rubyforge => [:clean, :package, :package_win] do
15
+
16
+ rubyforge = RubyForge.new
17
+
18
+ config = {}
19
+ config["release_notes"] = proj_conf.description
20
+ config["release_changes"] = Utils.release_notes_from(proj_conf.history)[Amalgalite::VERSION]
21
+ config["Prefomatted"] = true
22
+
23
+ rubyforge.configure config
24
+
25
+ # make sure this release doesn't already exist
26
+ releases = rubyforge.autoconfig['release_ids']
27
+ if releases.has_key?(Amalgalite::GEM_SPEC.name) and releases[Amalgalite::GEM_SPEC.name][Amalgalite::VERSION] then
28
+ abort("Release #{Amalgalite::VERSION} already exists! Unable to release.")
29
+ end
30
+
31
+ puts "Uploading to rubyforge..."
32
+ files = FileList[File.join("pkg","#{Amalgalite::GEM_SPEC.name}-#{Amalgalite::VERSION}*.*")].to_a
33
+ files.each do |f|
34
+ puts " * #{f}"
35
+ end
36
+ rubyforge.login
37
+ rubyforge.add_release(Amalgalite::GEM_SPEC.rubyforge_project, Amalgalite::GEM_SPEC.name, Amalgalite::VERSION, *files)
38
+ puts "done."
39
+ end
40
+ end
41
+
42
+ namespace :announce do
43
+ desc "Post news of #{proj_conf.name} to #{rf_conf.project} on rubyforge"
44
+ task :rubyforge do
45
+ info = Utils.announcement
46
+
47
+ puts "Subject : #{info[:subject]}"
48
+ msg = "#{info[:title]}\n\n#{info[:urls]}\n\n#{info[:release_notes]}"
49
+ puts msg
50
+
51
+ rubyforge = RubyForge.new
52
+ rubyforge.configure
53
+ rubyforge.login
54
+ rubyforge.post_news(rf_conf.project, info[:subject], msg )
55
+ puts "Posted to rubyforge"
56
+ end
57
+
58
+ end
59
+ end
data/tasks/utils.rb ADDED
@@ -0,0 +1,80 @@
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
metadata ADDED
@@ -0,0 +1,237 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: amalgalite
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.10.1
5
+ platform: x86-mingw32
6
+ authors:
7
+ - Jeremy Hinegardner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-01 00:00:00 -06:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: arrayfields
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 4.7.0
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.4
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: configuration
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 0.0.5
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: rspec
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.2.2
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake-compiler
57
+ type: :development
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ version: 0.5.0
64
+ version:
65
+ description: "Amalgalite embeds the SQLite database engine in a ruby extension. There is no need to install SQLite separately. Look in the examples/ directory to see * general usage * blob io * schema information * custom functions * custom aggregates * requiring ruby code from a database Also Scroll through Amalgalite::Database for a quick example, and a general overview of the API. Amalgalite adds in the following additional non-default SQLite extension(s): * {R*Tree index extension}[http://sqlite.org/rtree.html]"
66
+ email: jeremy@hinegardner.org
67
+ executables:
68
+ - amalgalite-pack
69
+ extensions: []
70
+
71
+ extra_rdoc_files:
72
+ - README
73
+ - HISTORY
74
+ - LICENSE
75
+ - lib/amalgalite/aggregate.rb
76
+ - lib/amalgalite/blob.rb
77
+ - lib/amalgalite/boolean.rb
78
+ - lib/amalgalite/busy_timeout.rb
79
+ - lib/amalgalite/column.rb
80
+ - lib/amalgalite/core_ext/kernel/require.rb
81
+ - lib/amalgalite/database.rb
82
+ - lib/amalgalite/function.rb
83
+ - lib/amalgalite/index.rb
84
+ - lib/amalgalite/packer.rb
85
+ - lib/amalgalite/paths.rb
86
+ - lib/amalgalite/profile_tap.rb
87
+ - lib/amalgalite/progress_handler.rb
88
+ - lib/amalgalite/requires.rb
89
+ - lib/amalgalite/schema.rb
90
+ - lib/amalgalite/sqlite3/constants.rb
91
+ - lib/amalgalite/sqlite3/database/function.rb
92
+ - lib/amalgalite/sqlite3/database/status.rb
93
+ - lib/amalgalite/sqlite3/status.rb
94
+ - lib/amalgalite/sqlite3/version.rb
95
+ - lib/amalgalite/sqlite3.rb
96
+ - lib/amalgalite/statement.rb
97
+ - lib/amalgalite/table.rb
98
+ - lib/amalgalite/taps/console.rb
99
+ - lib/amalgalite/taps/io.rb
100
+ - lib/amalgalite/taps.rb
101
+ - lib/amalgalite/trace_tap.rb
102
+ - lib/amalgalite/type_map.rb
103
+ - lib/amalgalite/type_maps/default_map.rb
104
+ - lib/amalgalite/type_maps/storage_map.rb
105
+ - lib/amalgalite/type_maps/text_map.rb
106
+ - lib/amalgalite/version.rb
107
+ - lib/amalgalite/view.rb
108
+ - lib/amalgalite.rb
109
+ files:
110
+ - bin/amalgalite-pack
111
+ - ext/amalgalite/amalgalite3.c
112
+ - ext/amalgalite/amalgalite3_blob.c
113
+ - ext/amalgalite/amalgalite3_constants.c
114
+ - ext/amalgalite/amalgalite3_database.c
115
+ - ext/amalgalite/amalgalite3_requires_bootstrap.c
116
+ - ext/amalgalite/amalgalite3_statement.c
117
+ - ext/amalgalite/sqlite3.c
118
+ - ext/amalgalite/amalgalite3.h
119
+ - ext/amalgalite/sqlite3.h
120
+ - ext/amalgalite/sqlite3_options.h
121
+ - ext/amalgalite/sqlite3ext.h
122
+ - ext/amalgalite/extconf.rb
123
+ - ext/amalgalite/gen_constants.rb
124
+ - examples/a.rb
125
+ - examples/blob.rb
126
+ - examples/bootstrap.rb
127
+ - examples/define_aggregate.rb
128
+ - examples/define_function.rb
129
+ - examples/gem-db.rb
130
+ - examples/gems.db
131
+ - examples/require_me.rb
132
+ - examples/requires.rb
133
+ - examples/schema-info.rb
134
+ - lib/amalgalite/aggregate.rb
135
+ - lib/amalgalite/blob.rb
136
+ - lib/amalgalite/boolean.rb
137
+ - lib/amalgalite/busy_timeout.rb
138
+ - lib/amalgalite/column.rb
139
+ - lib/amalgalite/core_ext/kernel/require.rb
140
+ - lib/amalgalite/database.rb
141
+ - lib/amalgalite/function.rb
142
+ - lib/amalgalite/index.rb
143
+ - lib/amalgalite/packer.rb
144
+ - lib/amalgalite/paths.rb
145
+ - lib/amalgalite/profile_tap.rb
146
+ - lib/amalgalite/progress_handler.rb
147
+ - lib/amalgalite/requires.rb
148
+ - lib/amalgalite/schema.rb
149
+ - lib/amalgalite/sqlite3/constants.rb
150
+ - lib/amalgalite/sqlite3/database/function.rb
151
+ - lib/amalgalite/sqlite3/database/status.rb
152
+ - lib/amalgalite/sqlite3/status.rb
153
+ - lib/amalgalite/sqlite3/version.rb
154
+ - lib/amalgalite/sqlite3.rb
155
+ - lib/amalgalite/statement.rb
156
+ - lib/amalgalite/table.rb
157
+ - lib/amalgalite/taps/console.rb
158
+ - lib/amalgalite/taps/io.rb
159
+ - lib/amalgalite/taps.rb
160
+ - lib/amalgalite/trace_tap.rb
161
+ - lib/amalgalite/type_map.rb
162
+ - lib/amalgalite/type_maps/default_map.rb
163
+ - lib/amalgalite/type_maps/storage_map.rb
164
+ - lib/amalgalite/type_maps/text_map.rb
165
+ - lib/amalgalite/version.rb
166
+ - lib/amalgalite/view.rb
167
+ - lib/amalgalite.rb
168
+ - spec/aggregate_spec.rb
169
+ - spec/amalgalite_spec.rb
170
+ - spec/blob_spec.rb
171
+ - spec/boolean_spec.rb
172
+ - spec/busy_handler.rb
173
+ - spec/database_spec.rb
174
+ - spec/default_map_spec.rb
175
+ - spec/function_spec.rb
176
+ - spec/integeration_spec.rb
177
+ - spec/packer_spec.rb
178
+ - spec/paths_spec.rb
179
+ - spec/progress_handler_spec.rb
180
+ - spec/requires_spec.rb
181
+ - spec/rtree_spec.rb
182
+ - spec/schema_spec.rb
183
+ - spec/spec_helper.rb
184
+ - spec/sqlite3/constants_spec.rb
185
+ - spec/sqlite3/database_status_spec.rb
186
+ - spec/sqlite3/status_spec.rb
187
+ - spec/sqlite3/version_spec.rb
188
+ - spec/sqlite3_spec.rb
189
+ - spec/statement_spec.rb
190
+ - spec/storage_map_spec.rb
191
+ - spec/tap_spec.rb
192
+ - spec/text_map_spec.rb
193
+ - spec/type_map_spec.rb
194
+ - spec/version_spec.rb
195
+ - README
196
+ - HISTORY
197
+ - LICENSE
198
+ - tasks/announce.rake
199
+ - tasks/distribution.rake
200
+ - tasks/documentation.rake
201
+ - tasks/extension.rake
202
+ - tasks/rspec.rake
203
+ - tasks/rubyforge.rake
204
+ - tasks/config.rb
205
+ - tasks/utils.rb
206
+ - gemspec.rb
207
+ - lib/amalgalite/1.8/amalgalite3.so
208
+ - lib/amalgalite/1.9/amalgalite3.so
209
+ has_rdoc: true
210
+ homepage: http://copiousfreetime.rubyforge.org/amalgalite/
211
+ post_install_message:
212
+ rdoc_options:
213
+ - --main
214
+ - README
215
+ require_paths:
216
+ - lib
217
+ required_ruby_version: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: "0"
222
+ version:
223
+ required_rubygems_version: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - ">="
226
+ - !ruby/object:Gem::Version
227
+ version: "0"
228
+ version:
229
+ requirements: []
230
+
231
+ rubyforge_project: copiousfreetime
232
+ rubygems_version: 1.3.1
233
+ signing_key:
234
+ specification_version: 2
235
+ summary: Amalgalite embeds the SQLite database engine in a ruby extension
236
+ test_files: []
237
+