tako 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ca39127099a564246ad5d09d5a62bd56aa2c3ce
4
- data.tar.gz: d4352705f48a0652b53e17d858f7de38450ae5b7
3
+ metadata.gz: 35e7110f9ba9f2ebd33c07036b4dc366b1341e59
4
+ data.tar.gz: 1b79b49722ba608aff2f3a1d5c737b5cb50a1eef
5
5
  SHA512:
6
- metadata.gz: 41c6d58a96b436782fb1514bb0230ff85e724fcbac396cb4eb2af293551a3c786e43b7d093dbd533b5d56b127efd27c1b335c8bea5b839a50a70890a18bcbe1e
7
- data.tar.gz: 11eafb366857e3ea10bfb61d9b9a1c9f7e7d277fa42ccfbf2829919045aa77cbc7d98c92c43d6f46fc67f1ccc99471e4d4434b0abc1663772e31265fb7961f5d
6
+ metadata.gz: 96a5f2c3f545f976d261f54cf53575655d3daa9bfd7c52004bd3e106432264d3f231b2c933de84d202e04d717b3c9dc3db960466cc7b374d3cf7fcb2b03014a7
7
+ data.tar.gz: 1dcd48453db7c01125c93794abb54815ed8e883ba4dbd179a527651707b570fe15675b5a782a93a6edf1babaeeabb582d0d5097bd27e1c4af2ce738380c6f58a
data/.gitignore CHANGED
@@ -7,5 +7,6 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /gemfiles/*.lock
10
11
  *.swp
11
12
  *.gem
data/.travis.yml CHANGED
@@ -1,4 +1,17 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.3.0
4
+ - 2.4.1
5
+ - 2.5.0
6
+ gemfile:
7
+ - gemfiles/rails_42.gemfile
8
+ - gemfiles/rails_50.gemfile
9
+ - gemfiles/rails_51.gemfile
10
+ - gemfiles/rails_52.gemfile
11
+ - gemfiles/rails_edge.gemfile
12
+ matrix:
13
+ exclude:
14
+ # AR 6.0+ required CRuby 2.4.1+
15
+ - rvm: 2.3.0
16
+ gemfile: gemfiles/rails_edge.gemfile
4
17
  before_install: gem install bundler -v 1.11.2
data/Rakefile CHANGED
@@ -2,7 +2,6 @@ require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec) do |t|
5
- t.exclude_pattern = "spec/dummy*/**/*"
6
5
  end
7
6
 
8
7
  task :default => :spec
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "activerecord", "~> 4.2.0"
4
+ gem "mysql2", ">= 0.3.13", "< 0.5"
5
+
6
+ gemspec :path => "../"
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "activerecord", "~> 5.0.0"
4
+
5
+ gemspec :path => "../"
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "activerecord", "~> 5.1.0"
4
+
5
+ gemspec :path => "../"
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "activerecord", "~> 5.2.0"
4
+
5
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
4
+
5
+ gem "activerecord", :github => "rails/rails"
6
+
7
+ gemspec :path => "../"
@@ -1,30 +1,34 @@
1
1
  module Tako
2
2
  module ActiveRecordExt
3
3
  module AssociationRelation
4
+ SHARDED_METHODS = [
5
+ :any?,
6
+ :build,
7
+ :count,
8
+ :create,
9
+ :create!,
10
+ :delete,
11
+ :delete_all,
12
+ :destroy,
13
+ :destroy_all,
14
+ :empty?,
15
+ :find,
16
+ :first,
17
+ :include?,
18
+ :last,
19
+ :length,
20
+ :many?,
21
+ :pluck,
22
+ :select,
23
+ :size,
24
+ :sum,
25
+ :to_a,
26
+ :uniq,
27
+ ] & ActiveRecord::AssociationRelation.public_instance_methods
28
+
4
29
  def self.included(mod)
5
30
  mod.extend(ShardedMethods)
6
- mod.sharded_methods :any?,
7
- :build,
8
- :count,
9
- :create,
10
- :create!,
11
- :delete,
12
- :delete_all,
13
- :destroy,
14
- :destroy_all,
15
- :empty?,
16
- :find,
17
- :first,
18
- :include?,
19
- :last,
20
- :length,
21
- :many?,
22
- :pluck,
23
- :select,
24
- :size,
25
- :sum,
26
- :to_a,
27
- :uniq
31
+ mod.sharded_methods *SHARDED_METHODS
28
32
  end
29
33
 
30
34
  def current_shard
@@ -1,28 +1,32 @@
1
1
  module Tako
2
2
  module ActiveRecordExt
3
3
  module CollectionAssociation
4
+ SHARDED_METHODS = [
5
+ :reader,
6
+ :writer,
7
+ :ids_reader,
8
+ :ids_writer,
9
+ :create,
10
+ :create!,
11
+ :build,
12
+ :any?,
13
+ :count,
14
+ :empty?,
15
+ :first,
16
+ :include?,
17
+ :last,
18
+ :length,
19
+ :load_target,
20
+ :many?,
21
+ :reload,
22
+ :size,
23
+ :select,
24
+ :uniq,
25
+ ] & ActiveRecord::Associations::CollectionAssociation.public_instance_methods
26
+
4
27
  def self.included(mod)
5
28
  mod.extend(ShardedMethods)
6
- mod.sharded_methods :reader,
7
- :writer,
8
- :ids_reader,
9
- :ids_writer,
10
- :create,
11
- :create!,
12
- :build,
13
- :any?,
14
- :count,
15
- :empty?,
16
- :first,
17
- :include?,
18
- :last,
19
- :length,
20
- :load_target,
21
- :many?,
22
- :reload,
23
- :size,
24
- :select,
25
- :uniq
29
+ mod.sharded_methods *SHARDED_METHODS
26
30
  end
27
31
  end
28
32
  end
@@ -1,32 +1,36 @@
1
1
  module Tako
2
2
  module ActiveRecordExt
3
3
  module CollectionProxy
4
+ SHARDED_METHODS = [
5
+ :any?,
6
+ :build,
7
+ :count,
8
+ :create,
9
+ :create!,
10
+ :concat,
11
+ :delete,
12
+ :delete_all,
13
+ :destroy,
14
+ :destroy_all,
15
+ :empty?,
16
+ :find,
17
+ :first,
18
+ :include?,
19
+ :last,
20
+ :length,
21
+ :many?,
22
+ :pluck,
23
+ :replace,
24
+ :select,
25
+ :size,
26
+ :sum,
27
+ :to_a,
28
+ :uniq,
29
+ ] & ActiveRecord::Associations::CollectionProxy.public_instance_methods
30
+
4
31
  def self.included(mod)
5
32
  mod.extend(ShardedMethods)
6
- mod.sharded_methods :any?,
7
- :build,
8
- :count,
9
- :create,
10
- :create!,
11
- :concat,
12
- :delete,
13
- :delete_all,
14
- :destroy,
15
- :destroy_all,
16
- :empty?,
17
- :find,
18
- :first,
19
- :include?,
20
- :last,
21
- :length,
22
- :many?,
23
- :pluck,
24
- :replace,
25
- :select,
26
- :size,
27
- :sum,
28
- :to_a,
29
- :uniq
33
+ mod.sharded_methods *SHARDED_METHODS
30
34
  end
31
35
 
32
36
  def current_shard
data/lib/tako/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tako
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tako
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masashi AKISUE
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-26 00:00:00.000000000 Z
11
+ date: 2018-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -112,6 +112,11 @@ files:
112
112
  - bin/console
113
113
  - bin/setup
114
114
  - circle.yml
115
+ - gemfiles/rails_42.gemfile
116
+ - gemfiles/rails_50.gemfile
117
+ - gemfiles/rails_51.gemfile
118
+ - gemfiles/rails_52.gemfile
119
+ - gemfiles/rails_edge.gemfile
115
120
  - lib/tako.rb
116
121
  - lib/tako/active_record_ext.rb
117
122
  - lib/tako/active_record_ext/association.rb
@@ -154,9 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
159
  version: '0'
155
160
  requirements: []
156
161
  rubyforge_project:
157
- rubygems_version: 2.5.1
162
+ rubygems_version: 2.6.13
158
163
  signing_key:
159
164
  specification_version: 4
160
165
  summary: Provides Horizontal-sharing for ActiveRecord
161
166
  test_files: []
162
- has_rdoc: