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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8775b118d632b6d115055e0f8fcef4cfa9f0908c
4
- data.tar.gz: c78d28c7863de87b9336487ebf6c60f9e7c5abab
3
+ metadata.gz: 2fd41e42699705d43fd3c54497abeb6ebce03d7b
4
+ data.tar.gz: 5a72b4c3fbee77a74f1d8ab93ea1a5c698521235
5
5
  SHA512:
6
- metadata.gz: 4b6e4ca16a710cbc554f026c572cb18fdec3bbd605ca00bd288d15fa54cff6f4a32d6a7afba09f3209c1ba68a28cb60346c9ee1e5212d3f1a2b0afc6dd7620c0
7
- data.tar.gz: 65f5605caa98b23b43796e6ccfeb0b4468b2830c6001923624ff9720f13e62622dfd8f9efd52191d856b681464dc280e14b1cf4eb2e650d967fc2f60cdfcbc6c
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 the 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).
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
 
@@ -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
- @dbconfig = YAML.load_file(dbconfig_file)['development']
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 }
@@ -1,3 +1,3 @@
1
1
  module Squasher
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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)
@@ -1,5 +1,6 @@
1
1
  development:
2
2
  database: app_development
3
+ encoding: <%= "8-ftu".reverse %>
3
4
  user: root
4
5
  password: password
5
6
  test:
@@ -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 include ("database: squasher")
32
- expect(content).to include("development:")
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.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-03-02 00:00:00.000000000 Z
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.0
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: