gemika 0.3.2 → 0.3.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
- SHA1:
3
- metadata.gz: 8b74ff49f303c17e7047fa450e11ad3c5b65877d
4
- data.tar.gz: 3667c4dc64eec83139c8a054c9a1fd05896e193a
2
+ SHA256:
3
+ metadata.gz: 0495f6f88a9bf0b59ed3159f166a2c1edc397deb3083d1f069cf329723267ea6
4
+ data.tar.gz: 95e504c573edc50e0fdb9ce423eee9073f1ed880b6c0dc24a04c352efaec871e
5
5
  SHA512:
6
- metadata.gz: 5113f8b4faa3a6b09e21cad5f477957c9db91232467e75fa82487e4942984399fbf078608ee03f75e8901f91b412355a5f73eada767aa2545c4612d5c9323795
7
- data.tar.gz: 458cf074cffbe66d7eacb5b77d16955387a06b7fd9654ebe6f638d68e271b4cdcf0c0c1c5acc75699ad2a1a44e008498928fff2498a0c9dc409e177cfde470db
6
+ metadata.gz: b3ab40e196aee3aa4fbc13b87828f75e2417a81ac26e2b2ef94b5b525784139e6f2c7c66ff0e22d0e2143347958338de7cb46065e3fba919e82273f0b9a80544
7
+ data.tar.gz: 588f5ec2600fb5de6d5f2cd88714491475ab8f7bef2e430724b25a05fc9e64ce74d1c9905e9ebad6191e69bfdb6d6db7aea21da88a644abec75e41c94c3ecaa2
data/.gitignore CHANGED
@@ -1,3 +1,3 @@
1
1
  .idea
2
2
  pkg
3
-
3
+ /spec/support/database.yml
data/.travis.yml CHANGED
@@ -13,6 +13,7 @@ gemfile:
13
13
  - gemfiles/Gemfile.4.2.pg
14
14
  - gemfiles/Gemfile.5.0.mysql2
15
15
  - gemfiles/Gemfile.5.0.pg
16
+ - gemfiles/Gemfile.5.0.sqlite3
16
17
 
17
18
  matrix:
18
19
  exclude:
@@ -32,16 +33,19 @@ matrix:
32
33
  rvm: 1.8.7
33
34
  - gemfile: gemfiles/Gemfile.5.0.pg
34
35
  rvm: 1.8.7
36
+ - gemfile: gemfiles/Gemfile.5.0.sqlite3
37
+ rvm: 1.8.7
35
38
  - gemfile: gemfiles/Gemfile.5.0.mysql2
36
39
  rvm: 2.1.8
37
40
  - gemfile: gemfiles/Gemfile.5.0.pg
38
41
  rvm: 2.1.8
42
+ - gemfile: gemfiles/Gemfile.5.0.sqlite3
43
+ rvm: 2.1.8
39
44
 
40
45
  install:
41
- # Old Travis CI bundler explodes when lockfile version doesn't match recently bumped version
42
- - gem install bundler --version='=1.12.5'
43
- # This is the default Travis CI install step
44
- - bundle install --jobs=3 --retry=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle}
46
+ # Replace default Travis CI bundler script with a version that doesn't
47
+ # explode when lockfile doesn't match recently bumped version
48
+ - bundle install --no-deployment --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
45
49
 
46
50
  before_script:
47
51
  - psql -c 'create database gemika_test;' -U postgres
data/README.md CHANGED
@@ -12,7 +12,7 @@ Here's what Gemika can give your test's development setup (all features are opt-
12
12
 
13
13
  - Test one codebase against multiple sets of runtime gem dependency sets (e.g. Rails 2.3, Rails 5.0).
14
14
  - Test one codebase against multiple Ruby versions (e.g. Ruby 1.8.7, Ruby 2.3.10).
15
- - Test one codebase against multiple database types (currently MySQL or PostgreSQL).
15
+ - Test one codebase against multiple database types (currently MySQL, PostgreSQL, or sqlite3).
16
16
  - Compute a matrix of all possible dependency permutations (Ruby, runtime gems, database type). Manually exclude incompatible dependency permutations (e.g. Rails 5.0 does not work with Ruby 2.1).
17
17
  - Let developers enter their local credentials for MySQL and PostgreSQL in a `database.yml` file.
18
18
  - Define default Ruby version, gem dependencies and database for developers who don't care about every possible permutation for everyday work.
@@ -30,7 +30,7 @@ Gemika currently supports the following dependency versions:
30
30
  - Ruby: 1.8.7, 2.1, 2.2, 2.3
31
31
  - RSpec: Versions 1, 2, 3
32
32
  - ActiveRecord: Versions 2.3, 3.2, 4.2, 5.0
33
- - Databases: PostgreSQL (with `pg` gem), MySQL or MariaDB (with `mysql2` gem)
33
+ - Databases: PostgreSQL (with `pg` gem), MySQL or MariaDB (with `mysql2` gem), or sqlite3 (with `sqlite3` gem)
34
34
 
35
35
  Gemika also makes some assumption about your Gem:
36
36
 
@@ -79,9 +79,10 @@ For a live example of this setup, check the [makandra/minidusen](https://github.
79
79
  Gemika expects a standard gem directory that looks roughly like this:
80
80
 
81
81
  ```shell
82
- my_gem.gemspec # Specification for your gem
83
- Rakefile # Rake tasks for your gem
84
- lib/my_gem.rb # Main file to require for your gem
82
+ my_gem.gemspec # Specification for your gem
83
+ Rakefile # Rake tasks for your gem
84
+ lib/my_gem.rb # Main file to require for your gem
85
+ spec/my_gem_spec.rb # Tests for your gem
85
86
  ```
86
87
 
87
88
  If you don't have a directory yet, you can [ask Bundler to create it for you](http://bundler.io/rubygems.html):
@@ -152,12 +153,14 @@ For each dependency set, create a `Gemfile` in the `gemfiles` directory that con
152
153
  For instance, if one dependency set is Rails 3.2 with a MySQL database, we would create `gemfiles/Gemfile.4.2.mysql2` with these contents:
153
154
 
154
155
  ```ruby
156
+ source 'https://rubygems.org'
157
+
155
158
  # Runtime dependencies
156
159
  gem 'rails', '~>3.2.22'
157
160
  gem 'mysql2', '= 0.3.17'
158
- gem 'rspec', '~> 3.4'
159
161
 
160
162
  # Development dependencies
163
+ gem 'rspec', '~> 3.4'
161
164
  gem 'rake'
162
165
  gem 'byebug'
163
166
  gem 'gemika'
@@ -169,12 +172,14 @@ gem 'my_gem', :path => '..'
169
172
  If a second dependency is Rails 5.0 with a PostgreSQL database, we would create `gemfiles/Gemfile.5.0.pg` with these contents:
170
173
 
171
174
  ```ruby
175
+ source 'https://rubygems.org'
176
+
172
177
  # Runtime dependencies
173
178
  gem 'rails', '~>5.0.0'
174
179
  gem 'pg', '~>0.18.4'
175
- gem 'rspec', '~>3.5'
176
180
 
177
181
  # Development dependencies
182
+ gem 'rspec', '~>3.5'
178
183
  gem 'rake'
179
184
  gem 'byebug'
180
185
  gem 'gemika'
@@ -190,25 +195,6 @@ gemfiles/Gemfile.4.2.mysql2
190
195
  gemfiles/Gemfile.5.0.pg
191
196
  ```
192
197
 
193
- Create lockfiles for each bundle by running:
194
-
195
- ```shell
196
- rake matrix:install
197
- ```
198
-
199
- In this example, your `gemfiles` directory should now contain a lockfile for each gemfile:
200
-
201
- ```
202
- gemfiles/Gemfile.4.2.mysql2
203
- gemfiles/Gemfile.4.2.mysql2.lock
204
- gemfiles/Gemfile.5.0.pg
205
- gemfiles/Gemfile.5.0.pg.lock
206
- ```
207
-
208
- Gemfiles and lockfiles should be committed to your repo.
209
-
210
- Make sure to re-run `rake matrix:install` after each change to your gemfiles, and commit the generated changes.
211
-
212
198
 
213
199
  ### Define combinations of gemfiles and Ruby versions
214
200
 
@@ -248,6 +234,27 @@ matrix:
248
234
  rvm: 2.1.8
249
235
  ```
250
236
 
237
+ ### Generate lockfiles
238
+
239
+ Generate lockfiles for each bundle by running:
240
+
241
+ ```shell
242
+ rake matrix:install
243
+ ```
244
+
245
+ In this example, your `gemfiles` directory should now contain a lockfile for each gemfile:
246
+
247
+ ```
248
+ gemfiles/Gemfile.4.2.mysql2
249
+ gemfiles/Gemfile.4.2.mysql2.lock
250
+ gemfiles/Gemfile.5.0.pg
251
+ gemfiles/Gemfile.5.0.pg.lock
252
+ ```
253
+
254
+ Gemfiles and lockfiles should be committed to your repo.
255
+
256
+ Make sure to re-run `rake matrix:install` after each change to your gemfiles, and commit the generated changes.
257
+
251
258
 
252
259
  ### Default Ruby and default gemfile
253
260
 
@@ -471,10 +478,9 @@ notifications:
471
478
  - notifications@test.com
472
479
 
473
480
  install:
474
- # Old Travis CI bundler explodes when lockfile version doesn't match recently bumped version
475
- - gem install bundler --version='=1.12.5'
476
- # This is the default Travis CI install step
477
- - bundle install --jobs=3 --retry=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle}
481
+ # Replace default Travis CI bundler script with a version that doesn't
482
+ # explode when lockfile doesn't match recently bumped version
483
+ - bundle install --no-deployment --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
478
484
 
479
485
  script: bundle exec rake current_rspec
480
486
  ```
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- gemika (0.3.0)
4
+ gemika (0.3.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -56,4 +56,4 @@ RUBY VERSION
56
56
  ruby 1.8.7p375
57
57
 
58
58
  BUNDLED WITH
59
- 1.12.5
59
+ 1.16.1
@@ -1,6 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
+ gemika (0.3.3)
4
5
 
5
6
  GEM
6
7
  remote: https://rubygems.org/
@@ -59,4 +60,4 @@ RUBY VERSION
59
60
  ruby 2.2.4p230
60
61
 
61
62
  BUNDLED WITH
62
- 1.12.5
63
+ 1.16.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- gemika (0.3.1)
4
+ gemika (0.3.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -60,4 +60,4 @@ RUBY VERSION
60
60
  ruby 2.3.1p112
61
61
 
62
62
  BUNDLED WITH
63
- 1.12.5
63
+ 1.16.1
@@ -1,6 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
+ gemika (0.3.3)
4
5
 
5
6
  GEM
6
7
  remote: https://rubygems.org/
@@ -56,4 +57,4 @@ RUBY VERSION
56
57
  ruby 2.2.4p230
57
58
 
58
59
  BUNDLED WITH
59
- 1.12.5
60
+ 1.16.1
@@ -1,6 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
+ gemika (0.3.3)
4
5
 
5
6
  GEM
6
7
  remote: https://rubygems.org/
@@ -56,4 +57,4 @@ RUBY VERSION
56
57
  ruby 2.2.4p230
57
58
 
58
59
  BUNDLED WITH
59
- 1.12.5
60
+ 1.16.1
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Ruby
4
+ ruby '>= 2.2'
5
+
6
+ # Runtime dependencies
7
+ gem 'activerecord', '~>5.0.0'
8
+ gem 'rspec', '~>3.5'
9
+ gem 'sqlite3'
10
+
11
+ # Development dependencies
12
+ gem 'rake'
13
+ gem 'database_cleaner'
14
+
15
+ # Gem under test
16
+ gem 'gemika', :path => '..'
@@ -0,0 +1,61 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ gemika (0.3.3)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ activemodel (5.0.7)
10
+ activesupport (= 5.0.7)
11
+ activerecord (5.0.7)
12
+ activemodel (= 5.0.7)
13
+ activesupport (= 5.0.7)
14
+ arel (~> 7.0)
15
+ activesupport (5.0.7)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 0.7, < 2)
18
+ minitest (~> 5.1)
19
+ tzinfo (~> 1.1)
20
+ arel (7.1.4)
21
+ concurrent-ruby (1.0.5)
22
+ database_cleaner (1.7.0)
23
+ diff-lcs (1.3)
24
+ i18n (1.0.1)
25
+ concurrent-ruby (~> 1.0)
26
+ minitest (5.11.3)
27
+ rake (12.3.1)
28
+ rspec (3.7.0)
29
+ rspec-core (~> 3.7.0)
30
+ rspec-expectations (~> 3.7.0)
31
+ rspec-mocks (~> 3.7.0)
32
+ rspec-core (3.7.1)
33
+ rspec-support (~> 3.7.0)
34
+ rspec-expectations (3.7.0)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.7.0)
37
+ rspec-mocks (3.7.0)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.7.0)
40
+ rspec-support (3.7.1)
41
+ sqlite3 (1.3.13)
42
+ thread_safe (0.3.6)
43
+ tzinfo (1.2.5)
44
+ thread_safe (~> 0.1)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ activerecord (~> 5.0.0)
51
+ database_cleaner
52
+ gemika!
53
+ rake
54
+ rspec (~> 3.5)
55
+ sqlite3
56
+
57
+ RUBY VERSION
58
+ ruby 2.2.4p230
59
+
60
+ BUNDLED WITH
61
+ 1.16.1
@@ -95,8 +95,12 @@ module Gemika
95
95
  default_config['username'] = 'travis' if Env.travis?
96
96
  default_config['encoding'] = 'utf8'
97
97
  user_config = (@yaml_config['mysql'] || @yaml_config['mysql2']) || {}
98
+ elsif Env.gem?('sqlite3')
99
+ default_config['adapter'] = 'sqlite3'
100
+ default_config['database'] = ':memory:'
101
+ user_config = (@yaml_config['sqlite'] || @yaml_config['sqlite3']) || {}
98
102
  else
99
- raise UnknownAdapter, "Unknown database type. Either 'pg' or 'mysql2' gem should be in your current bundle."
103
+ raise UnknownAdapter, "Unknown database type. Either 'pg', 'mysql2', or 'sqlite3' gem should be in your current bundle."
100
104
  end
101
105
  default_config.merge(user_config)
102
106
  end
@@ -1,3 +1,3 @@
1
1
  module Gemika
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemika
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-28 00:00:00.000000000 Z
11
+ date: 2018-08-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Helpers for testing Ruby gems
14
14
  email: henning.koch@makandra.de
@@ -37,6 +37,8 @@ files:
37
37
  - gemfiles/Gemfile.5.0.mysql2.lock
38
38
  - gemfiles/Gemfile.5.0.pg
39
39
  - gemfiles/Gemfile.5.0.pg.lock
40
+ - gemfiles/Gemfile.5.0.sqlite3
41
+ - gemfiles/Gemfile.5.0.sqlite3.lock
40
42
  - gemika.gemspec
41
43
  - lib/gemika.rb
42
44
  - lib/gemika/database.rb
@@ -63,7 +65,6 @@ files:
63
65
  - spec/support/database.rb
64
66
  - spec/support/database.sample.yml
65
67
  - spec/support/database.travis.yml
66
- - spec/support/database.yml
67
68
  - spec/support/models.rb
68
69
  homepage: https://github.com/makandra/gemika
69
70
  licenses:
@@ -85,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
86
  version: '0'
86
87
  requirements: []
87
88
  rubyforge_project:
88
- rubygems_version: 2.4.5.1
89
+ rubygems_version: 2.7.6
89
90
  signing_key:
90
91
  specification_version: 4
91
92
  summary: Helpers for testing Ruby gems
@@ -1,10 +0,0 @@
1
- mysql:
2
- database: gemika_test
3
- host: localhost
4
- username: root
5
- password: junior
6
-
7
- postgresql:
8
- database: gemika_test
9
- user:
10
- password: