migration_data 0.2.0 → 0.2.1

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
2
  SHA1:
3
- metadata.gz: d05f84f59e7360b1c3d78be9b072c48da83c629d
4
- data.tar.gz: 64409deee872b191f27407a69e62a845c1ba5de1
3
+ metadata.gz: 4850001d7a0722db5b532dc29da4137d3be31df2
4
+ data.tar.gz: 5082292a2f2c707437a95629db472c52630d0efe
5
5
  SHA512:
6
- metadata.gz: 266a1f45b7a12a831fa1b1064b2aa2ae20eb6f50a3055f6995fd1d26822c8c29671bdd3eaa87f1c562677c6fadb800b21230ee48de4cf37414fc446f9521040b
7
- data.tar.gz: 565ff180725a97a90a49519bba1f671c54b5f0a284c10db2af7078266dcf18969534f133726e9236b6468f8948ff537c762d6283071890b0ebebe562b44de9db
6
+ metadata.gz: 92d2a6d2f7be86629e69c11a2515dd88f8496d1052467945bd7c85d5ad78d7d495ca37a73d32685765e725c13d0f49bcd9aa13972d41b5c2d72f094d063d0e17
7
+ data.tar.gz: 432041bddc31e4a414a63511bab485ba3a43027fb6d2e70dd17a94b6fd66a70c71adeeaf5b742d85106ec571d0b26b810731da18e5fda2e31799f0a51e64930d
data/.travis.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  language: ruby
2
+ before_install:
3
+ - gem install bundler -v 1.11.2
2
4
  rvm:
3
5
  - 1.9.3
4
6
  - 2.0.0
5
7
  - 2.1.0
8
+ - 2.2.0
data/Gemfile CHANGED
@@ -1,4 +1,10 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.0')
4
+ gem 'rails', '>= 4.0.0.rc1', '< 4.2.0.rc1'
5
+ else
6
+ gem 'rails', '~> 4.2'
7
+ end
8
+
3
9
  # Specify your gem's dependencies in migration_data.gemspec
4
10
  gemspec
@@ -1,3 +1,3 @@
1
1
  module MigrationData
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  some techniques which help to avoid these pitfalls. For example, define model
15
15
  classes in the migrations or write raw SQL. But they don't help in 100% cases anyway.
16
16
  This gem promises to solve the problem in a simple way.}
17
- spec.homepage = ""
17
+ spec.homepage = "http://railsguides.net/change-data-in-migrations-like-a-boss/"
18
18
  spec.license = "MIT"
19
19
 
20
20
  spec.files = `git ls-files`.split($/)
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.5'
26
- spec.add_development_dependency 'rake'
27
- spec.add_development_dependency 'sqlite3'
28
- spec.add_dependency 'rails', '>= 4.0.0.rc1'
26
+ spec.add_development_dependency 'rake', '~> 0'
27
+ spec.add_development_dependency 'sqlite3', '~> 0'
29
28
  end
@@ -19,7 +19,7 @@ describe 'db:schema:squash' do
19
19
  assert_equal <<-MIGRATION, File.read(latest_migration)
20
20
  class CreateSchema < ActiveRecord::Migration
21
21
  def change
22
- create_table \"users\", force: :cascade do |t|
22
+ create_table \"users\", force: #{FOURCE_MIGRATION} do |t|
23
23
  t.string \"name\"
24
24
  end
25
25
  end
@@ -10,7 +10,7 @@ describe MigrationData::ActiveRecord::SchemaDumper do
10
10
  it 'squashes the schema' do
11
11
  stream = MigrationData::ActiveRecord::SchemaDumper.dump
12
12
  assert_equal <<-SCHEMA, stream.string
13
- create_table \"users\", force: :cascade do |t|
13
+ create_table \"users\", force: #{FOURCE_MIGRATION} do |t|
14
14
  t.string \"name\"
15
15
  end
16
16
 
data/test/squash_test.rb CHANGED
@@ -17,7 +17,7 @@ describe MigrationData::Squash do
17
17
  assert_equal <<-MIGRATION, File.read(db_path.join('100500_create_schema.rb'))
18
18
  class CreateSchema < ActiveRecord::Migration
19
19
  def change
20
- create_table \"users\", force: :cascade do |t|
20
+ create_table \"users\", force: #{FOURCE_MIGRATION} do |t|
21
21
  t.string \"name\"
22
22
  end
23
23
  end
data/test/test_helper.rb CHANGED
@@ -5,3 +5,9 @@ require 'rails'
5
5
  Dir[File.join(File.dirname(__FILE__), 'support', '**/*.rb')].each { |f| require f }
6
6
 
7
7
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: 'tmp/test.sqlite3')
8
+
9
+ FOURCE_MIGRATION = if ActiveRecord.version < Gem::Version.new('4.2.0.rc1')
10
+ 'true'
11
+ else
12
+ ':cascade'
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration_data
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
  - Andrey Koleshko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-06 00:00:00.000000000 Z
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,44 +28,30 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rails
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 4.0.0.rc1
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: 4.0.0.rc1
69
55
  description: |-
70
56
  Sometimes we have to write some Rails code in the migrations and it's hard to
71
57
  keep them in working state because models wich are used there changes too often. there
@@ -102,7 +88,7 @@ files:
102
88
  - test/support/create_table_migration.rb
103
89
  - test/support/rails_app.rb
104
90
  - test/test_helper.rb
105
- homepage: ''
91
+ homepage: http://railsguides.net/change-data-in-migrations-like-a-boss/
106
92
  licenses:
107
93
  - MIT
108
94
  metadata: {}
@@ -137,3 +123,4 @@ test_files:
137
123
  - test/support/create_table_migration.rb
138
124
  - test/support/rails_app.rb
139
125
  - test/test_helper.rb
126
+ has_rdoc: