combustion 0.5.3 → 0.5.4

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
  SHA1:
3
- metadata.gz: 6eb9dd7c152b1c4ef543f6db332e2cc852d8c574
4
- data.tar.gz: 8169e2922fd87f725ee476eb2baaea449b3ef066
3
+ metadata.gz: adee1390f356a9707415fc7b73ee772c98013820
4
+ data.tar.gz: 82d9808d3817693cac00fad905c14358b9f3b30b
5
5
  SHA512:
6
- metadata.gz: 63d7dfdd2ee1341c9311360f3d694238530e595c68ffc65ff554a733a4b1d1f3a518144bab5f27b6551ef499fb4544ae18cb92ab0e3812f1b7cfb6da3a05c79b
7
- data.tar.gz: f0ca0720b2a0654e0205c43d1e1d1ebfe83e615b0016f4c9341dd86c9976a7780bec4ee9699d7acac891a78374a10b8b4739e47ec25b5563240c2b9a6ad295d0
6
+ metadata.gz: 326878f655959ee100820d57b3fd7ba9628b02b685f025875120ae9e209ceeeabdfbd5b19e0b9dd4f95508410b784c0a15648d63beab3bf973de969bac32f402
7
+ data.tar.gz: 17984826025904c80d93ea41323a8b966917aaa7ce3c23ad2496714c730623c702c42b2ebb6ee990b9fafc47650fd9f32ec18c5856b3e25fed4a4a3910e3dbe6
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ Gemfile.lock
4
4
  pkg/*
5
5
  .rvmrc
6
6
  .ruby-version
7
+ spec/dummy/spec/internal/db/combustion_test.sqlite
data/HISTORY CHANGED
@@ -1,3 +1,10 @@
1
+ 0.5.4 - January 12th 2016
2
+ * Remove silent_stream call for Rails 5.0 compatability (Bryan Ricker).
3
+ * Fix duplicate migrations error (Semyon Pupkov).
4
+
5
+ 0.5.3 - March 1st 2015
6
+ * Use migrations from dependent gems (Korotaev Danil, Меркушин Михаил).
7
+
1
8
  0.5.2 - July 18th 2014
2
9
  * Note MIT licence in gemspec (@ktdreyer).
3
10
  * Use local create/drop methods when resetting database (Bryan Ricker).
data/README.md CHANGED
@@ -10,10 +10,10 @@ Get the gem into either your gemspec or your Gemfile, depending on how you manag
10
10
 
11
11
  ```ruby
12
12
  # gemspec
13
- gem.add_development_dependency 'combustion', '~> 0.5.3'
13
+ gem.add_development_dependency 'combustion', '~> 0.5.4'
14
14
 
15
15
  # Gemfile
16
- gem 'combustion', '~> 0.5.3', :group => :test
16
+ gem 'combustion', '~> 0.5.4', :group => :test
17
17
  ```
18
18
 
19
19
  In your `spec_helper.rb`, get Combustion to set itself up - which has to happen before you introduce `rspec/rails` and - if being used - `capybara/rails`. Here's an example within context:
@@ -184,6 +184,8 @@ I've not tried using this with Cucumber, but it should work in theory without to
184
184
 
185
185
  ## Contributing
186
186
 
187
+ Please note that this project now has a [Contributor Code of Conduct](http://contributor-covenant.org/version/1/0/0/). By participating in this project you agree to abide by its terms.
188
+
187
189
  Contributions are very much welcome - but keep in mind the following:
188
190
 
189
191
  * Keep patches in a separate branch
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'combustion'
4
- s.version = '0.5.3'
4
+ s.version = '0.5.4'
5
5
  s.authors = ['Pat Allan']
6
6
  s.email = ['pat@freelancing-gods.com']
7
7
  s.homepage = 'https://github.com/pat/combustion'
@@ -19,4 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.add_runtime_dependency 'activesupport', '>= 3.0.0'
20
20
  s.add_runtime_dependency 'railties', '>= 3.0.0'
21
21
  s.add_runtime_dependency 'thor', '>= 0.14.6'
22
+
23
+ s.add_development_dependency 'rails'
24
+ s.add_development_dependency 'sqlite3'
25
+ s.add_development_dependency 'rspec'
22
26
  end
@@ -1,11 +1,9 @@
1
1
  module Combustion
2
2
  class Database
3
3
  def self.setup
4
- silence_stream(STDOUT) do
5
- reset_database
6
- load_schema
7
- migrate
8
- end
4
+ reset_database
5
+ load_schema
6
+ migrate
9
7
  end
10
8
 
11
9
  def self.reset_database
@@ -57,14 +55,16 @@ module Combustion
57
55
 
58
56
  def self.migrate
59
57
  migrator = ActiveRecord::Migrator
58
+ engine_path = Rails.application.root.sub(::Combustion.path, '')
59
+ engine_migration_paths = Rails.application.paths['db/migrate'].to_a
60
60
 
61
- if migrator.respond_to?(:migrations_paths)
62
- paths = migrator.migrations_paths
61
+ if engine_migration_paths.include?(engine_path.join('db/migrate').to_s)
62
+ paths = []
63
63
  else
64
- paths = Array('db/migrate/')
64
+ paths = base_migration_paths
65
65
  end
66
66
 
67
- paths += Rails.application.paths['db/migrate'].to_a
67
+ paths += engine_migration_paths
68
68
  paths.uniq!
69
69
 
70
70
  # Append the migrations inside the internal app's db/migrate directory
@@ -79,6 +79,14 @@ module Combustion
79
79
 
80
80
  private
81
81
 
82
+ def self.base_migration_paths
83
+ if ActiveRecord::Migrator.respond_to?(:migrations_paths)
84
+ ActiveRecord::Migrator.migrations_paths
85
+ else
86
+ Array('db/migrate/')
87
+ end
88
+ end
89
+
82
90
  def self.create_database(config)
83
91
  begin
84
92
  if config['adapter'] =~ /sqlite/
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+ require File.expand_path("../dummy/lib/engine.rb", __FILE__)
3
+
4
+ module Combustion
5
+ describe Database do
6
+ before do
7
+ Dir.chdir(File.expand_path('../dummy', __FILE__)) do
8
+ Combustion.initialize! :active_record
9
+ end
10
+ end
11
+
12
+ it 'run migration from dummy engine' do
13
+ expect(ActiveRecord::Base.connection.table_exists?('dummy_table')).to eq true
14
+ end
15
+ end
16
+ end
17
+
@@ -0,0 +1,5 @@
1
+ class CreateDummyTestTable < ActiveRecord::Migration
2
+ def change
3
+ create_table 'dummy_table'
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module Dummy
2
+ class Engine < ::Rails::Engine
3
+ initializer :dummy, before: :load_init_rb do |app|
4
+ app.config.paths["db/migrate"].concat(config.paths["db/migrate"].expanded)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ test:
2
+ adapter: sqlite3
3
+ database: db/combustion_test.sqlite
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ #
3
+ end
@@ -0,0 +1,3 @@
1
+ ActiveRecord::Schema.define do
2
+ #
3
+ end
@@ -0,0 +1,3 @@
1
+ # coding: utf-8
2
+ require 'bundler/setup'
3
+ require 'combustion'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combustion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2016-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,6 +52,48 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.14.6
55
+ - !ruby/object:Gem::Dependency
56
+ name: rails
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'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sqlite3
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
55
97
  description: Test your Rails Engines without needing a full Rails app
56
98
  email:
57
99
  - pat@freelancing-gods.com
@@ -72,6 +114,14 @@ files:
72
114
  - lib/combustion/application.rb
73
115
  - lib/combustion/database.rb
74
116
  - lib/combustion/generator.rb
117
+ - spec/database_spec.rb
118
+ - spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb
119
+ - spec/dummy/lib/engine.rb
120
+ - spec/dummy/spec/internal/config/database.yml
121
+ - spec/dummy/spec/internal/config/routes.rb
122
+ - spec/dummy/spec/internal/db/schema.rb
123
+ - spec/dummy/spec/internal/log/.gitignore
124
+ - spec/spec_helper.rb
75
125
  - templates/config.ru
76
126
  - templates/database.yml
77
127
  - templates/routes.rb
@@ -96,8 +146,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
146
  version: '0'
97
147
  requirements: []
98
148
  rubyforge_project: combustion
99
- rubygems_version: 2.2.2
149
+ rubygems_version: 2.4.8
100
150
  signing_key:
101
151
  specification_version: 4
102
152
  summary: Elegant Rails Engine Testing
103
- test_files: []
153
+ test_files:
154
+ - spec/database_spec.rb
155
+ - spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb
156
+ - spec/dummy/lib/engine.rb
157
+ - spec/dummy/spec/internal/config/database.yml
158
+ - spec/dummy/spec/internal/config/routes.rb
159
+ - spec/dummy/spec/internal/db/schema.rb
160
+ - spec/dummy/spec/internal/log/.gitignore
161
+ - spec/spec_helper.rb