squasher 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/squasher/config.rb +2 -1
- data/lib/squasher/version.rb +1 -1
- data/lib/squasher/worker.rb +1 -1
- data/spec/fake_app/config/database.yml +1 -0
- data/spec/lib/squasher/config_spec.rb +3 -3
- data/squasher.gemspec +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fd41e42699705d43fd3c54497abeb6ebce03d7b
|
4
|
+
data.tar.gz: 5a72b4c3fbee77a74f1d8ab93ea1a5c698521235
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26552971b06f4989e83c5d76920f86d254ecb61c07f1b18974088b4a174181d1a7676ac551d28c4c603c495795c3109045deee89043a8de7b26e0854bd338b39
|
7
|
+
data.tar.gz: 896c9919f3a85f5dea662c92a6c0c26f5eb762243d89f0f56e8751179e9ebd433adcdd937b1f4f8d2ce1a546863ab1ce91297d610973197188e17cc2e11f93a4
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ You can tell `squasher` a more detailed date, for example:
|
|
39
39
|
## Requirements
|
40
40
|
|
41
41
|
It works and was tested on Ruby 1.9.3+ and Rails 3.1+. It also requires a valid configuration in `config/database.yml` and using Ruby format in `db/schema.rb` (default Rails use-case).
|
42
|
-
If an old migration inserted data (created ActiveRecord model records) you will lose this code in the squashed migration, **BUT** `squasher` will ask you to leave a tmp database which will all
|
42
|
+
If an old migration inserted data (created ActiveRecord model records) you will lose this code in the squashed migration, **BUT** `squasher` will ask you to leave a tmp database which will have all data that was inserted while migrating. Using this database you could add that data as another migration, or into `config/seed.rb` (the expected place for this stuff).
|
43
43
|
|
44
44
|
## Contributing
|
45
45
|
|
data/lib/squasher/config.rb
CHANGED
@@ -66,7 +66,8 @@ module Squasher
|
|
66
66
|
return @dbconfig if defined?(@dbconfig)
|
67
67
|
return @dbconfig = nil unless File.exists?(dbconfig_file)
|
68
68
|
|
69
|
-
|
69
|
+
content = ERB.new(File.read(dbconfig_file)).result(binding)
|
70
|
+
@dbconfig = YAML.load(content)['development']
|
70
71
|
if @dbconfig && !@dbconfig.empty?
|
71
72
|
@dbconfig['database'] = 'squasher'
|
72
73
|
@dbconfig = { 'development' => @dbconfig }
|
data/lib/squasher/version.rb
CHANGED
data/lib/squasher/worker.rb
CHANGED
@@ -45,7 +45,7 @@ module Squasher
|
|
45
45
|
def migrations
|
46
46
|
return @migrations if @migrations
|
47
47
|
|
48
|
-
@migrations = config.migration_files.select { |file| before_date?(get_timestamp(file)) }
|
48
|
+
@migrations = config.migration_files.select { |file| before_date?(get_timestamp(file)) }.sort
|
49
49
|
end
|
50
50
|
|
51
51
|
def get_timestamp(file)
|
@@ -27,9 +27,9 @@ describe Squasher::Config do
|
|
27
27
|
it 'add required db config file' do
|
28
28
|
config.stub_dbconfig do
|
29
29
|
File.open(File.join(fake_root, 'config', 'database.yml')) do |stream|
|
30
|
-
content = stream.read
|
31
|
-
expect(content).to
|
32
|
-
expect(content).to
|
30
|
+
content = YAML.load(stream.read)
|
31
|
+
expect(content["development"]["database"]).to eq("squasher")
|
32
|
+
expect(content["development"]["encoding"]).to eq("utf-8")
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
data/squasher.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["mail@sergeyp.me"]
|
11
11
|
spec.description = %q{Squash your old migrations}
|
12
12
|
spec.summary = %q{Squash your old migrations}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/jalkoby/squasher"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squasher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Pchelincev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,7 +90,7 @@ files:
|
|
90
90
|
- spec/lib/squasher_spec.rb
|
91
91
|
- spec/spec_helper.rb
|
92
92
|
- squasher.gemspec
|
93
|
-
homepage:
|
93
|
+
homepage: https://github.com/jalkoby/squasher
|
94
94
|
licenses:
|
95
95
|
- MIT
|
96
96
|
metadata: {}
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.2.
|
113
|
+
rubygems_version: 2.2.2
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Squash your old migrations
|
@@ -127,4 +127,3 @@ test_files:
|
|
127
127
|
- spec/lib/squasher/worker_spec.rb
|
128
128
|
- spec/lib/squasher_spec.rb
|
129
129
|
- spec/spec_helper.rb
|
130
|
-
has_rdoc:
|