ridgepole 0.7.0.beta4 → 0.7.0.beta5

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: c969f9221316f89684fa4fd05a7b85476796bfa5
4
- data.tar.gz: 0c0a78110650aaa73229e392938a836a647a606f
3
+ metadata.gz: d63e13051bdf5f02a615adabd88bd5f3d74a87f8
4
+ data.tar.gz: ebe4a70a6df6bb7df7169ac0bc3756c723aedf17
5
5
  SHA512:
6
- metadata.gz: 647362e0b261bcb4e452b5633a4bcaed77cd626409b70717c4bacf6e1bb5d5c7c9abb7868467d184711a5a1cf4f7badfcddb25bae3c2648019e0572b8d8f13d9
7
- data.tar.gz: e514c6f90fe30e49d03153ba6e7d87824c86bee9448f0163a7fcca3a814a0c5fc03d5691d5ea86098d7b176f6bb5a386472e9929fab65616d81977b2fb4b3658
6
+ metadata.gz: 8bc21046e4ada603467911d1a906b20145c9c4c6269194521d4f9a0c0832f6a236df822a78fbac0efc108522f83236ffbd253d10d93e009255e1596f0dc40302
7
+ data.tar.gz: f873f574b65d746a9bc7e043dee9087e235266778f4af81cf91b7f329e529c23cdbacf24fd61f6b03528eb43bf3d9d6c72ec9a8bab24e06d1bb2c80099ca35f7
data/README.md CHANGED
@@ -9,7 +9,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
9
9
  [![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.6)](https://travis-ci.org/winebarrel/ridgepole)
10
10
  [![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.6)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.6)
11
11
 
12
- [![Edge Version](https://img.shields.io/badge/edge_version-0.7.0.beta4-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta4)
12
+ [![Edge Version](https://img.shields.io/badge/edge_version-0.7.0.beta5-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta5)
13
13
  [![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.7)](https://travis-ci.org/winebarrel/ridgepole)
14
14
  [![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.7)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.7)
15
15
 
data/lib/ridgepole.rb CHANGED
@@ -10,10 +10,10 @@ require 'active_support'
10
10
  require 'active_support/core_ext'
11
11
 
12
12
  require 'diffy'
13
- require 'pp_sort_hash'
14
13
 
15
14
  module Ridgepole; end
16
15
 
16
+ require 'ridgepole/ext/pp_sort_hash'
17
17
  require 'ridgepole/client'
18
18
  require 'ridgepole/connection_adapters'
19
19
  require 'ridgepole/default_limit'
@@ -407,6 +407,9 @@ class Ridgepole::Diff
407
407
  end
408
408
 
409
409
  def diff_inspect(obj1, obj2, options = {})
410
+ obj1 = Ridgepole::Ext::PpSortHash.extend_if_hash(obj1)
411
+ obj2 = Ridgepole::Ext::PpSortHash.extend_if_hash(obj2)
412
+
410
413
  diffy = Diffy::Diff.new(
411
414
  obj1.pretty_inspect,
412
415
  obj2.pretty_inspect,
@@ -0,0 +1,29 @@
1
+ module Ridgepole
2
+ module Ext
3
+ module PpSortHash
4
+ def pretty_print(q)
5
+ q.group(1, '{', '}') {
6
+ q.seplist(self.sort_by {|k, _| k.to_s } , nil, :each) {|k, v|
7
+ q.group {
8
+ q.pp k
9
+ q.text '=>'
10
+ q.group(1) {
11
+ q.breakable ''
12
+ q.pp v
13
+ }
14
+ }
15
+ }
16
+ }
17
+ end
18
+
19
+ def self.extend_if_hash(obj)
20
+ if obj.kind_of?(Hash)
21
+ obj = obj.dup
22
+ obj.extend(self)
23
+ end
24
+
25
+ obj
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module Ridgepole
2
- VERSION = '0.7.0.beta4'
2
+ VERSION = '0.7.0.beta5'
3
3
  end
data/ridgepole.gemspec CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_dependency 'activerecord', '>= 5.0.1', '< 6'
24
24
  spec.add_dependency 'diffy'
25
- spec.add_dependency 'pp_sort_hash'
26
25
  spec.add_development_dependency 'bundler'
27
26
  spec.add_development_dependency 'rake'
28
27
  spec.add_development_dependency 'rspec', '>= 3.0.0'
@@ -45,7 +45,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
45
45
  "# employees",
46
46
  "# Compare definitions",
47
47
  "# employees",
48
- " {:definition=>\n {\"birth_date\"=>{:options=>{:null=>false}, :type=>:date},\n \"first_name\"=>{:options=>{:limit=>14, :null=>false}, :type=>:string},\n- \"gender\"=>{:options=>{:limit=>1, :null=>false}, :type=>:string},\n+ \"gender2\"=>{:options=>{:limit=>1, :null=>false}, :type=>:string},\n \"hire_date\"=>{:options=>{:null=>false}, :type=>:date},\n \"last_name\"=>{:options=>{:limit=>16, :null=>false}, :type=>:string}},\n :options=>{:primary_key=>\"emp_no\"}}",
48
+ " {\"birth_date\"=>{:type=>:date, :options=>{:null=>false}},\n \"first_name\"=>{:type=>:string, :options=>{:limit=>14, :null=>false}},\n \"last_name\"=>{:type=>:string, :options=>{:limit=>16, :null=>false}},\n- \"gender\"=>{:type=>:string, :options=>{:limit=>1, :null=>false}},\n+ \"gender2\"=>{:type=>:string, :options=>{:limit=>1, :null=>false}},\n \"hire_date\"=>{:type=>:date, :options=>{:null=>false}}},\n :options=>{:primary_key=>\"emp_no\"}}",
49
49
  "# Load tables",
50
50
  "# employees",
51
51
  "# Load tables",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridgepole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.beta4
4
+ version: 0.7.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -44,20 +44,6 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
- - !ruby/object:Gem::Dependency
48
- name: pp_sort_hash
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
47
  - !ruby/object:Gem::Dependency
62
48
  name: bundler
63
49
  requirement: !ruby/object:Gem::Requirement
@@ -247,6 +233,7 @@ files:
247
233
  - lib/ridgepole/execute_expander.rb
248
234
  - lib/ridgepole/ext/abstract_mysql_adapter/disable_table_options.rb
249
235
  - lib/ridgepole/ext/abstract_mysql_adapter/use_alter_index.rb
236
+ - lib/ridgepole/ext/pp_sort_hash.rb
250
237
  - lib/ridgepole/ext/schema_dumper.rb
251
238
  - lib/ridgepole/external_sql_executer.rb
252
239
  - lib/ridgepole/logger.rb