seeder 1.1.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +61 -0
- data/.gitignore +1 -0
- data/Appraisals +19 -0
- data/Gemfile +1 -9
- data/gemfiles/5.2.gemfile +9 -0
- data/gemfiles/6.0.gemfile +9 -0
- data/gemfiles/6.1.gemfile +9 -0
- data/gemfiles/7.0.gemfile +9 -0
- data/lib/seeder/version.rb +1 -1
- data/seeder.gemspec +2 -2
- data/spec/seeder_spec.rb +1 -3
- data/spec/spec_helper.rb +32 -0
- metadata +24 -14
- data/.travis.yml +0 -42
- data/spec/support/setup.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 336b81eaac4d8959171c8e2c5ebf1fda4f7980b73fa0e89bb0ccf8c7cdb73fbe
|
4
|
+
data.tar.gz: 1e827ab5913fcaa5c287fc13e32e218a0ed8c03ffeac80007679209f61c244a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c2c960bafe9c4beee8aede30bebf163cf856865451c1885b2747b3b9e9a6e44de6e49641efe3ab3ffdcf368f5c674358b749b48ca17d5b43bf3fdc5f307721e
|
7
|
+
data.tar.gz: a53e13705521a6633e137ddd2ca58065f72636c8b55ad117a392c10cc1b0aa7af45149962906921707035e9d08be41e8ae6384fdd7539e84de232a1d5c4d1783
|
@@ -0,0 +1,61 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [master]
|
6
|
+
pull_request:
|
7
|
+
branches: [master]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
services:
|
13
|
+
mysql:
|
14
|
+
image: mysql:5.7
|
15
|
+
env:
|
16
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
17
|
+
MYSQL_DATABASE: seeder_test
|
18
|
+
ports:
|
19
|
+
- 3306:3306
|
20
|
+
options: >-
|
21
|
+
--health-cmd="mysqladmin ping"
|
22
|
+
--health-interval=10s
|
23
|
+
--health-timeout=5s
|
24
|
+
--health-retries=3
|
25
|
+
|
26
|
+
strategy:
|
27
|
+
fail-fast: false
|
28
|
+
matrix:
|
29
|
+
gemfile: ['5.2', '6.0', '6.1', '7.0']
|
30
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
31
|
+
exclude:
|
32
|
+
- gemfile: '5.2'
|
33
|
+
ruby-version: '2.7'
|
34
|
+
- gemfile: '5.2'
|
35
|
+
ruby-version: '3.0'
|
36
|
+
- gemfile: '7.0'
|
37
|
+
ruby-version: '2.6'
|
38
|
+
|
39
|
+
env:
|
40
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
|
41
|
+
|
42
|
+
steps:
|
43
|
+
- name: Checkout Repository
|
44
|
+
uses: actions/checkout@v2
|
45
|
+
|
46
|
+
- name: Setup test database
|
47
|
+
run: mysql --host 127.0.0.1 --port 3306 --user root -e 'CREATE DATABASE IF NOT EXISTS seeder_test;'
|
48
|
+
|
49
|
+
- name: Set up Ruby
|
50
|
+
uses: ruby/setup-ruby@v1
|
51
|
+
with:
|
52
|
+
ruby-version: ${{ matrix.ruby-version }}
|
53
|
+
bundler-cache: true
|
54
|
+
|
55
|
+
- name: Run tests
|
56
|
+
env:
|
57
|
+
DB_PORT: 3306
|
58
|
+
DB_USER: root
|
59
|
+
DB_PASSWORD: ""
|
60
|
+
DB_NAME: seeder_test
|
61
|
+
run: bundle exec rspec spec
|
data/.gitignore
CHANGED
data/Appraisals
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
appraise '5.2' do
|
2
|
+
gem 'activerecord', '~> 5.2.0'
|
3
|
+
gem 'mysql2', '~> 0.4.0'
|
4
|
+
end
|
5
|
+
|
6
|
+
appraise '6.0' do
|
7
|
+
gem 'activerecord', '~> 6.0.3.3'
|
8
|
+
gem 'mysql2', '~> 0.4.0'
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise '6.1' do
|
12
|
+
gem 'activerecord', '~> 6.1.0'
|
13
|
+
gem 'mysql2', '~> 0.5.3'
|
14
|
+
end
|
15
|
+
|
16
|
+
appraise '7.0' do
|
17
|
+
gem 'activerecord', '~> 7.0.0'
|
18
|
+
gem 'mysql2', '~> 0.5.3'
|
19
|
+
end
|
data/Gemfile
CHANGED
@@ -1,12 +1,4 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
gemspec
|
3
3
|
|
4
|
-
|
5
|
-
# versions of Rails. For example:
|
6
|
-
#
|
7
|
-
# AR=3.2.13 rm Gemfile.lock && bundle install && bundle exec rspec
|
8
|
-
# AR=4.0.0 rm Gemfile.lock && bundle install && bundle exec rspec
|
9
|
-
#
|
10
|
-
if ENV['AR']
|
11
|
-
gem 'activerecord', ENV['AR']
|
12
|
-
end
|
4
|
+
gem 'appraisal'
|
data/lib/seeder/version.rb
CHANGED
data/seeder.gemspec
CHANGED
@@ -15,9 +15,9 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.extra_rdoc_files = ["README.md", "LICENSE.txt"]
|
16
16
|
s.license = 'MIT'
|
17
17
|
|
18
|
-
s.add_dependency('activerecord', '>=
|
18
|
+
s.add_dependency('activerecord', '>= 5.2', '< 7.1')
|
19
19
|
|
20
|
-
s.add_development_dependency('mysql2', '
|
20
|
+
s.add_development_dependency('mysql2', '>= 0.4.4', '< 0.6.0')
|
21
21
|
s.add_development_dependency('rspec', '~> 3.0')
|
22
22
|
s.add_development_dependency('rake', '>= 10.4')
|
23
23
|
end
|
data/spec/seeder_spec.rb
CHANGED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'seeder'
|
3
|
+
|
4
|
+
ActiveRecord::Base.establish_connection(
|
5
|
+
adapter: 'mysql2',
|
6
|
+
database: ENV.fetch('DB_NAME', 'polymorpheus_test'),
|
7
|
+
host: ENV.fetch('DB_HOST', '127.0.0.1'),
|
8
|
+
password: ENV.fetch('DB_PASSWORD', ''),
|
9
|
+
port: ENV.fetch('DB_PORT', '3306'),
|
10
|
+
username: ENV.fetch('DB_USERNAME', 'root')
|
11
|
+
)
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
config.before(:suite) do
|
15
|
+
ActiveRecord::Schema.define do
|
16
|
+
create_table :grades do |t|
|
17
|
+
t.integer :student_id
|
18
|
+
t.integer :course_id
|
19
|
+
t.integer :grade
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
config.after(:suite) do
|
25
|
+
ActiveRecord::Base.connection.tables.each do |table|
|
26
|
+
ActiveRecord::Base.connection.drop_table table
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class Grade < ActiveRecord::Base
|
32
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seeder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barun Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,34 +16,40 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '5.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: mysql2
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.
|
39
|
+
version: 0.4.4
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.6.0
|
40
43
|
type: :development
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
43
46
|
requirements:
|
44
|
-
- - "
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.4.4
|
50
|
+
- - "<"
|
45
51
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
52
|
+
version: 0.6.0
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: rspec
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,19 +86,24 @@ extra_rdoc_files:
|
|
80
86
|
- README.md
|
81
87
|
- LICENSE.txt
|
82
88
|
files:
|
89
|
+
- ".github/workflows/ruby.yml"
|
83
90
|
- ".gitignore"
|
84
|
-
-
|
91
|
+
- Appraisals
|
85
92
|
- CHANGELOG.txt
|
86
93
|
- Gemfile
|
87
94
|
- LICENSE.txt
|
88
95
|
- README.md
|
89
96
|
- Rakefile
|
97
|
+
- gemfiles/5.2.gemfile
|
98
|
+
- gemfiles/6.0.gemfile
|
99
|
+
- gemfiles/6.1.gemfile
|
100
|
+
- gemfiles/7.0.gemfile
|
90
101
|
- lib/seeder.rb
|
91
102
|
- lib/seeder/version.rb
|
92
103
|
- seeder.gemspec
|
93
104
|
- spec/seeder_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
94
106
|
- spec/support/active_record/connection_adapters/abstract_mysql_adapter.rb
|
95
|
-
- spec/support/setup.rb
|
96
107
|
homepage: http://github.com/wegowise/seeder
|
97
108
|
licenses:
|
98
109
|
- MIT
|
@@ -112,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
123
|
- !ruby/object:Gem::Version
|
113
124
|
version: 1.3.6
|
114
125
|
requirements: []
|
115
|
-
|
116
|
-
rubygems_version: 2.7.6
|
126
|
+
rubygems_version: 3.1.6
|
117
127
|
signing_key:
|
118
128
|
specification_version: 4
|
119
129
|
summary: Manage seed data for your Rails app
|
data/.travis.yml
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
cache: bundler
|
3
|
-
language: ruby
|
4
|
-
rvm:
|
5
|
-
- 1.9.3
|
6
|
-
- 2.0.0
|
7
|
-
- 2.1.10
|
8
|
-
- 2.2.7
|
9
|
-
- 2.3.4
|
10
|
-
- 2.4.1
|
11
|
-
env:
|
12
|
-
global:
|
13
|
-
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
14
|
-
matrix:
|
15
|
-
- AR=3.2.22.5
|
16
|
-
- AR=4.0.13
|
17
|
-
- AR=4.1.16
|
18
|
-
- AR=4.2.8
|
19
|
-
- AR=5.0.3
|
20
|
-
- AR=5.1.1
|
21
|
-
matrix:
|
22
|
-
exclude:
|
23
|
-
- rvm: 1.9.3
|
24
|
-
env: AR=5.0.3
|
25
|
-
- rvm: 1.9.3
|
26
|
-
env: AR=5.1.1
|
27
|
-
- rvm: 2.0.0
|
28
|
-
env: AR=5.0.3
|
29
|
-
- rvm: 2.0.0
|
30
|
-
env: AR=5.1.1
|
31
|
-
- rvm: 2.1.10
|
32
|
-
env: AR=5.0.3
|
33
|
-
- rvm: 2.1.10
|
34
|
-
env: AR=5.1.1
|
35
|
-
- rvm: 2.4.1
|
36
|
-
env: AR=3.2.22.5
|
37
|
-
- rvm: 2.4.1
|
38
|
-
env: AR=4.0.13
|
39
|
-
- rvm: 2.4.1
|
40
|
-
env: AR=4.1.16
|
41
|
-
before_script:
|
42
|
-
- mysql -e 'create database seeder_test;'
|
data/spec/support/setup.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'support/active_record/connection_adapters/abstract_mysql_adapter'
|
2
|
-
|
3
|
-
ActiveRecord::Base.establish_connection({
|
4
|
-
adapter: 'mysql2',
|
5
|
-
username: 'travis',
|
6
|
-
database: 'seeder_test'
|
7
|
-
})
|
8
|
-
|
9
|
-
tables_method = ActiveRecord::VERSION::MAJOR >= 5 ? :data_sources : :tables
|
10
|
-
|
11
|
-
ActiveRecord::Base.connection.public_send(tables_method).each do |table|
|
12
|
-
ActiveRecord::Base.connection.drop_table table
|
13
|
-
end
|
14
|
-
|
15
|
-
ActiveRecord::Schema.define do
|
16
|
-
create_table :grades do |t|
|
17
|
-
t.integer :student_id
|
18
|
-
t.integer :course_id
|
19
|
-
t.integer :grade
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
class Grade < ActiveRecord::Base
|
24
|
-
end
|