sequel-batches 0.1.2 → 0.1.3

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: d672ec841f323173981c39aae77162e2fc1c8df8
4
- data.tar.gz: d5efb671fcf8e70b52f71e332fa1db8fdaf1137b
3
+ metadata.gz: 59714df347d4f6cb7e6e697051a8a049fda88dc1
4
+ data.tar.gz: 011f44112aee94dda9e0e47e10999e13fe4972fd
5
5
  SHA512:
6
- metadata.gz: 3d9875b3215e0362cfed0c0dcd243c81a5bedca354c98d03c235c28a6586a3cecf395293443a4d68d40320728617181d2bb2b9e49cea776d76cd8fb946497f21
7
- data.tar.gz: 27a68707ccbb69b13e23fa9f6e076e116e77ec04afeb1315e42d8b8e142c383185a9a09991376f2cc6887b8818304ce94e6967e59c84214924e744cbc0ff8f57
6
+ metadata.gz: eb8daebb6ba2b19abcb3ee3ce6070042b28b36e9d63d01bb9a35f367faacc228e8a1908a22631d08291d70f54d49e8b1f6d10bdb5403b9825b7bc6b8610cb7b2
7
+ data.tar.gz: 9b9b8ab0afcb1670d6aa517d29299ab1e5887ed322e3f848db85d10b240a5c5ef8529dc93e55ea3406a7b5a1521ef2b14d68f250c52e988fe86a675e98aa7b57
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  *.gem
13
+ .coveralls.yml
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ jruby-9.1.15.0
data/.travis.yml CHANGED
@@ -1,8 +1,16 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.1
4
+ - 2.3.3
5
+ - 2.4.2
6
+ - 2.5.0
7
+ - jruby
5
8
  before_install: gem install bundler -v 1.14.6
9
+ env:
10
+ - SEQUEL_VERSION='~> 4.0'
11
+ - SEQUEL_VERSION='~> 5.0'
12
+ gemfile:
13
+ - gemfiles/ci.gemfile
6
14
  addons:
7
15
  postgresql: "9.6"
8
16
  services:
data/Gemfile.lock CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sequel-batches (0.1.1)
5
- pg (~> 0.20.0)
6
- sequel (~> 4.0)
4
+ sequel-batches (0.1.2)
5
+ sequel (~> 5.0)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
@@ -17,12 +16,17 @@ GEM
17
16
  tins (~> 1.6)
18
17
  diff-lcs (1.3)
19
18
  docile (1.1.5)
19
+ ffi (1.9.23-java)
20
20
  json (2.1.0)
21
+ json (2.1.0-java)
21
22
  method_source (0.9.0)
22
- pg (0.20.0)
23
23
  pry (0.11.3)
24
24
  coderay (~> 1.1.0)
25
25
  method_source (~> 0.9.0)
26
+ pry (0.11.3-java)
27
+ coderay (~> 1.1.0)
28
+ method_source (~> 0.9.0)
29
+ spoon (~> 0.0)
26
30
  rake (10.5.0)
27
31
  rspec (3.7.0)
28
32
  rspec-core (~> 3.7.0)
@@ -37,18 +41,21 @@ GEM
37
41
  diff-lcs (>= 1.2.0, < 2.0)
38
42
  rspec-support (~> 3.7.0)
39
43
  rspec-support (3.7.1)
40
- sequel (4.49.0)
44
+ sequel (5.6.0)
41
45
  simplecov (0.14.1)
42
46
  docile (~> 1.1.0)
43
47
  json (>= 1.8, < 3)
44
48
  simplecov-html (~> 0.10.0)
45
49
  simplecov-html (0.10.2)
50
+ spoon (0.0.6)
51
+ ffi
46
52
  term-ansicolor (1.6.0)
47
53
  tins (~> 1.0)
48
54
  thor (0.19.4)
49
55
  tins (1.16.3)
50
56
 
51
57
  PLATFORMS
58
+ java
52
59
  ruby
53
60
 
54
61
  DEPENDENCIES
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # Sequel::Batches [![Build Status](https://travis-ci.org/umbrellio/sequel-batches.svg?branch=master)](https://travis-ci.org/umbrellio/sequel-batches)
1
+ # Sequel::Batches [![Build Status](https://travis-ci.org/umbrellio/sequel-batches.svg?branch=master)](https://travis-ci.org/umbrellio/sequel-batches) [![Coverage Status](https://coveralls.io/repos/github/umbrellio/sequel-batches/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/sequel-batches?branch=master)
2
2
 
