postgres_upsert 5.0.0 → 5.1.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NmI3N2Q0NmE4M2E3NjcxNzQxOTA2MDQ5NzAzMTZlMzk1Y2QzNmNlZQ==
5
- data.tar.gz: !binary |-
6
- MjEwODZlMTFlOGIwNTk2NGE3Y2FjMThhYjM0ZDU1YTZkOTAzOWFlMA==
2
+ SHA256:
3
+ metadata.gz: 89478e281fa4cd37be98385dab13c96de8f4128702e4a9cfd1c7f8049d912fb8
4
+ data.tar.gz: b20dc2e32478209af409f86299ea5c702be7c7ec8cf87d7e2dd2035afe27130a
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MjQ5NTI0MzAyOWM0NTU3MmI2ZjBmYjMzNWJkZTcyYTdiOWNjNTk4MDYxMTdi
10
- NDY3ZmQwNjRiNjE0YjE0ZDgyYzU0N2Q1NzhhZTcxNjRmZThiNjUyZTJkMTkw
11
- NjY0NDI2ODU1OWYyNjA3ZmVlY2EwODRiMzBmYTNhYzQxODQ2ODk=
12
- data.tar.gz: !binary |-
13
- ZGIyNzNiZGUxOTNmZDVlNTQxMWRkNjk4OWYxZWUyNTQ2OTkzNGZlYzBjOGVj
14
- NmY2NDNlZmZmNWYzZTEwZTEwZWEzMjAyYzE3ZGQyNjUyY2NjY2Q4NGFjODgw
15
- MzY1ZjZlNjUwZjU4MmY3NDMwOGViMDhlNjJmZThhN2MyNjg3NGY=
6
+ metadata.gz: 4349cbfbeeeeb5bdd4b95086f693e19968319f9a3b4a2bf0dbb290789b9e9893496463a08335dd2e6f9f2d7c0717036cdabfdbca00e1d2ab394beb143bbd2d45
7
+ data.tar.gz: 8abcd0a2167f3ed42ed6fa1c70c145203a565a8a1418ea3f265a1b81a8267e22aa321b544d350d8c711d420d53c0263c9487bfc8678e5499dad1363475ee2cd0
data/.rubocop.yml ADDED
@@ -0,0 +1,57 @@
1
+ AllCops:
2
+ Exclude:
3
+ - '.*'
4
+ - 'app/*'
5
+ - 'bin/*'
6
+ - 'config*'
7
+ - 'db/*'
8
+ - '*.md'
9
+ - 'Gemfile'
10
+ - 'Gemfile.lock'
11
+
12
+ Layout/Tab:
13
+ Enabled: false
14
+
15
+ Layout/IndentationWidth:
16
+ Enabled: false
17
+
18
+ Metrics/LineLength:
19
+ Max: 99
20
+
21
+ Metrics/MethodLength:
22
+ CountAsOne: ['array', 'hash', 'heredoc']
23
+
24
+ Style/RescueModifier:
25
+ Enabled: false
26
+
27
+ Layout/TrailingEmptyLines:
28
+ Enabled: false
29
+
30
+ Layout/AccessModifierIndentation:
31
+ Enabled: false
32
+
33
+ Style/BlockComments:
34
+ Exclude:
35
+ - 'spec/spec_helper.rb'
36
+
37
+ Style/Documentation:
38
+ Enabled: false
39
+
40
+ Style/FrozenStringLiteralComment:
41
+ Enabled: false
42
+
43
+ Style/HashEachMethods:
44
+ Enabled: true
45
+
46
+ Style/HashTransformKeys:
47
+ Enabled: true
48
+
49
+ Style/HashTransformValues:
50
+ Enabled: true
51
+
52
+ Metrics/BlockLength:
53
+ Exclude:
54
+ - 'spec/*'
55
+
56
+ Layout/MultilineMethodCallIndentation:
57
+ Enabled: false
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ postgres_upsert
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.6.5
data/.travis.yml CHANGED
@@ -1,5 +1,20 @@
1
1
  language: ruby
2
+ dist: trusty
3
+ before_install:
4
+ - gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
5
+ - gem install bundler
6
+ - cp config/database.yml.travis config/database.yml
7
+ - psql -c 'create database ar_pg_copy_test;' -U postgres
8
+
2
9
  rvm:
3
- - 2.1.0
4
- - rbx-2
5
- - ruby-head
10
+ - 2.5.0
11
+
12
+ script:
13
+ - gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
14
+ - bundle exec rake db:setup
15
+ - bundle exec rspec spec
16
+ services:
17
+ postgresql
18
+ addons:
19
+ postgresql: "9.4"
20
+
data/Gemfile CHANGED
@@ -1,5 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # specify gem dependencies in activerecord-postgres-hstore.gemspec
4
- # except the platform-specific dependencies below
3
+ # specify gem dependencies in postgres_upsert.gemspec
5
4
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- postgres_upsert (5.0.0)
4
+ postgres_upsert (5.1.0)
5
5
  activerecord (>= 3.0.0)
6
6
  pg (>= 0.17.0)
7
7
  rails (>= 3.0.0)
@@ -9,132 +9,194 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionmailer (4.2.0)
13
- actionpack (= 4.2.0)
14
- actionview (= 4.2.0)
15
- activejob (= 4.2.0)
12
+ actioncable (6.1.3.2)
13
+ actionpack (= 6.1.3.2)
14
+ activesupport (= 6.1.3.2)
15
+ nio4r (~> 2.0)
16
+ websocket-driver (>= 0.6.1)
17
+ actionmailbox (6.1.3.2)
18
+ actionpack (= 6.1.3.2)
19
+ activejob (= 6.1.3.2)
20
+ activerecord (= 6.1.3.2)
21
+ activestorage (= 6.1.3.2)
22
+ activesupport (= 6.1.3.2)
23
+ mail (>= 2.7.1)
24
+ actionmailer (6.1.3.2)
25
+ actionpack (= 6.1.3.2)
26
+ actionview (= 6.1.3.2)
27
+ activejob (= 6.1.3.2)
28
+ activesupport (= 6.1.3.2)
16
29
  mail (~> 2.5, >= 2.5.4)
17
- rails-dom-testing (~> 1.0, >= 1.0.5)
18
- actionpack (4.2.0)
19
- actionview (= 4.2.0)
20
- activesupport (= 4.2.0)
21
- rack (~> 1.6.0)
22
- rack-test (~> 0.6.2)
23
- rails-dom-testing (~> 1.0, >= 1.0.5)
24
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
25
- actionview (4.2.0)
26
- activesupport (= 4.2.0)
30
+ rails-dom-testing (~> 2.0)
31
+ actionpack (6.1.3.2)
32
+ actionview (= 6.1.3.2)
33
+ activesupport (= 6.1.3.2)
34
+ rack (~> 2.0, >= 2.0.9)
35
+ rack-test (>= 0.6.3)
36
+ rails-dom-testing (~> 2.0)
37
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
+ actiontext (6.1.3.2)
39
+ actionpack (= 6.1.3.2)
40
+ activerecord (= 6.1.3.2)
41
+ activestorage (= 6.1.3.2)
42
+ activesupport (= 6.1.3.2)
43
+ nokogiri (>= 1.8.5)
44
+ actionview (6.1.3.2)
45
+ activesupport (= 6.1.3.2)
27
46
  builder (~> 3.1)
