squasher 0.1.4 → 0.1.5

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: b5f1d8e8ce71fa78055a2156c47b415b74cd229d
4
- data.tar.gz: 395976fb92587dac500a63c35b636020cb0add3c
3
+ metadata.gz: b0778a1404502d52c05ea708ff823f10b2b8a832
4
+ data.tar.gz: 2f22c623c7b578290366930e5c325ebc1f28506e
5
5
  SHA512:
6
- metadata.gz: aa0d0ca6d649c17cd2802f1972ac113f2f63cefa4299b9278ed7666e83b99cade8616d84f196f9450ec0f263a3f7516fc5e92598a0a115784ce8badb40aab198
7
- data.tar.gz: e6e9b8143a16d37867c787c999435871cc28b975f851af7dbdf2b6aeb89ef3c4a9e0ed1dab25c3e72fe2c0f7e59b5c07c80297e4f856360a480655d317b37325
6
+ metadata.gz: 502c4b9e2b6545473aa2804fda03f5d0a00f90952c11600b8c109057ed08e19a909b649a93563609bc97fd5391ce6baf6d5642a2da371d0d67c3d4e4cacfefa6
7
+ data.tar.gz: 1cec4959ad6c7ac08b52fcb8be657efc0f857ab772f6e81653b58ecbd3a1e21fb935d6feea0079e71fad001ecbdbe1ac093e1f21fa07eebed5c88a29d4cbda50
data/.gitignore CHANGED
@@ -1,8 +1,8 @@
1
1
  *.gem
2
2
  *.rbc
3
- .bundle
4
- .config
5
- .yardoc
3
+ /.bundle
4
+ /.config
5
+ /.rspec
6
6
  Gemfile.lock
7
7
  InstalledFiles
8
8
  _yardoc
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Code Climate](https://codeclimate.com/github/jalkoby/squasher.png)](https://codeclimate.com/github/jalkoby/squasher)
5
5
  [![Gem Version](https://badge.fury.io/rb/squasher.png)](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 (a new migration will look like a schema).
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
 
@@ -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
- content = ERB.new(File.read(dbconfig_file)).result(binding)
71
- @dbconfig = YAML.load(content)['development']
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 }
@@ -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 of old schema migration records(:red<yes>/:green<no>)?",
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 could not find `:green<database.yml>` with working development environment",
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 a clean migration",
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
  }
@@ -1,3 +1,3 @@
1
1
  module Squasher
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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
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: 2014-06-13 00:00:00.000000000 Z
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.2.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