3
3
  This dataset extension provides the method #in_batches. The method splits dataset in parts and yields it.
4
4
 
5
5
  You can set following options:
6
6
  - pk Overrides primary key of your dataset
7
7
  - of sets chunk size (1000 by default)
8
- - start as a hash { <column>: <start_value> } represents frame start for batch processing
8
+ - start as a hash { [column]: <start_value> } represents frame start for batch processing
9
9
  - finish as a hash represents frame end
10
10
 
11
11
  ## Installation
@@ -0,0 +1,15 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec :path => '../'
4
+
5
+ # MRI/Rubinius Adapter Dependencies
6
+ platforms :ruby do
7
+ gem "pg", "~>0.20.0"
8
+ end
9
+
10
+ # JRuby Adapter Dependencies
11
+ platforms :jruby do
12
+ gem 'jdbc-postgres', '~> 9.4'
13
+ end
14
+
15
+ gem sequel, "#{ENV['SEQUEL_VERSION']}"
@@ -0,0 +1,74 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ sequel-batches (0.1.2)
5
+ sequel (~> 5.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ coderay (1.1.2)
11
+ coveralls (0.8.21)
12
+ json (>= 1.8, < 3)
13
+ simplecov (~> 0.14.1)
14
+ term-ansicolor (~> 1.3)
15
+ thor (~> 0.19.4)
16
+ tins (~> 1.6)
17
+ diff-lcs (1.3)
18
+ docile (1.1.5)
19
+ ffi (1.9.23-java)
20
+ jdbc-postgres (9.4.1212)
21
+ json (2.1.0)
22
+ json (2.1.0-java)
23
+ method_source (0.9.0)
24
+ pg (0.20.0)
25
+ pry (0.11.3)
26
+ coderay (~> 1.1.0)
27
+ method_source (~> 0.9.0)
28
+ pry (0.11.3-java)
29
+ coderay (~> 1.1.0)
30
+ method_source (~> 0.9.0)
31
+ spoon (~> 0.0)
32
+ rake (10.5.0)
33
+ rspec (3.7.0)
34
+ rspec-core (~> 3.7.0)
35
+ rspec-expectations (~> 3.7.0)
36
+ rspec-mocks (~> 3.7.0)
37
+ rspec-core (3.7.1)
38
+ rspec-support (~> 3.7.0)
39
+ rspec-expectations (3.7.0)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.7.0)
42
+ rspec-mocks (3.7.0)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.7.0)
45
+ rspec-support (3.7.1)
46
+ sequel (5.6.0)
47
+ simplecov (0.14.1)
48
+ docile (~> 1.1.0)
49
+ json (>= 1.8, < 3)
50
+ simplecov-html (~> 0.10.0)
51
+ simplecov-html (0.10.2)
52
+ spoon (0.0.6)
53
+ ffi
54
+ term-ansicolor (1.6.0)
55
+ tins (~> 1.0)
56
+ thor (0.19.4)
57
+ tins (1.16.3)
58
+
59
+ PLATFORMS
60
+ java
61
+ ruby
62
+
63
+ DEPENDENCIES
64
+ bundler (~> 1.16)
65
+ coveralls
66
+ jdbc-postgres (~> 9.4)
67
+ pg (~> 0.20.0)
68
+ pry (~> 0.10)
69
+ rake (~> 10.0)
70
+ rspec (~> 3.0)
71
+ sequel-batches!
72
+
73
+ BUNDLED WITH
74
+ 1.16.1
@@ -46,7 +46,16 @@ module Sequel
46
46
  Sequel.&(*pk.map { |col| range_expr.call(col, entire_min_max[col]) })
47
47
  )
48
48
  if min_max.present?
49
- ds=ds.where(Sequel.function(:concat, qualified_pk.map{|col| Sequel.cast(col, :text)}) > Sequel.function(:concat, min_max.values.map(&:last)))
49
+ pk_combinations = pk.each_with_index.map { |x, i| pk[0..-i] }
50
+ ds = ds.where(Sequel.|(*pk_combinations.each_with_index.map do |pks, i|
51
+ Sequel.&(*pks.each_with_index.map do |col, j|
52
+ if j == i
53
+ Sequel[first_source][col] > min_max[col].last
54
+ else
55
+ Sequel[first_source][col] >= min_max[col].last
56
+ end
57
+ end)
58
+ end))
50
59
  end
51
60
 
52
61
  min_max = self.db.from(ds).select(*pk_expr.call(pk: pk)).first
@@ -1,7 +1,7 @@
1
1
  module Sequel
2
2
  module Extensions
3
3
  module Batches
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
6
6
  end
7
7
  end
@@ -30,12 +30,10 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency "sequel", "~> 4.0"
34
- spec.add_dependency "pg", "~> 0.20.0"
35
-
33
+ spec.add_development_dependency "sequel", "~> 5.0"
36
34
  spec.add_development_dependency "bundler", "~> 1.16"
37
35
  spec.add_development_dependency "rake", "~> 10.0"
38
36
  spec.add_development_dependency "rspec", "~> 3.0"
39
37
  spec.add_development_dependency "pry", "~> 0.10"
40
- spec.add_development_dependency "coveralls"
38
+ spec.add_development_dependency "coveralls"
41
39
  end
metadata CHANGED
@@ -1,108 +1,94 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-batches
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - fiscal-cliff
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2018-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: sequel
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '4.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '4.0'
27
- - !ruby/object:Gem::Dependency
28
- name: pg
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 0.20.0
34
- type: :runtime
18
+ version: '5.0'
19
+ name: sequel
35
20
  prerelease: false
21
+ type: :development
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: 0.20.0
26
+ version: '5.0'
41
27
  - !ruby/object:Gem::Dependency
42
- name: bundler
43
28
  requirement: !ruby/object:Gem::Requirement
44
29
  requirements:
45
30
  - - "~>"
46
31
  - !ruby/object:Gem::Version
47
32
  version: '1.16'
48
- type: :development
33
+ name: bundler
49
34
  prerelease: false
35
+ type: :development
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
40
  version: '1.16'
55
41
  - !ruby/object:Gem::Dependency
56
- name: rake
57
42
  requirement: !ruby/object:Gem::Requirement
58
43
  requirements:
59
44
  - - "~>"
60
45
  - !ruby/object:Gem::Version
61
46
  version: '10.0'
62
- type: :development
47
+ name: rake
63
48
  prerelease: false
49
+ type: :development
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
54
  version: '10.0'
69
55
  - !ruby/object:Gem::Dependency
70
- name: rspec
71
56
  requirement: !ruby/object:Gem::Requirement
72
57
  requirements:
73
58
  - - "~>"
74
59
  - !ruby/object:Gem::Version
75
60
  version: '3.0'
76
- type: :development
61
+ name: rspec
77
62
  prerelease: false
63
+ type: :development
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
68
  version: '3.0'
83
69
  - !ruby/object:Gem::Dependency
84
- name: pry
85
70
  requirement: !ruby/object:Gem::Requirement
86
71
  requirements:
87
72
  - - "~>"
88
73
  - !ruby/object:Gem::Version
89
74
  version: '0.10'
90
- type: :development
75
+ name: pry
91
76
  prerelease: false
77
+ type: :development
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0.10'
97
83
  - !ruby/object:Gem::Dependency
98
- name: coveralls
99
84
  requirement: !ruby/object:Gem::Requirement
100
85
  requirements:
101
86
  - - ">="
102
87
  - !ruby/object:Gem::Version
103
88
  version: '0'
104
- type: :development
89
+ name: coveralls
105
90
  prerelease: false
91
+ type: :development
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
94
  - - ">="
@@ -117,6 +103,7 @@ extra_rdoc_files: []
117
103
  files:
118
104
  - ".gitignore"
119
105
  - ".rspec"
106
+ - ".ruby-version"
120
107
  - ".travis.yml"
121
108
  - CODE_OF_CONDUCT.md
122
109
  - Gemfile
@@ -126,6 +113,8 @@ files:
126
113
  - Rakefile
127
114
  - bin/console
128
115
  - bin/setup
116
+ - gemfiles/ci.gemfile
117
+ - gemfiles/ci.gemfile.lock
129
118
  - lib/sequel.rb
130
119
  - lib/sequel/extensions/batches.rb
131
120
  - lib/sequel/extensions/batches/version.rb
@@ -135,7 +124,7 @@ licenses:
135
124
  - MIT
136
125
  metadata:
137
126
  allowed_push_host: https://rubygems.org
138
- post_install_message:
127
+ post_install_message:
139
128
  rdoc_options: []
140
129
  require_paths:
141
130
  - lib
@@ -150,10 +139,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
139
  - !ruby/object:Gem::Version
151
140
  version: '0'
152
141
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.6.13
155
- signing_key:
142
+ rubyforge_project:
143
+ rubygems_version: 2.6.14
144
+ signing_key:
156
145
  specification_version: 4
157
146
  summary: The extension mimics AR5 batches api
158
147
  test_files: []
159
- has_rdoc: