crewait 0.1.5 → 0.1.6

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/Manifest CHANGED
@@ -1,5 +1,4 @@
1
1
  Manifest
2
2
  README.rdoc
3
3
  Rakefile
4
- crewait.gemspec
5
4
  lib/crewait.rb
@@ -2,8 +2,9 @@
2
2
 
3
3
  Check out http://jonah.org/articles/crewait_go_.html for a guide to Crewait.
4
4
 
5
- = Recent heroes
5
+ = Heroes
6
6
 
7
+ alexkalish made it possible to have namespaced models!
7
8
  choffstein added Postgresql support!
8
9
  jakemack resolved some conflicts with Array#to_sql!
9
10
 
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'echoe'
5
5
 
6
- Echoe.new('crewait', '0.1.5') do |p|
6
+ Echoe.new('crewait', '0.1.6') do |p|
7
7
  p.description = "Intuitive and fast bulk insertion in ActiveRecord"
8
8
  p.url = "http://github.com/theAlmanac/crewait"
9
9
  p.author = "Jonah Bloch-Johnson"
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{crewait}
5
- s.version = "0.1.5"
5
+ s.version = "0.1.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jonah Bloch-Johnson"]
9
- s.date = %q{2010-07-19}
9
+ s.date = %q{2010-08-19}
10
10
  s.description = %q{Intuitive and fast bulk insertion in ActiveRecord}
11
11
  s.email = %q{me@jonah.org}
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/crewait.rb"]
13
- s.files = ["Manifest", "README.rdoc", "Rakefile", "crewait.gemspec", "lib/crewait.rb"]
13
+ s.files = ["Manifest", "README.rdoc", "Rakefile", "lib/crewait.rb", "crewait.gemspec"]
14
14
  s.homepage = %q{http://github.com/theAlmanac/crewait}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Crewait", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
@@ -10,14 +10,13 @@ module Crewait
10
10
 
11
11
  # add one crewait instance
12
12
  def self.for(model, hash)
13
- table_name = model.table_name
14
13
  # if this class is new, add in the next_insert_value
15
- @@hash_of_next_inserts[table_name] ||= model.next_insert_id
14
+ @@hash_of_next_inserts[model] ||= model.next_insert_id
16
15
  # if this class is new, create a new hash to receive it
17
- @@hash_of_hashes[table_name] ||= {}
18
- @@hash_of_hashes[table_name].respectively_insert(hash)
16
+ @@hash_of_hashes[model] ||= {}
17
+ @@hash_of_hashes[model].respectively_insert(hash)
19
18
  # add dummy methods
20
- fake_id = @@hash_of_next_inserts[table_name] + @@hash_of_hashes[table_name].inner_length - 1
19
+ fake_id = @@hash_of_next_inserts[model] + @@hash_of_hashes[model].inner_length - 1
21
20
  eigenclass = class << hash; self; end
22
21
  eigenclass.class_eval {
23
22
  define_method(:id) { fake_id }
@@ -31,7 +30,7 @@ module Crewait
31
30
 
32
31
  def self.go!
33
32
  @@hash_of_hashes.each do |key, hash|
34
- hash.import_to_sql(eval(key.classify))
33
+ hash.import_to_sql(key)
35
34
  end
36
35
  @@hash_of_hashes = {}
37
36
  @@hash_of_next_inserts = {}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crewait
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jonah Bloch-Johnson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-19 00:00:00 -04:00
18
+ date: 2010-08-19 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -32,8 +32,8 @@ files:
32
32
  - Manifest
33
33
  - README.rdoc
34
34
  - Rakefile
35
- - crewait.gemspec
36
35
  - lib/crewait.rb
36
+ - crewait.gemspec
37
37
  has_rdoc: true
38
38
  homepage: http://github.com/theAlmanac/crewait
39
39
  licenses: []