composite_primary_keys 0.8.4 → 0.8.5
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 +55 -24
- data/Manifest.txt +1 -2
- data/{README → README.txt} +0 -0
- data/Rakefile +46 -22
- data/lib/composite_primary_keys.rb +2 -2
- data/lib/composite_primary_keys/version.rb +1 -1
- data/test/connections/native_mysql/connection.rb +2 -0
- data/website/index.html +11 -2
- data/website/index.txt +7 -0
- data/website/version-raw.js +1 -1
- data/website/version.js +1 -1
- metadata +14 -9
- data/CHANGELOG +0 -16
data/History.txt
CHANGED
|
@@ -1,33 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
== 0.8.5 / 2007-6-5
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
* 1 change due to Rails Core change
|
|
4
|
+
* Can no longer use RAILS_CONNECTION_ADAPTERS from Rails core
|
|
5
|
+
* 7 dev improvement:
|
|
6
|
+
* Changed History.txt syntax to rdoc format
|
|
7
|
+
* Added deploy tasks
|
|
8
|
+
* Removed CHANGELOG + migrated into History.txt
|
|
9
|
+
* Changed PKG_NAME -> GEM_NAME in Rakefile
|
|
10
|
+
* Renamed README -> README.txt for :publish_docs task
|
|
11
|
+
* Added :check_version task
|
|
12
|
+
* VER => VERS in rakefile
|
|
13
|
+
* 1 website improvement:
|
|
14
|
+
* website/index.txt includes link to "8 steps to fix other ppls code"
|
|
5
15
|
|
|
6
|
-
|
|
16
|
+
== 0.8.4 / 2007-5-3
|
|
7
17
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
+ 1 website addition:
|
|
11
|
-
+ Added routing help [Pete Sumskas]
|
|
18
|
+
* 1 bugfix
|
|
19
|
+
* Corrected ids_list => ids in the exception message. That'll teach me for not adding unit tests before fixing bugs.
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
== 0.8.3 / 2007-5-3
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
* 1 bugfix
|
|
24
|
+
* Explicit reference to ::ActiveRecord::RecordNotFound
|
|
25
|
+
* 1 website addition:
|
|
26
|
+
* Added routing help [Pete Sumskas]
|
|
18
27
|
|
|
19
|
-
|
|
28
|
+
== 0.8.2 / 2007-4-11
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
* 1 major enhancement:
|
|
31
|
+
* Oracle unit tests!! [Darrin Holst]
|
|
32
|
+
* And they work too
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
== 0.8.1 / 2007-4-10
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
* 1 bug fix:
|
|
37
|
+
* Fixed the distinct(count) for oracle (removed 'as')
|
|
38
|
+
|
|
39
|
+
== 0.8.0 / 2007-4-6
|
|
40
|
+
|
|
41
|
+
* 1 major enhancement:
|
|
42
|
+
* Support for calcualtions on associations
|
|
43
|
+
* 2 new DB supported:
|
|
44
|
+
* Tests run on sqlite
|
|
45
|
+
* Tests run on postgresql
|
|
46
|
+
* History.txt to keep track of changes like these
|
|
47
|
+
* Using Hoe for Rakefile
|
|
48
|
+
* Website generator rake tasks
|
|
49
|
+
|
|
50
|
+
== 0.3.3
|
|
51
|
+
* id=
|
|
52
|
+
* create now work
|
|
53
|
+
|
|
54
|
+
== 0.1.4
|
|
55
|
+
* it was important that #{primary_key} for composites --> 'key1,key2' and not 'key1key2' so created PrimaryKeys class
|
|
56
|
+
|
|
57
|
+
== 0.0.1
|
|
58
|
+
* Initial version
|
|
59
|
+
* set_primary_keys(*keys) is the activation class method to transform an ActiveRecord into a composite primary key AR
|
|
60
|
+
* find(*ids) supports the passing of
|
|
61
|
+
* id sets: Foo.find(2,1),
|
|
62
|
+
* lists of id sets: Foo.find([2,1], [7,3], [8,12]),
|
|
63
|
+
* and even stringified versions of the above:
|
|
64
|
+
* Foo.find '2,1' or Foo.find '2,1;7,3'
|
data/Manifest.txt
CHANGED
data/{README → README.txt}
RENAMED
|
File without changes
|
data/Rakefile
CHANGED
|
@@ -15,12 +15,14 @@ AUTHOR = "Dr Nic Williams"
|
|
|
15
15
|
EMAIL = "drnicwilliams@gmail.com"
|
|
16
16
|
DESCRIPTION = "Composite key support for ActiveRecords"
|
|
17
17
|
GEM_NAME = "composite_primary_keys" # what ppl will type to install your gem
|
|
18
|
+
config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
|
|
19
|
+
RUBYFORGE_USERNAME = config["username"]
|
|
18
20
|
RUBYFORGE_PROJECT = "compositekeys"
|
|
19
21
|
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
|
20
22
|
|
|
21
23
|
REV = nil #File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
|
|
22
|
-
|
|
23
|
-
CLEAN.include ['**/.*.sw?', '*.gem', '.config','debug.log','*.db','logfile','.DS_Store']
|
|
24
|
+
VERS = ENV['VERSION'] || (CompositePrimaryKeys::VERSION::STRING + (REV ? ".#{REV}" : ""))
|
|
25
|
+
CLEAN.include ['**/.*.sw?', '*.gem', '.config','debug.log','*.db','logfile','.DS_Store', '.project']
|
|
24
26
|
RDOC_OPTS = ['--quiet', '--title', "newgem documentation",
|
|
25
27
|
"--opname", "index.html",
|
|
26
28
|
"--line-numbers",
|
|
@@ -35,7 +37,7 @@ end
|
|
|
35
37
|
|
|
36
38
|
# Generate all the Rake tasks
|
|
37
39
|
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
|
38
|
-
hoe = Hoe.new(GEM_NAME,
|
|
40
|
+
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
39
41
|
p.author = AUTHOR
|
|
40
42
|
p.description = DESCRIPTION
|
|
41
43
|
p.email = EMAIL
|
|
@@ -43,7 +45,7 @@ hoe = Hoe.new(GEM_NAME, VER) do |p|
|
|
|
43
45
|
p.url = HOMEPATH
|
|
44
46
|
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
|
45
47
|
p.test_globs = ["test/**/test*.rb"]
|
|
46
|
-
p.clean_globs
|
|
48
|
+
p.clean_globs |= CLEAN #An array of file patterns to delete on clean.
|
|
47
49
|
|
|
48
50
|
# == Optional
|
|
49
51
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
|
@@ -51,18 +53,13 @@ hoe = Hoe.new(GEM_NAME, VER) do |p|
|
|
|
51
53
|
#p.spec_extras - A hash of extra values to set in the gemspec.
|
|
52
54
|
end
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
|
56
|
+
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
|
|
57
|
+
PATH = RUBYFORGE_PROJECT
|
|
58
|
+
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
|
58
59
|
|
|
59
|
-
RELEASE_NAME = "REL #{PKG_VERSION}"
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
for adapter in %w( mysql sqlite oracle postgresql ) # UNTESTED - firebird sqlserver sqlserver_odbc db2 sybase openbase )
|
|
61
|
+
# UNTESTED - firebird sqlserver sqlserver_odbc db2 sybase openbase
|
|
62
|
+
for adapter in %w( mysql sqlite oracle postgresql )
|
|
66
63
|
Rake::TestTask.new("test_#{adapter}") { |t|
|
|
67
64
|
t.libs << "test" << "test/connections/native_#{adapter}"
|
|
68
65
|
t.pattern = "test/test_*.rb"
|
|
@@ -75,13 +72,17 @@ SCHEMA_PATH = File.join(File.dirname(__FILE__), *%w(test fixtures db_definitions
|
|
|
75
72
|
desc 'Build the MySQL test databases'
|
|
76
73
|
task :build_mysql_databases do
|
|
77
74
|
puts File.join(SCHEMA_PATH, 'mysql.sql')
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
socket = '/Applications/MAMP/tmp/mysql/mysql.sock'
|
|
76
|
+
user = 'root'
|
|
77
|
+
sh %{ mysqladmin -u #{user} -S #{socket} -p create "#{GEM_NAME}_unittest" }
|
|
78
|
+
sh %{ mysql -u #{user} -S #{socket} -p "#{GEM_NAME}_unittest" < #{File.join(SCHEMA_PATH, 'mysql.sql')} }
|
|
80
79
|
end
|
|
81
80
|
|
|
82
81
|
desc 'Drop the MySQL test databases'
|
|
83
82
|
task :drop_mysql_databases do
|
|
84
|
-
|
|
83
|
+
socket = '/Applications/MAMP/tmp/mysql/mysql.sock'
|
|
84
|
+
user = 'root'
|
|
85
|
+
sh %{ mysqladmin -u #{user} -S #{socket} -p -f drop "#{GEM_NAME}_unittest" }
|
|
85
86
|
end
|
|
86
87
|
|
|
87
88
|
desc 'Rebuild the MySQL test databases'
|
|
@@ -106,13 +107,13 @@ task :rebuild_sqlite_databases => [:drop_sqlite_databases, :build_sqlite_databas
|
|
|
106
107
|
|
|
107
108
|
desc 'Build the PostgreSQL test databases'
|
|
108
109
|
task :build_postgresql_databases do
|
|
109
|
-
sh %{ createdb "#{
|
|
110
|
-
sh %{ psql "#{
|
|
110
|
+
sh %{ createdb "#{GEM_NAME}_unittest" }
|
|
111
|
+
sh %{ psql "#{GEM_NAME}_unittest" -f #{File.join(SCHEMA_PATH, 'postgresql.sql')} }
|
|
111
112
|
end
|
|
112
113
|
|
|
113
114
|
desc 'Drop the PostgreSQL test databases'
|
|
114
115
|
task :drop_postgresql_databases do
|
|
115
|
-
sh %{ dropdb "#{
|
|
116
|
+
sh %{ dropdb "#{GEM_NAME}_unittest" }
|
|
116
117
|
end
|
|
117
118
|
|
|
118
119
|
desc 'Rebuild the PostgreSQL test databases'
|
|
@@ -145,8 +146,31 @@ task :website_upload do
|
|
|
145
146
|
host = "#{config["username"]}@rubyforge.org"
|
|
146
147
|
remote_dir = "/var/www/gforge-projects/#{RUBYFORGE_PROJECT}/"
|
|
147
148
|
local_dir = 'website'
|
|
148
|
-
sh %{rsync -
|
|
149
|
+
sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
|
|
149
150
|
end
|
|
150
151
|
|
|
151
152
|
desc 'Generate and upload website files'
|
|
152
|
-
task :website => [:website_generate, :website_upload]
|
|
153
|
+
task :website => [:website_generate, :website_upload, :publish_docs]
|
|
154
|
+
|
|
155
|
+
desc 'Release the website and new gem version'
|
|
156
|
+
task :deploy => [:check_version, :website, :release] do
|
|
157
|
+
puts "Remember to create SVN tag:"
|
|
158
|
+
puts "svn copy svn+ssh://#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
|
159
|
+
"svn+ssh://#{RUBYFORGE_USERNAME}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
|
160
|
+
puts "Suggested comment:"
|
|
161
|
+
puts "Tagging release #{CHANGES}"
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
|
165
|
+
task :local_deploy => [:website_generate, :install_gem]
|
|
166
|
+
|
|
167
|
+
task :check_version do
|
|
168
|
+
unless ENV['VERSION']
|
|
169
|
+
puts 'Must pass a VERSION=x.y.z release version'
|
|
170
|
+
exit
|
|
171
|
+
end
|
|
172
|
+
unless ENV['VERSION'] == VERS
|
|
173
|
+
puts "Please update your version.rb to match the release version, currently #{VERS}"
|
|
174
|
+
exit
|
|
175
|
+
end
|
|
176
|
+
end
|
|
@@ -45,9 +45,9 @@ ActiveRecord::Base.class_eval do
|
|
|
45
45
|
include CompositePrimaryKeys::ActiveRecord::Base
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Dir[File.dirname(__FILE__) + '/composite_primary_keys/connection_adapters/*.rb'].each do |adapter|
|
|
49
49
|
begin
|
|
50
|
-
require "composite_primary_keys/connection_adapters/" + adapter
|
|
50
|
+
require "composite_primary_keys/connection_adapters/" + adapter.gsub('.rb','')
|
|
51
51
|
rescue MissingSourceFile
|
|
52
52
|
end
|
|
53
53
|
end
|
data/website/index.html
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<h1>Composite Primary Keys</h1>
|
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/compositekeys"; return false'>
|
|
35
35
|
Get Version
|
|
36
|
-
<a href="http://rubyforge.org/projects/compositekeys" class="numbers">0.8.
|
|
36
|
+
<a href="http://rubyforge.org/projects/compositekeys" class="numbers">0.8.5</a>
|
|
37
37
|
</div>
|
|
38
38
|
<h1>→ Ruby on Rails</h1>
|
|
39
39
|
|
|
@@ -271,6 +271,15 @@ other stories and things.</p>
|
|
|
271
271
|
<p><a href="http://groups.google.com/group/compositekeys">http://groups.google.com/group/compositekeys</a></p>
|
|
272
272
|
|
|
273
273
|
|
|
274
|
+
<h2>How to submit patches</h2>
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/compositekeys/trunk</code> for anonymous access.</p>
|
|
281
|
+
|
|
282
|
+
|
|
274
283
|
<h2>Licence</h2>
|
|
275
284
|
|
|
276
285
|
|
|
@@ -282,7 +291,7 @@ other stories and things.</p>
|
|
|
282
291
|
|
|
283
292
|
<p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a>.</p>
|
|
284
293
|
<p class="coda">
|
|
285
|
-
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>,
|
|
294
|
+
<a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 1st June 2007<br>
|
|
286
295
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
|
287
296
|
</p>
|
|
288
297
|
</div>
|
data/website/index.txt
CHANGED
|
@@ -145,6 +145,13 @@ h2. Forum
|
|
|
145
145
|
|
|
146
146
|
"http://groups.google.com/group/compositekeys":http://groups.google.com/group/compositekeys
|
|
147
147
|
|
|
148
|
+
h2. How to submit patches
|
|
149
|
+
|
|
150
|
+
Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
The trunk repository is <code>svn://rubyforge.org/var/svn/compositekeys/trunk</code> for anonymous access.
|
|
154
|
+
|
|
148
155
|
h2. Licence
|
|
149
156
|
|
|
150
157
|
This code is free to use under the terms of the MIT licence.
|
data/website/version-raw.js
CHANGED
data/website/version.js
CHANGED
metadata
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
|
-
rubygems_version: 0.9.
|
|
2
|
+
rubygems_version: 0.9.4.1
|
|
3
3
|
specification_version: 1
|
|
4
4
|
name: composite_primary_keys
|
|
5
5
|
version: !ruby/object:Gem::Version
|
|
6
|
-
version: 0.8.
|
|
7
|
-
date: 2007-05
|
|
6
|
+
version: 0.8.5
|
|
7
|
+
date: 2007-06-05 00:00:00 +02:00
|
|
8
8
|
summary: Composite key support for ActiveRecords
|
|
9
9
|
require_paths:
|
|
10
10
|
- lib
|
|
@@ -29,10 +29,9 @@ post_install_message:
|
|
|
29
29
|
authors:
|
|
30
30
|
- Dr Nic Williams
|
|
31
31
|
files:
|
|
32
|
-
- CHANGELOG
|
|
33
32
|
- History.txt
|
|
34
33
|
- Manifest.txt
|
|
35
|
-
- README
|
|
34
|
+
- README.txt
|
|
36
35
|
- Rakefile
|
|
37
36
|
- install.rb
|
|
38
37
|
- lib/composite_primary_keys.rb
|
|
@@ -122,10 +121,16 @@ test_files:
|
|
|
122
121
|
- test/test_santiago.rb
|
|
123
122
|
- test/test_tutorial_examle.rb
|
|
124
123
|
- test/test_update.rb
|
|
125
|
-
rdoc_options:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
rdoc_options:
|
|
125
|
+
- --main
|
|
126
|
+
- README.txt
|
|
127
|
+
extra_rdoc_files:
|
|
128
|
+
- History.txt
|
|
129
|
+
- Manifest.txt
|
|
130
|
+
- README.txt
|
|
131
|
+
- website/index.txt
|
|
132
|
+
- website/version-raw.txt
|
|
133
|
+
- website/version.txt
|
|
129
134
|
executables: []
|
|
130
135
|
|
|
131
136
|
extensions: []
|
data/CHANGELOG
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
* 0.3.3 * - bug fixes
|
|
2
|
-
- id=
|
|
3
|
-
- create now work
|
|
4
|
-
|
|
5
|
-
* 0.1.4 *
|
|
6
|
-
- it was important that #{primary_key} for composites --> 'key1,key2' and not 'key1key2'
|
|
7
|
-
so created PrimaryKeys class
|
|
8
|
-
|
|
9
|
-
* 0.0.1 * Initial version
|
|
10
|
-
- set_primary_keys(*keys) is the activation class method to transform an ActiveRecord into
|
|
11
|
-
a composite primary key AR
|
|
12
|
-
- find(*ids) supports the passing of
|
|
13
|
-
- id sets: Foo.find(2,1),
|
|
14
|
-
- lists of id sets: Foo.find([2,1], [7,3], [8,12]),
|
|
15
|
-
- and even stringified versions of the above:
|
|
16
|
-
- Foo.find '2,1' or Foo.find '2,1;7,3'
|