seedster 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/CHANGELOG.md +5 -0
- data/README.md +27 -10
- data/lib/generators/seedster/initializer_generator.rb +14 -0
- data/lib/generators/seedster/templates/initializer.rb +33 -0
- data/lib/seedster/version.rb +1 -1
- data/seedster.gemspec +2 -2
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43fbeb4071f54875cbbc8228d0c36b663a1dc656
|
4
|
+
data.tar.gz: ed258b43a623c4fb04724c91ab9c3ebbe14d6eb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f55fc4569508eaeffcd84c3d7272846eaefc46467ff37476a1397f1521d7e59902cff42f9324daa4291a582ba8cf0f8e52dc0f126aea3e855c05cd0997cbcda
|
7
|
+
data.tar.gz: f84db4a58dca3c716b77ffa491779d89097382d1dd2c738b102368f6f29139966694fa4e105ec53279eb26a497de9af54be5bb9be8d7c0fce69dd82c10409de8
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -41,8 +41,19 @@ To download, extract, and load the data file:
|
|
41
41
|
dev_shell> rake seedster:load
|
42
42
|
```
|
43
43
|
|
44
|
+
## Table of Contents
|
44
45
|
|
45
|
-
|
46
|
+
* [Installation](#installation)
|
47
|
+
* [Initializer](#initializer)
|
48
|
+
* [Configuration Options](#configuration-options)
|
49
|
+
* [Seedster Development](#seedster-development)
|
50
|
+
* [Testing](#testing)
|
51
|
+
* [Contributing](#contributing)
|
52
|
+
* [Releasing a new version](#releasing-a-new-version)
|
53
|
+
* [License](#contributing)
|
54
|
+
* [Code of Conduct](#code-of-conduct)
|
55
|
+
|
56
|
+
### Installation
|
46
57
|
|
47
58
|
```ruby
|
48
59
|
gem 'seedster'
|
@@ -56,11 +67,17 @@ Or install it yourself as:
|
|
56
67
|
|
57
68
|
$ gem install seedster
|
58
69
|
|
59
|
-
|
70
|
+
### Initializer
|
60
71
|
|
61
72
|
An initializer is required to make Seedster work with your hosts, database, ssh config, and really drives everything that is unique to your application.
|
62
73
|
|
63
|
-
|
74
|
+
The gem provides an initializer. Run:
|
75
|
+
|
76
|
+
`rails generate seedster:initializer`
|
77
|
+
|
78
|
+
This will create a file `config/initializers/seedster.rb` where you can begin putting in values for your application. The configuration is both for DB credentials, SSH credentials, but also the configuration of the tables you wish to dump.
|
79
|
+
|
80
|
+
The initializer looks like this:
|
64
81
|
|
65
82
|
```ruby
|
66
83
|
Seedster.configure do |c|
|
@@ -85,7 +102,7 @@ end
|
|
85
102
|
```
|
86
103
|
|
87
104
|
|
88
|
-
###
|
105
|
+
### Configuration Options
|
89
106
|
|
90
107
|
##### `db_host`
|
91
108
|
|
@@ -127,19 +144,19 @@ The tables option is where each query is stored. This is currently an array of h
|
|
127
144
|
|
128
145
|
|
129
146
|
|
130
|
-
## Development
|
147
|
+
## Seedster Development
|
131
148
|
|
132
149
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
133
150
|
|
134
|
-
|
151
|
+
### Testing
|
135
152
|
|
136
153
|
Run the test suite with `rake test`.
|
137
154
|
|
138
|
-
|
155
|
+
### Contributing
|
139
156
|
|
140
157
|
Bug reports and pull requests are welcome on GitHub at https://github.com/groupon/seedster. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
141
158
|
|
142
|
-
|
159
|
+
### Releasing a new version
|
143
160
|
|
144
161
|
1. Update the version in `seedster.gemspec`
|
145
162
|
2. `git commit seedster.gemspec` with the following message format:
|
@@ -151,10 +168,10 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/groupo
|
|
151
168
|
* Some new bug fix
|
152
169
|
3. `rake release`
|
153
170
|
|
154
|
-
|
171
|
+
### License
|
155
172
|
|
156
173
|
The gem is available as open source under the terms of the [APACHE LICENSE, VERSION 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|
157
174
|
|
158
|
-
|
175
|
+
### Code of Conduct
|
159
176
|
|
160
177
|
Everyone interacting in the Seedster project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/groupon/seedster/blob/master/CODE_OF_CONDUCT.md).
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# https://guides.rubyonrails.org/generators.html
|
2
|
+
module Seedster
|
3
|
+
module Generators
|
4
|
+
class InitializerGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path('templates', __dir__)
|
6
|
+
|
7
|
+
def copy_initializer_file
|
8
|
+
copy_file \
|
9
|
+
'initializer.rb',
|
10
|
+
'config/initializers/seedster.rb'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Seedster.configure do |c|
|
2
|
+
c.db_host = 'host.com' # DB host. Fill this in, or reference Rails config/development.yml database values or ar-octopus config
|
3
|
+
c.db_name = 'db_nameXXX'
|
4
|
+
c.db_username = 'db_usernameXXX'
|
5
|
+
c.db_password = 'passwordXXX'
|
6
|
+
|
7
|
+
c.remote_host_path = "/var/company/www/app/current" # where the root of the app is deployed on the host
|
8
|
+
|
9
|
+
c.query_params = { } # pass in values to interpolate into queries,
|
10
|
+
# e.g. USER_ID=XXX would be {user_id: ENV['USER_ID']}
|
11
|
+
|
12
|
+
c.ssh_user = 'ssh_userXXX' # which user will connect to the host
|
13
|
+
|
14
|
+
c.dump_host = 'app.host.com' # host where app is deployed
|
15
|
+
|
16
|
+
#
|
17
|
+
# Help:
|
18
|
+
# Comma-separated list of hashes, with keys `query` and `name`, one hash per DB table
|
19
|
+
#
|
20
|
+
# Keys:
|
21
|
+
# query: the SQL query for the table to be dumped. Add a parameter like `user_id` to be passed in.
|
22
|
+
# name: the name of the database table
|
23
|
+
#
|
24
|
+
c.tables = [
|
25
|
+
# BEGIN example ---
|
26
|
+
# {
|
27
|
+
# query: %{SELECT u.* FROM users
|
28
|
+
# where u.id = '%{user_id}'},
|
29
|
+
# name: 'users'
|
30
|
+
# }
|
31
|
+
# END example -----
|
32
|
+
]
|
33
|
+
end
|
data/lib/seedster/version.rb
CHANGED
data/seedster.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = %q{Work with real content in development}
|
12
12
|
spec.description = %q{Easily load real application content for local development}
|
13
|
-
spec.homepage = ""
|
14
|
-
spec.license = "
|
13
|
+
spec.homepage = "https://github.com/groupon/seedster"
|
14
|
+
spec.license = "Apache-2.0"
|
15
15
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
16
|
f.match(%r{^(test|spec|features)/})
|
17
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seedster
|
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
|
- Groupon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,6 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- ".travis.yml"
|
64
|
+
- CHANGELOG.md
|
64
65
|
- CODE_OF_CONDUCT.md
|
65
66
|
- Gemfile
|
66
67
|
- Gemfile.lock
|
@@ -69,6 +70,8 @@ files:
|
|
69
70
|
- Rakefile
|
70
71
|
- bin/console
|
71
72
|
- bin/setup
|
73
|
+
- lib/generators/seedster/initializer_generator.rb
|
74
|
+
- lib/generators/seedster/templates/initializer.rb
|
72
75
|
- lib/seedster.rb
|
73
76
|
- lib/seedster/data_dumper.rb
|
74
77
|
- lib/seedster/data_loader.rb
|
@@ -77,9 +80,9 @@ files:
|
|
77
80
|
- lib/seedster/tasks/seedster.rb
|
78
81
|
- lib/seedster/version.rb
|
79
82
|
- seedster.gemspec
|
80
|
-
homepage:
|
83
|
+
homepage: https://github.com/groupon/seedster
|
81
84
|
licenses:
|
82
|
-
-
|
85
|
+
- Apache-2.0
|
83
86
|
metadata: {}
|
84
87
|
post_install_message:
|
85
88
|
rdoc_options: []
|