activerecord-pg_enum 0.2.0 → 0.2.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd614eca633279bd5a19660137152b8461356b8431fea368a3c3a947c64715f7
4
- data.tar.gz: ce1bba6131f601029c42402e2561869530f4a2ff2bc0d38a56b84c3ba9226f03
3
+ metadata.gz: b054a50be2905bc27d33ea19f01be2dca1c435ee12097cf887442b181fc7d2a4
4
+ data.tar.gz: a06db65579894edded448f85e16bd436de2d51a09d8a5f647389cb193d28ecbe
5
5
  SHA512:
6
- metadata.gz: '095f6470ee10ea1c3499b8452cf5e0d9e8d8e5cbc937e91969014574c6558eec1bc30a85306017a98a5e6ae2ddc631381ca91af5d4eb8a4c8991d50dc4575bf2'
7
- data.tar.gz: ad1ecac7919ea5e73a0653bc8700403b002a5ca518ef305d713c2a22f1ab8bd13ae17f54652bd0c07cdc72cf425ae5bcdaeb9668443627f4891887557dea02f5
6
+ metadata.gz: 2dbc6fee1995ef05d75acb20c0cf03639bca2b753788ba91df098268d914f286c3b04b34639bae6984bbe0ebb9948d9196b84ae07defcc953a485b70a08370b6
7
+ data.tar.gz: f04459faaae97d771aa60e44cb0ca2d13e983f3bff36f7eef3f71401997746d54516eb216e25666e1618755b46aef9248636a4b263e6a6af09b505ebb75c767e
data/.travis.yml CHANGED
@@ -1,13 +1,23 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.2
5
- - 2.5
4
+ - 2.1
5
+ - 2.2
6
+ - 2.5
7
+ gemfile:
8
+ - gemfiles/5.2.gemfile
9
+ - gemfiles/5.1.gemfile
10
+ - gemfiles/edge.gemfile
11
+ matrix:
12
+ exclude:
13
+ - rvm: 2.1
14
+ gemfile: gemfiles/5.2.gemfile
15
+ allow_failures:
16
+ - gemfile: gemfiles/edge.gemfile
6
17
  services:
7
- - postgresql
18
+ - postgresql
8
19
  before_install: gem install bundler -v 1.15.4
9
- before_script:
10
- - "rake spec:setup"
20
+ script: "bundle exec rake spec"
11
21
  env:
12
22
  global:
13
- - TEST_USER=postgres
23
+ - TEST_USER=postgres
data/Appraisals ADDED
@@ -0,0 +1,11 @@
1
+ appraise "5.2" do
2
+ gem "activerecord", "~> 5.2"
3
+ end
4
+
5
+ appraise "5.1" do
6
+ gem "activerecord", ">= 5.1.0", "< 5.2.0"
7
+ end
8
+
9
+ appraise "edge" do
10
+ gem "rails", git: "https://github.com/rails/rails.git", branch: "master"
11
+ end
data/Gemfile CHANGED
@@ -2,7 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
- gem "activerecord", "~> 5.1"
6
-
7
5
  # Specify your gem's dependencies in activerecord-pg_enum.gemspec
8
6
  gemspec
data/Rakefile CHANGED
@@ -1,9 +1,12 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require "appraisal"
3
4
 
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
5
+ if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
6
+ task :default => :appraisal
7
+ else
8
+ task :default => :spec
9
+ end
7
10
 
8
11
  task :connection do
9
12
  require "active_record"
@@ -16,6 +19,8 @@ task :connection do
16
19
  end
17
20
 
18
21
  namespace :spec do
22
+ RSpec::Core::RakeTask.new(:run)
23
+
19
24
  desc "Setup the Database for testing"
20
25
  task setup: [:connection] do
21
26
  ActiveRecord::Base.connection_pool.with_connection do |conn|
@@ -30,3 +35,5 @@ namespace :spec do
30
35
  end
31
36
  end
32
37
  end
38
+
39
+ task spec: %w[spec:setup spec:run spec:teardown]
@@ -25,9 +25,10 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
 
27
27
  spec.add_dependency "pg"
28
- spec.add_dependency "activerecord", ">= 5.2.0"
28
+ spec.add_dependency "activerecord", ">= 5.1.0"
29
29
  spec.add_dependency "activesupport"
30
30
 
31
+ spec.add_development_dependency "appraisal"
31
32
  spec.add_development_dependency "bundler", "~> 1.15"
32
33
  spec.add_development_dependency "rake", "~> 10.0"
