prodder 1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.travis.yml +52 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +64 -0
- data/LICENSE.txt +21 -0
- data/README.md +272 -0
- data/Rakefile +20 -0
- data/bin/prodder +4 -0
- data/features/commit.feature +69 -0
- data/features/dump.feature +187 -0
- data/features/init.feature +24 -0
- data/features/lint.feature +46 -0
- data/features/prodder.feature +76 -0
- data/features/push.feature +25 -0
- data/features/step_definitions/git_steps.rb +65 -0
- data/features/step_definitions/prodder_steps.rb +150 -0
- data/features/support/blog.git.tgz +0 -0
- data/features/support/env.rb +116 -0
- data/features/support/prodder__blog_prod.sql +153 -0
- data/lib/prodder.rb +5 -0
- data/lib/prodder/cli.rb +135 -0
- data/lib/prodder/config.rb +95 -0
- data/lib/prodder/git.rb +97 -0
- data/lib/prodder/pg.rb +486 -0
- data/lib/prodder/prodder.rake +390 -0
- data/lib/prodder/project.rb +150 -0
- data/lib/prodder/railtie.rb +7 -0
- data/lib/prodder/version.rb +3 -0
- data/prodder.gemspec +25 -0
- data/spec/config_spec.rb +64 -0
- data/spec/spec_helper.rb +3 -0
- metadata +91 -0
data/prodder.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "prodder/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "prodder"
|
7
|
+
s.version = Prodder::VERSION
|
8
|
+
s.authors = ["Kyle Hargraves"]
|
9
|
+
s.email = ["pd@krh.me"]
|
10
|
+
s.homepage = "https://github.com/enova/prodder"
|
11
|
+
s.license = "MIT"
|
12
|
+
s.summary = "Maintain your Rails apps' structure, seed and quality_checks files using production dumps"
|
13
|
+
s.description = "Migrations suck long-term. Now you can kill them routinely."
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
# These dependencies do not match the Gemfile's for a reason.
|
21
|
+
# These are the only dependencies necessary to satisfy inclusion of this
|
22
|
+
# gem in a Rails application; any dependencies necessary to run prodder
|
23
|
+
# itself are specified in the Gemfile.
|
24
|
+
s.add_dependency "deject"
|
25
|
+
end
|
data/spec/config_spec.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Prodder::Config, 'linting' do
|
4
|
+
let(:valid_config) { YAML.load Prodder::Config.example_contents }
|
5
|
+
|
6
|
+
def config_without(path)
|
7
|
+
keys = path.split('/')
|
8
|
+
hash = valid_config
|
9
|
+
hash = hash[keys.shift] until keys.size == 1
|
10
|
+
hash.delete keys.first
|
11
|
+
valid_config
|
12
|
+
end
|
13
|
+
|
14
|
+
def errors_for(hash)
|
15
|
+
Prodder::Config.new(hash).lint
|
16
|
+
end
|
17
|
+
|
18
|
+
specify 'the example contents pass lint checks' do
|
19
|
+
hash = YAML.load(Prodder::Config.example_contents)
|
20
|
+
expect { Prodder::Config.new(hash).lint! }.not_to raise_error
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'missing required key:' do
|
24
|
+
|
25
|
+
%w[structure_file
|
26
|
+
seed_file
|
27
|
+
|
28
|
+
db
|
29
|
+
db/name
|
30
|
+
db/host
|
31
|
+
db/user
|
32
|
+
|
33
|
+
git
|
34
|
+
git/origin
|
35
|
+
git/author
|
36
|
+
].each do |path|
|
37
|
+
specify path do
|
38
|
+
errors_for(config_without "blog/#{path}").should ==
|
39
|
+
["Missing required configuration key: blog/#{path}"]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'optional keys:' do
|
45
|
+
specify 'db/password' do
|
46
|
+
errors_for(config_without 'blog/db/password').should be_empty
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context '#lint!' do
|
51
|
+
it 'raises a LintError with the list of errors' do
|
52
|
+
config = Prodder::Config.new(config_without 'blog/db/name')
|
53
|
+
expect {
|
54
|
+
config.lint!
|
55
|
+
}.to raise_error(Prodder::Config::LintError) { |ex|
|
56
|
+
ex.errors.should == ['Missing required configuration key: blog/db/name']
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'returns an empty collection if there are no errors' do
|
61
|
+
Prodder::Config.new(valid_config).lint!.should == []
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: prodder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.7'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kyle Hargraves
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: deject
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Migrations suck long-term. Now you can kill them routinely.
|
28
|
+
email:
|
29
|
+
- pd@krh.me
|
30
|
+
executables:
|
31
|
+
- prodder
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- ".gitignore"
|
36
|
+
- ".travis.yml"
|
37
|
+
- Gemfile
|
38
|
+
- Gemfile.lock
|
39
|
+
- LICENSE.txt
|
40
|
+
- README.md
|
41
|
+
- Rakefile
|
42
|
+
- bin/prodder
|
43
|
+
- features/commit.feature
|
44
|
+
- features/dump.feature
|
45
|
+
- features/init.feature
|
46
|
+
- features/lint.feature
|
47
|
+
- features/prodder.feature
|
48
|
+
- features/push.feature
|
49
|
+
- features/step_definitions/git_steps.rb
|
50
|
+
- features/step_definitions/prodder_steps.rb
|
51
|
+
- features/support/blog.git.tgz
|
52
|
+
- features/support/env.rb
|
53
|
+
- features/support/prodder__blog_prod.sql
|
54
|
+
- lib/prodder.rb
|
55
|
+
- lib/prodder/cli.rb
|
56
|
+
- lib/prodder/config.rb
|
57
|
+
- lib/prodder/git.rb
|
58
|
+
- lib/prodder/pg.rb
|
59
|
+
- lib/prodder/prodder.rake
|
60
|
+
- lib/prodder/project.rb
|
61
|
+
- lib/prodder/railtie.rb
|
62
|
+
- lib/prodder/version.rb
|
63
|
+
- prodder.gemspec
|
64
|
+
- spec/config_spec.rb
|
65
|
+
- spec/spec_helper.rb
|
66
|
+
homepage: https://github.com/enova/prodder
|
67
|
+
licenses:
|
68
|
+
- MIT
|
69
|
+
metadata: {}
|
70
|
+
post_install_message:
|
71
|
+
rdoc_options: []
|
72
|
+
require_paths:
|
73
|
+
- lib
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
requirements: []
|
85
|
+
rubyforge_project:
|
86
|
+
rubygems_version: 2.6.6
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: Maintain your Rails apps' structure, seed and quality_checks files using
|
90
|
+
production dumps
|
91
|
+
test_files: []
|