squasher 0.1.4 → 0.1.5
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 +4 -4
- data/.gitignore +3 -3
- data/README.md +1 -1
- data/lib/squasher/config.rb +7 -2
- data/lib/squasher/messages.json +5 -5
- data/lib/squasher/version.rb +1 -1
- metadata +4 -4
- data/.rspec +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0778a1404502d52c05ea708ff823f10b2b8a832
|
4
|
+
data.tar.gz: 2f22c623c7b578290366930e5c325ebc1f28506e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 502c4b9e2b6545473aa2804fda03f5d0a00f90952c11600b8c109057ed08e19a909b649a93563609bc97fd5391ce6baf6d5642a2da371d0d67c3d4e4cacfefa6
|
7
|
+
data.tar.gz: 1cec4959ad6c7ac08b52fcb8be657efc0f857ab772f6e81653b58ecbd3a1e21fb935d6feea0079e71fad001ecbdbe1ac093e1f21fa07eebed5c88a29d4cbda50
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[](https://codeclimate.com/github/jalkoby/squasher)
|
5
5
|
[](http://badge.fury.io/rb/squasher)
|
6
6
|
|
7
|
-
Squasher compresses old migrations in a Rails application. If you work on a big project with lots of migrations, every `rake db:migrate` might take a few seconds, or creating of a new database might take a few minutes. That's because Rails loads all those migration files. Squasher removes all the migrations and creates a single migration with the final database state of the specified date (
|
7
|
+
Squasher compresses old migrations in a Rails application. If you work on a big project with lots of migrations, every `rake db:migrate` might take a few seconds, or creating of a new database might take a few minutes. That's because Rails loads all those migration files. Squasher removes all the migrations and creates a single migration with the final database state of the specified date (the new migration will look like a schema).
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
data/lib/squasher/config.rb
CHANGED
@@ -67,8 +67,13 @@ module Squasher
|
|
67
67
|
return @dbconfig if defined?(@dbconfig)
|
68
68
|
return @dbconfig = nil unless File.exists?(dbconfig_file)
|
69
69
|
|
70
|
-
|
71
|
-
|
70
|
+
begin
|
71
|
+
content = ERB.new(File.read(dbconfig_file)).result(binding)
|
72
|
+
@dbconfig = YAML.load(content)['development']
|
73
|
+
rescue
|
74
|
+
@dbconfig = nil
|
75
|
+
end
|
76
|
+
|
72
77
|
if @dbconfig && !@dbconfig.empty?
|
73
78
|
@dbconfig['database'] = 'squasher'
|
74
79
|
@dbconfig = { 'development' => @dbconfig }
|
data/lib/squasher/messages.json
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
{
|
2
|
-
"keep_database" : "Squasher created the `:green<squasher>` database for its needs.\nIt might be useful if to keep it if any of your deleted migrations inserted data into database.\nKeep it (:green<yes> / :red<no>)?",
|
2
|
+
"keep_database" : "Squasher's created the `:green<squasher>` database for its needs.\nIt might be useful if to keep it if any of your deleted migrations inserted data into database.\nKeep it (:green<yes> / :red<no>)?",
|
3
3
|
|
4
|
-
"apply_clean": "Do you want to clean your database
|
4
|
+
"apply_clean": "Do you want to clean your database from the old schema migration records(:red<yes>/:green<no>)?",
|
5
5
|
|
6
|
-
"migration_folder_missing" : "The folder with migrations is missing.\nAre you sure you're in the :red<root of a rails> application?",
|
6
|
+
"migration_folder_missing" : "The folder with migrations is missing.\nAre you sure that you're in the :red<root of a rails> application?",
|
7
7
|
|
8
8
|
"no_migrations" : "There are no migrations in the folder prior to :red<%{date}>",
|
9
9
|
|
10
|
-
"dbconfig_invalid" : "Squasher
|
10
|
+
"dbconfig_invalid" : "Squasher couldn't load `:green<database.yml>`. Please, make sure that it's present and doesn't include any ruby code.",
|
11
11
|
|
12
12
|
"db_create": "Squasher is creating a tmp database",
|
13
13
|
|
14
14
|
"db_migrate": "Squasher is applying migrations on a tmp database",
|
15
15
|
|
16
|
-
"db_cleaning": "Squasher is applying
|
16
|
+
"db_cleaning": "Squasher is applying the clean migration",
|
17
17
|
|
18
18
|
"usage": "Example usage:\n :green<squasher> :yellow<year[/month][/day]> #squash migrations prior to a specified date\n :green<squasher> :yellow<clean> #generate or update a cleaning migration and apply it\n :green<squasher> :yellow<info> #show this message"
|
19
19
|
}
|
data/lib/squasher/version.rb
CHANGED
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Pchelincev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,7 +61,6 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- ".gitignore"
|
64
|
-
- ".rspec"
|
65
64
|
- ".travis.yml"
|
66
65
|
- Gemfile
|
67
66
|
- LICENSE.txt
|
@@ -110,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
109
|
version: '0'
|
111
110
|
requirements: []
|
112
111
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.4.5
|
114
113
|
signing_key:
|
115
114
|
specification_version: 4
|
116
115
|
summary: Squash your old migrations
|
@@ -127,3 +126,4 @@ test_files:
|
|
127
126
|
- spec/lib/squasher/worker_spec.rb
|
128
127
|
- spec/lib/squasher_spec.rb
|
129
128
|
- spec/spec_helper.rb
|
129
|
+
has_rdoc:
|
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--colour
|