secondbase 1.0.0 → 1.0.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
  SHA1:
3
- metadata.gz: c8690f339e1891e3267b5ffee18a8f13033d42a8
4
- data.tar.gz: 6055c37a690ddb03905c4eb59ebeac874f1cf0d1
3
+ metadata.gz: ff09fb11d05a96c2248f8b9852ba2efe9318bf0b
4
+ data.tar.gz: dd2a93a548ab042c322cd56f7446ba81bdcf0b3f
5
5
  SHA512:
6
- metadata.gz: 4c3bc5947e3dd04c8ac368a274ca88a35c8a27940fb19f33ae7567c3c521cd040d8f6c4e94064879e867564d0cf3e350f36f00d1bbce6207108d631e745c0549
7
- data.tar.gz: b9623cbadc8d55f518cd3e57d783b748c92b3bfac11b97c9fc7cf323df9faf824218aced9aac922d751db218557781a31a4adb70156ef7b9baa06540f5c41a56
6
+ metadata.gz: 2196e1d015f1838741fee167a014a9ed58943a4fef9d90f0c61280bc9ede6fd284d4685a5920165977a6c9fb57f48e2b4a3e55f356549a06a5385ca70a3f2545
7
+ data.tar.gz: e6d1271ff217c8f8f01e4ef1b804b08b929b6f9be894d2881bafbed14a33631dbcb44f8cad2729e57acaf263fa9a3666ea604b568dc8f1d4f3c25a73aa0f9b97
data/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
 
4
4
  Please follow the format set down in http://keepachangelog.com
5
5
 
6
+ ## v1.0.1
7
+
8
+ #### Fixed
9
+
10
+ * Fix base Rails migration generator. Fixes #25.
11
+
6
12
 
7
13
  ## v1.0
8
14
 
data/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
 
2
2
  ![SecondBase Logo](https://cloud.githubusercontent.com/assets/2381/12219457/5a5aab4e-b712-11e5-92e1-de6487aa0809.png)
3
3
  <hr>
4
- Seamless second database integration for Rails. SecondBase provides support for Rails to manage dual databases by focusing on ActiveRecord tasks that create, migrate, and test your databases.
4
+ Seamless second database integration for Rails. SecondBase provides support for Rails to manage dual databases by extending ActiveRecord tasks that create, migrate, and test your databases.
5
+
6
+ * [Using SecondBase To Provide Some Level Of Sanity](http://technology.customink.com/blog/2016/01/10/two-headed-cat-using-secondbase-to-provide-some-level-of-sanity-in-a-two-database-rails-application/)
7
+ * [Rails Multi-Database Best Practices Roundup](http://technology.customink.com/blog/2015/06/22/rails-multi-database-best-practices-roundup/)
5
8
 
6
9
  [![Gem Version](https://badge.fury.io/rb/secondbase.png)](http://badge.fury.io/rb/secondbase)
7
10
  [![Build Status](https://secure.travis-ci.org/customink/secondbase.png)](http://travis-ci.org/customink/secondbase)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -1,5 +1,4 @@
1
1
  require 'rails/generators'
2
- require 'rails/generators/rails/migration/migration_generator'
3
2
  require 'rails/generators/active_record'
4
3
  require 'rails/generators/active_record/migration/migration_generator'
5
4
 
@@ -9,6 +8,7 @@ module SecondBase
9
8
  source_root ActiveRecord::Generators::MigrationGenerator.source_root
10
9
 
11
10
  def self.desc
11
+ require 'rails/generators/rails/migration/migration_generator'
12
12
  Rails::Generators::MigrationGenerator.desc
13
13
  end
14
14
 
data/secondbase.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.email = ['kdurante@customink.com', 'hunterglenmadison@icloud.com', 'ken@metaskills.net']
10
10
  s.homepage = 'http://github.com/customink/secondbase'
11
11
  s.summary = 'Seamless second database integration for Rails.'
12
- s.description = "SecondBase provides support for Rails to manage dual databases by focusing on ActiveRecord tasks that create, migrate, and test your databases."
12
+ s.description = "SecondBase provides support for Rails to manage dual databases by extending ActiveRecord tasks that create, migrate, and test your databases."
13
13
  s.files = `git ls-files`.split("\n")
14
14
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
15
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -2,7 +2,10 @@ require 'test_helper'
2
2
 
3
3
  class GeneratorTest < SecondBase::TestCase
4
4
 
5
- teardown { generated_migration_delete }
5
+ teardown do
6
+ generated_migration_delete
7
+ generated_migration_base_delete
8
+ end
6
9
 
7
10
  def test_initialization_via_help
8
11
  output = Dir.chdir(dummy_root) { `rails g -h` }
@@ -23,6 +26,14 @@ class GeneratorTest < SecondBase::TestCase
23
26
  assert_match %r{t.integer :count}, migration
24
27
  end
25
28
 
29
+ def test_base_migration_generator
30
+ output = Dir.chdir(dummy_root) { `rails g migration AddBaseColumn` }
31
+ assert_match %r{create.*db/migrate/.*add_base_column\.rb}, output
32
+ migration = generated_migration_base_data
33
+ assert_match %r{class AddBaseColumn}, migration
34
+ assert_match %r{def change}, migration
35
+ end
36
+
26
37
 
27
38
  private
28
39
 
@@ -38,4 +49,16 @@ class GeneratorTest < SecondBase::TestCase
38
49
  FileUtils.rm_rf(generated_migration) if generated_migration
39
50
  end
40
51
 
52
+ def generated_migration_base
53
+ Dir["#{dummy_db}/migrate/*add_base*.{rb}"].first
54
+ end
55
+
56
+ def generated_migration_base_data
57
+ generated_migration_base ? File.read(generated_migration_base) : ''
58
+ end
59
+
60
+ def generated_migration_base_delete
61
+ FileUtils.rm_rf(generated_migration_base) if generated_migration_base
62
+ end
63
+
41
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secondbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karle Durante
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-10 00:00:00.000000000 Z
13
+ date: 2016-04-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -138,8 +138,8 @@ dependencies:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
- description: SecondBase provides support for Rails to manage dual databases by focusing
142
- on ActiveRecord tasks that create, migrate, and test your databases.
141
+ description: SecondBase provides support for Rails to manage dual databases by extending
142
+ ActiveRecord tasks that create, migrate, and test your databases.
143
143
  email:
144
144
  - kdurante@customink.com
145
145
  - hunterglenmadison@icloud.com
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  version: '0'
220
220
  requirements: []
221
221
  rubyforge_project:
222
- rubygems_version: 2.4.5.1
222
+ rubygems_version: 2.4.8
223
223
  signing_key:
224
224
  specification_version: 4
225
225
  summary: Seamless second database integration for Rails.