28
- erubis (~> 2.7.0)
29
- rails-dom-testing (~> 1.0, >= 1.0.5)
30
- rails-html-sanitizer (~> 1.0, >= 1.0.1)
31
- activejob (4.2.0)
32
- activesupport (= 4.2.0)
33
- globalid (>= 0.3.0)
34
- activemodel (4.2.0)
35
- activesupport (= 4.2.0)
36
- builder (~> 3.1)
37
- activerecord (4.2.0)
38
- activemodel (= 4.2.0)
39
- activesupport (= 4.2.0)
40
- arel (~> 6.0)
41
- activesupport (4.2.0)
42
- i18n (~> 0.7)
43
- json (~> 1.7, >= 1.7.7)
44
- minitest (~> 5.1)
45
- thread_safe (~> 0.3, >= 0.3.4)
46
- tzinfo (~> 1.1)
47
- arel (6.0.0)
48
- builder (3.2.2)
47
+ erubi (~> 1.4)
48
+ rails-dom-testing (~> 2.0)
49
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
+ activejob (6.1.3.2)
51
+ activesupport (= 6.1.3.2)
52
+ globalid (>= 0.3.6)
53
+ activemodel (6.1.3.2)
54
+ activesupport (= 6.1.3.2)
55
+ activerecord (6.1.3.2)
56
+ activemodel (= 6.1.3.2)
57
+ activesupport (= 6.1.3.2)
58
+ activestorage (6.1.3.2)
59
+ actionpack (= 6.1.3.2)
60
+ activejob (= 6.1.3.2)
61
+ activerecord (= 6.1.3.2)
62
+ activesupport (= 6.1.3.2)
63
+ marcel (~> 1.0.0)
64
+ mini_mime (~> 1.0.2)
65
+ activesupport (6.1.3.2)
66
+ concurrent-ruby (~> 1.0, >= 1.0.2)
67
+ i18n (>= 1.6, < 2)
68
+ minitest (>= 5.1)
69
+ tzinfo (~> 2.0)
70
+ zeitwerk (~> 2.3)
71
+ ast (2.4.1)
72
+ builder (3.2.4)
49
73
  coderay (1.1.0)
50
- diff-lcs (1.1.3)
51
- erubis (2.7.0)
52
- globalid (0.3.5)
53
- activesupport (>= 4.1.0)
54
- i18n (0.7.0)
55
- json (1.8.2)
56
- loofah (2.0.1)
74
+ concurrent-ruby (1.1.8)
75
+ crass (1.0.6)
76
+ database_cleaner-active_record (2.0.1)
77
+ activerecord (>= 5.a)
78
+ database_cleaner-core (~> 2.0.0)
79
+ database_cleaner-core (2.0.1)
80
+ diff-lcs (1.4.4)
81
+ erubi (1.10.0)
82
+ globalid (0.4.2)
83
+ activesupport (>= 4.2.0)
84
+ i18n (1.8.10)
85
+ concurrent-ruby (~> 1.0)
86
+ jaro_winkler (1.5.4)
87
+ loofah (2.9.1)
88
+ crass (~> 1.0.2)
57
89
  nokogiri (>= 1.5.9)
58
- mail (2.6.3)
59
- mime-types (>= 1.16, < 3)
90
+ mail (2.7.1)
91
+ mini_mime (>= 0.1.1)
92
+ marcel (1.0.1)
60
93
  method_source (0.8.2)
61
- mime-types (2.6.1)
62
- mini_portile (0.6.2)
63
- minitest (5.5.1)
64
- nokogiri (1.6.6.2)
65
- mini_portile (~> 0.6.0)
66
- pg (0.18.2)
94
+ mini_mime (1.0.3)
95
+ mini_portile2 (2.5.1)
96
+ minitest (5.14.4)
97
+ nio4r (2.5.7)
98
+ nokogiri (1.11.3)
99
+ mini_portile2 (~> 2.5.0)
100
+ racc (~> 1.4)
101
+ parallel (1.19.2)
102
+ parser (2.7.1.3)
103
+ ast (~> 2.4.0)
104
+ pg (1.2.3)
67
105
  pry (0.10.1)
68
106
  coderay (~> 1.1.0)
69
107
  method_source (~> 0.8.1)
70
108
  slop (~> 3.4)
109
+ pry-nav (0.3.0)
110
+ pry (>= 0.9.10, < 0.13.0)
71
111
  pry-rails (0.3.2)
72
112
  pry (>= 0.9.10)
73
- rack (1.6.0)
74
- rack-test (0.6.3)
75
- rack (>= 1.0)
76
- rails (4.2.0)
77
- actionmailer (= 4.2.0)
78
- actionpack (= 4.2.0)
79
- actionview (= 4.2.0)
80
- activejob (= 4.2.0)
81
- activemodel (= 4.2.0)
82
- activerecord (= 4.2.0)
83
- activesupport (= 4.2.0)
84
- bundler (>= 1.3.0, < 2.0)
85
- railties (= 4.2.0)
86
- sprockets-rails
87
- rails-deprecated_sanitizer (1.0.3)
88
- activesupport (>= 4.2.0.alpha)
89
- rails-dom-testing (1.0.5)
90
- activesupport (>= 4.2.0.beta, < 5.0)
91
- nokogiri (~> 1.6.0)
92
- rails-deprecated_sanitizer (>= 1.0.1)
93
- rails-html-sanitizer (1.0.1)
94
- loofah (~> 2.0)
95
- railties (4.2.0)
96
- actionpack (= 4.2.0)
97
- activesupport (= 4.2.0)
113
+ racc (1.5.2)
114
+ rack (2.2.3)
115
+ rack-test (1.1.0)
116
+ rack (>= 1.0, < 3)
117
+ rails (6.1.3.2)
118
+ actioncable (= 6.1.3.2)
119
+ actionmailbox (= 6.1.3.2)
120
+ actionmailer (= 6.1.3.2)
121
+ actionpack (= 6.1.3.2)
122
+ actiontext (= 6.1.3.2)
123
+ actionview (= 6.1.3.2)
124
+ activejob (= 6.1.3.2)
125
+ activemodel (= 6.1.3.2)
126
+ activerecord (= 6.1.3.2)
127
+ activestorage (= 6.1.3.2)
128
+ activesupport (= 6.1.3.2)
129
+ bundler (>= 1.15.0)
130
+ railties (= 6.1.3.2)
131
+ sprockets-rails (>= 2.0.0)
132
+ rails-dom-testing (2.0.3)
133
+ activesupport (>= 4.2.0)
134
+ nokogiri (>= 1.6)
135
+ rails-html-sanitizer (1.3.0)
136
+ loofah (~> 2.3)
137
+ railties (6.1.3.2)
138
+ actionpack (= 6.1.3.2)
139
+ activesupport (= 6.1.3.2)
140
+ method_source
98
141
  rake (>= 0.8.7)
99
- thor (>= 0.18.1, < 2.0)
100
- rake (10.4.2)
101
- rspec (2.99.0)
102
- rspec-core (~> 2.99.0)
103
- rspec-expectations (~> 2.99.0)
104
- rspec-mocks (~> 2.99.0)
105
- rspec-collection_matchers (1.1.2)
106
- rspec-expectations (>= 2.99.0.beta1)
107
- rspec-core (2.99.2)
108
- rspec-expectations (2.99.2)
109
- diff-lcs (>= 1.1.3, < 2.0)
110
- rspec-mocks (2.99.3)
111
- rspec-rails (2.99.0)
112
- actionpack (>= 3.0)
113
- activemodel (>= 3.0)
114
- activesupport (>= 3.0)
115
- railties (>= 3.0)
116
- rspec-collection_matchers
117
- rspec-core (~> 2.99.0)
118
- rspec-expectations (~> 2.99.0)
119
- rspec-mocks (~> 2.99.0)
142
+ thor (~> 1.0)
143
+ rainbow (3.0.0)
144
+ rake (13.0.3)
145
+ rexml (3.2.4)
146
+ rspec-core (3.10.1)
147
+ rspec-support (~> 3.10.0)
148
+ rspec-expectations (3.10.1)
149
+ diff-lcs (>= 1.2.0, < 2.0)
150
+ rspec-support (~> 3.10.0)
151
+ rspec-mocks (3.10.2)
152
+ diff-lcs (>= 1.2.0, < 2.0)
153
+ rspec-support (~> 3.10.0)
154
+ rspec-rails (5.0.1)
155
+ actionpack (>= 5.2)
156
+ activesupport (>= 5.2)
157
+ railties (>= 5.2)
158
+ rspec-core (~> 3.10)
159
+ rspec-expectations (~> 3.10)
160
+ rspec-mocks (~> 3.10)
161
+ rspec-support (~> 3.10)
162
+ rspec-support (3.10.2)
163
+ rubocop (0.80.1)
164
+ jaro_winkler (~> 1.5.1)
165
+ parallel (~> 1.10)
166
+ parser (>= 2.7.0.1)
167
+ rainbow (>= 2.2.2, < 4.0)
168
+ rexml
169
+ ruby-progressbar (~> 1.7)
170
+ unicode-display_width (>= 1.4.0, < 1.7)
171
+ ruby-progressbar (1.10.1)
120
172
  slop (3.6.0)
121
- sprockets (3.2.0)
122
- rack (~> 1.0)
123
- sprockets-rails (2.3.2)
124
- actionpack (>= 3.0)
125
- activesupport (>= 3.0)
126
- sprockets (>= 2.8, < 4.0)
127
- thor (0.19.1)
128
- thread_safe (0.3.4)
129
- tzinfo (1.2.2)
130
- thread_safe (~> 0.1)
173
+ sprockets (4.0.2)
174
+ concurrent-ruby (~> 1.0)
175
+ rack (> 1, < 3)
176
+ sprockets-rails (3.2.2)
177
+ actionpack (>= 4.0)
178
+ activesupport (>= 4.0)
179
+ sprockets (>= 3.0.0)
180
+ thor (1.1.0)
181
+ tzinfo (2.0.4)
182
+ concurrent-ruby (~> 1.0)
183
+ unicode-display_width (1.6.1)
184
+ websocket-driver (0.7.3)
185
+ websocket-extensions (>= 0.1.0)
186
+ websocket-extensions (0.1.5)
187
+ zeitwerk (2.4.2)
131
188
 
132
189
  PLATFORMS
133
190
  ruby
134
191
 
135
192
  DEPENDENCIES
136
193
  bundler
194
+ database_cleaner-active_record
137
195
  postgres_upsert!
196
+ pry-nav
138
197
  pry-rails
139
- rspec (~> 2.12)
140
- rspec-rails (~> 2.0)
198
+ rspec-rails (>= 3.9)
199
+ rubocop
200
+
201
+ BUNDLED WITH
202
+ 2.2.3
data/README.md CHANGED
@@ -113,7 +113,7 @@ And the following railsy code to create 10,000 users:
113
113
  def insert_dumb
114
114
  time = Benchmark.measure do
115
115
  (1..10000).each do |n|
116
- User.create!(:email => "number#{n}@postgres.up", :password => "#{(n-5..n).to_a.join('')}")
116
+ User.create!(:email => "number#{n}@email.com", :password => "password#{n)}")
117
117
  end
118
118
  end
119
119
  puts time
@@ -125,9 +125,9 @@ Compared to the following code using Postgres_upsert:
125
125
  def insert_smart
126
126
  time = Benchmark.measure do
127
127
  csv_string = CSV.generate do |csv|
128
- csv << %w(email password)
128
+ csv << %w(email password) # CSV header row
129
129
  (1..10000).each do |n|
130
- csv << ["number#{n}@postgres.up", "#{(n-5..n).to_a.join('')}"]
130
+ csv << ["number#{n}@email.com", "password#{n)}"]
131
131
  end
132
132
  end
133
133
  io = StringIO.new(csv_string)
@@ -158,8 +158,11 @@ Note that for the benchmark, my database is local. The performance improvement
158
158
 
159
159
  ## Note on Patches/Pull Requests
160
160
 
161
- * Fork the project
162
- * add your feature/fix to your fork(rpsec tests pleaze)
161
+ I greatly appreciate contribution to this gem.
162
+
163
+ * Fork the project and clone the repo locally
164
+ * run 'bin/setup' to setup dependencies and create test DB
165
+ * add your feature/fix to your fork(add and run rpsec tests please)
163
166
  * submit a PR
164
167
  * If you find an issue but can't fix in in a PR, please log an issue. I'll do my best.
165
168