33
34
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", ">= 5.1.0", "< 5.2.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,71 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ activerecord-pg_enum (0.2.0)
5
+ activerecord (>= 5.1.0)
6
+ activesupport
7
+ pg
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activemodel (5.1.6)
13
+ activesupport (= 5.1.6)
14
+ activerecord (5.1.6)
15
+ activemodel (= 5.1.6)
16
+ activesupport (= 5.1.6)
17
+ arel (~> 8.0)
18
+ activesupport (5.1.6)
19
+ concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ i18n (>= 0.7, < 2)
21
+ minitest (~> 5.1)
22
+ tzinfo (~> 1.1)
23
+ appraisal (2.2.0)
24
+ bundler
25
+ rake
26
+ thor (>= 0.14.0)
27
+ arel (8.0.0)
28
+ coderay (1.1.2)
29
+ concurrent-ruby (1.0.5)
30
+ diff-lcs (1.3)
31
+ i18n (1.1.0)
32
+ concurrent-ruby (~> 1.0)
33
+ method_source (0.9.0)
34
+ minitest (5.11.3)
35
+ pg (1.0.0)
36
+ pry (0.11.3)
37
+ coderay (~> 1.1.0)
38
+ method_source (~> 0.9.0)
39
+ rake (10.5.0)
40
+ rspec (3.8.0)
41
+ rspec-core (~> 3.8.0)
42
+ rspec-expectations (~> 3.8.0)
43
+ rspec-mocks (~> 3.8.0)
44
+ rspec-core (3.8.0)
45
+ rspec-support (~> 3.8.0)
46
+ rspec-expectations (3.8.1)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.8.0)
49
+ rspec-mocks (3.8.0)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.8.0)
52
+ rspec-support (3.8.0)
53
+ thor (0.20.0)
54
+ thread_safe (0.3.6)
55
+ tzinfo (1.2.5)
56
+ thread_safe (~> 0.1)
57
+
58
+ PLATFORMS
59
+ ruby
60
+
61
+ DEPENDENCIES
62
+ activerecord (>= 5.1.0, < 5.2.0)
63
+ activerecord-pg_enum!
64
+ appraisal
65
+ bundler (~> 1.15)
66
+ pry
67
+ rake (~> 10.0)
68
+ rspec (~> 3.0)
69
+
70
+ BUNDLED WITH
71
+ 1.16.2
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 5.2"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,71 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ activerecord-pg_enum (0.2.0)
5
+ activerecord (>= 5.1.0)
6
+ activesupport
7
+ pg
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activemodel (5.2.1)
13
+ activesupport (= 5.2.1)
14
+ activerecord (5.2.1)
15
+ activemodel (= 5.2.1)
16
+ activesupport (= 5.2.1)
17
+ arel (>= 9.0)
18
+ activesupport (5.2.1)
19
+ concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ i18n (>= 0.7, < 2)
21
+ minitest (~> 5.1)
22
+ tzinfo (~> 1.1)
23
+ appraisal (2.2.0)
24
+ bundler
25
+ rake
26
+ thor (>= 0.14.0)
27
+ arel (9.0.0)
28
+ coderay (1.1.2)
29
+ concurrent-ruby (1.0.5)
30
+ diff-lcs (1.3)
31
+ i18n (1.1.0)
32
+ concurrent-ruby (~> 1.0)
33
+ method_source (0.9.0)
34
+ minitest (5.11.3)
35
+ pg (1.0.0)
36
+ pry (0.11.3)
37
+ coderay (~> 1.1.0)
38
+ method_source (~> 0.9.0)
39
+ rake (10.5.0)
40
+ rspec (3.8.0)
41
+ rspec-core (~> 3.8.0)
42
+ rspec-expectations (~> 3.8.0)
43
+ rspec-mocks (~> 3.8.0)
44
+ rspec-core (3.8.0)
45
+ rspec-support (~> 3.8.0)
46
+ rspec-expectations (3.8.1)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.8.0)
49
+ rspec-mocks (3.8.0)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.8.0)
52
+ rspec-support (3.8.0)
53
+ thor (0.20.0)
54
+ thread_safe (0.3.6)
55
+ tzinfo (1.2.5)
56
+ thread_safe (~> 0.1)
57
+
58
+ PLATFORMS
59
+ ruby
60
+
61
+ DEPENDENCIES
62
+ activerecord (~> 5.2)
63
+ activerecord-pg_enum!
64
+ appraisal
65
+ bundler (~> 1.15)
66
+ pry
67
+ rake (~> 10.0)
68
+ rspec (~> 3.0)
69
+
70
+ BUNDLED WITH
71
+ 1.16.2
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", git: "https://github.com/rails/rails.git", branch: "master"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,160 @@
1
+ GIT
2
+ remote: https://github.com/rails/rails.git
3
+ revision: dc796a0d407dfaf84abd464fc1aa2966cddb51e0
4
+ branch: master
5
+ specs:
6
+ actioncable (6.0.0.alpha)
7
+ actionpack (= 6.0.0.alpha)
8
+ nio4r (~> 2.0)
9
+ websocket-driver (>= 0.6.1)
10
+ actionmailer (6.0.0.alpha)
11
+ actionpack (= 6.0.0.alpha)
12
+ actionview (= 6.0.0.alpha)
13
+ activejob (= 6.0.0.alpha)
14
+ mail (~> 2.5, >= 2.5.4)
15
+ rails-dom-testing (~> 2.0)
16
+ actionpack (6.0.0.alpha)
17
+ actionview (= 6.0.0.alpha)
18
+ activesupport (= 6.0.0.alpha)
19
+ rack (~> 2.0)
20
+ rack-test (>= 0.6.3)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
+ actionview (6.0.0.alpha)
24
+ activesupport (= 6.0.0.alpha)
25
+ builder (~> 3.1)
26
+ erubi (~> 1.4)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
29
+ activejob (6.0.0.alpha)
30
+ activesupport (= 6.0.0.alpha)
31
+ globalid (>= 0.3.6)
32
+ activemodel (6.0.0.alpha)
33
+ activesupport (= 6.0.0.alpha)
34
+ activerecord (6.0.0.alpha)
35
+ activemodel (= 6.0.0.alpha)
36
+ activesupport (= 6.0.0.alpha)
37
+ activestorage (6.0.0.alpha)
38
+ actionpack (= 6.0.0.alpha)
39
+ activerecord (= 6.0.0.alpha)
40
+ marcel (~> 0.3.1)
41
+ activesupport (6.0.0.alpha)
42
+ concurrent-ruby (~> 1.0, >= 1.0.2)
43
+ i18n (>= 0.7, < 2)
44
+ minitest (~> 5.1)
45
+ tzinfo (~> 1.1)
46
+ rails (6.0.0.alpha)
47
+ actioncable (= 6.0.0.alpha)
48
+ actionmailer (= 6.0.0.alpha)
49
+ actionpack (= 6.0.0.alpha)
50
+ actionview (= 6.0.0.alpha)
51
+ activejob (= 6.0.0.alpha)
52
+ activemodel (= 6.0.0.alpha)
53
+ activerecord (= 6.0.0.alpha)
54
+ activestorage (= 6.0.0.alpha)
55
+ activesupport (= 6.0.0.alpha)
56
+ bundler (>= 1.3.0)
57
+ railties (= 6.0.0.alpha)
58
+ sprockets-rails (>= 2.0.0)
59
+ railties (6.0.0.alpha)
60
+ actionpack (= 6.0.0.alpha)
61
+ activesupport (= 6.0.0.alpha)
62
+ method_source
63
+ rake (>= 0.8.7)
64
+ thor (>= 0.19.0, < 2.0)
65
+
66
+ PATH
67
+ remote: ..
68
+ specs:
69
+ activerecord-pg_enum (0.2.0)
70
+ activerecord (>= 5.1.0)
71
+ activesupport
72
+ pg
73
+
74
+ GEM
75
+ remote: https://rubygems.org/
76
+ specs:
77
+ appraisal (2.2.0)
78
+ bundler
79
+ rake
80
+ thor (>= 0.14.0)
81
+ builder (3.2.3)
82
+ coderay (1.1.2)
83
+ concurrent-ruby (1.0.5)
84
+ crass (1.0.4)
85
+ diff-lcs (1.3)
86
+ erubi (1.7.1)
87
+ globalid (0.4.1)
88
+ activesupport (>= 4.2.0)
89
+ i18n (1.1.0)
90
+ concurrent-ruby (~> 1.0)
91
+ loofah (2.2.2)
92
+ crass (~> 1.0.2)
93
+ nokogiri (>= 1.5.9)
94
+ mail (2.7.0)
95
+ mini_mime (>= 0.1.1)
96
+ marcel (0.3.2)
97
+ mimemagic (~> 0.3.2)
98
+ method_source (0.9.0)
99
+ mimemagic (0.3.2)
100
+ mini_mime (1.0.1)
101
+ mini_portile2 (2.3.0)
102
+ minitest (5.11.3)
103
+ nio4r (2.3.1)
104
+ nokogiri (1.8.4)
105
+ mini_portile2 (~> 2.3.0)
106
+ pg (1.0.0)
107
+ pry (0.11.3)
108
+ coderay (~> 1.1.0)
109
+ method_source (~> 0.9.0)
110
+ rack (2.0.5)
111
+ rack-test (1.1.0)
112
+ rack (>= 1.0, < 3)
113
+ rails-dom-testing (2.0.3)
114
+ activesupport (>= 4.2.0)
115
+ nokogiri (>= 1.6)
116
+ rails-html-sanitizer (1.0.4)
117
+ loofah (~> 2.2, >= 2.2.2)
118
+ rake (10.5.0)
119
+ rspec (3.8.0)
120
+ rspec-core (~> 3.8.0)
121
+ rspec-expectations (~> 3.8.0)
122
+ rspec-mocks (~> 3.8.0)
123
+ rspec-core (3.8.0)
124
+ rspec-support (~> 3.8.0)
125
+ rspec-expectations (3.8.1)
126
+ diff-lcs (>= 1.2.0, < 2.0)
127
+ rspec-support (~> 3.8.0)
128
+ rspec-mocks (3.8.0)
129
+ diff-lcs (>= 1.2.0, < 2.0)
130
+ rspec-support (~> 3.8.0)
131
+ rspec-support (3.8.0)
132
+ sprockets (3.7.2)
133
+ concurrent-ruby (~> 1.0)
134
+ rack (> 1, < 3)
135
+ sprockets-rails (3.2.1)
136
+ actionpack (>= 4.0)
137
+ activesupport (>= 4.0)
138
+ sprockets (>= 3.0.0)
139
+ thor (0.20.0)
140
+ thread_safe (0.3.6)
141
+ tzinfo (1.2.5)
142
+ thread_safe (~> 0.1)
143
+ websocket-driver (0.7.0)
144
+ websocket-extensions (>= 0.1.0)
145
+ websocket-extensions (0.1.3)
146
+
147
+ PLATFORMS
148
+ ruby
149
+
150
+ DEPENDENCIES
151
+ activerecord-pg_enum!
152
+ appraisal
153
+ bundler (~> 1.15)
154
+ pry
155
+ rails!
156
+ rake (~> 10.0)
157
+ rspec (~> 3.0)
158
+
159
+ BUNDLED WITH
160
+ 1.16.2
@@ -11,9 +11,13 @@ ActiveSupport.on_load(:active_record) do
11
11
  require "active_record/pg_enum/schema_statements"
12
12
  require "active_record/pg_enum/helper"
13
13
 
14
+ ar_version = Gem.loaded_specs["activerecord"].version
15
+
14
16
  ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES.merge!(enum: { name: "enum" })
15
17
 
16
- ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaDumper.prepend ActiveRecord::PGEnum::SchemaDumper
18
+ if ar_version >= Gem::Version.new("5.2.0")
19
+ ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaDumper.prepend ActiveRecord::PGEnum::SchemaDumper
20
+ end
17
21
 
18
22
  ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.include ActiveRecord::PGEnum::PostgreSQLAdapter
19
23
  ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.include ActiveRecord::PGEnum::SchemaStatements
@@ -14,7 +14,7 @@ module ActiveRecord
14
14
  stream.puts " # These are custom enum types that must be created before they can be used in the schema definition"
15
15
 
16
16
  enum_types.each do |name, definition|
17
- stream.puts %Q{ create_enum "#{name}", %w[#{definition.join(" ")}]"}
17
+ stream.puts %Q{ create_enum "#{name}", %w[#{definition.join(" ")}]}
18
18
  end
19
19
 
20
20
  stream.puts
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module PGEnum
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-pg_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Lassek
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-19 00:00:00.000000000 Z
11
+ date: 2019-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.2.0
33
+ version: 5.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 5.2.0
40
+ version: 5.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: appraisal
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -119,6 +133,7 @@ files:
119
133
  - ".rspec"
120
134
  - ".rubocop.yml"
121
135
  - ".travis.yml"
136
+ - Appraisals
122
137
  - CHANGELOG.md
123
138
  - Gemfile
124
139
  - LICENSE
@@ -127,6 +142,13 @@ files:
127
142
  - activerecord-pg_enum.gemspec
128
143
  - bin/console
129
144
  - bin/setup
145
+ - gemfiles/.bundle/config
146
+ - gemfiles/5.1.gemfile
147
+ - gemfiles/5.1.gemfile.lock
148
+ - gemfiles/5.2.gemfile
149
+ - gemfiles/5.2.gemfile.lock
150
+ - gemfiles/edge.gemfile
151
+ - gemfiles/edge.gemfile.lock
130
152
  - lib/active_record/pg_enum.rb
131
153
  - lib/active_record/pg_enum/command_recorder.rb
132
154
  - lib/active_record/pg_enum/helper.rb