seedster 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: 468b8c6fc14489ca306402904281050c991ab991
4
- data.tar.gz: 59cf2ae2eb89467266ad9d9d507318b4cf9f6604
3
+ metadata.gz: 43fbeb4071f54875cbbc8228d0c36b663a1dc656
4
+ data.tar.gz: ed258b43a623c4fb04724c91ab9c3ebbe14d6eb3
5
5
  SHA512:
6
- metadata.gz: 89ae08729c0184f4a8cd7ce1096b2a2148763fb7e2125f12824756c6cec3f9af0107369a6d80855a0e380ec40b2313f581acb5c766192e0cffa05f96d69ae7cb
7
- data.tar.gz: 60fe5fc13cc95c498acef17d47ac08f193267f926a01830b28690afbe6e57f79dc0ac18206bcda2bb2124f16e8ec119b788ca046aa05542bff5eb180ba910b9d
6
+ metadata.gz: 4f55fc4569508eaeffcd84c3d7272846eaefc46467ff37476a1397f1521d7e59902cff42f9324daa4291a582ba8cf0f8e52dc0f126aea3e855c05cd0997cbcda
7
+ data.tar.gz: f84db4a58dca3c716b77ffa491779d89097382d1dd2c738b102368f6f29139966694fa4e105ec53279eb26a497de9af54be5bb9be8d7c0fce69dd82c10409de8
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [0.1.5] - 2019-07-16
2
+
3
+ ### Added
4
+ - Feature: Rails initializer. Run with `rails generate seedster:initializer`
5
+
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
- ## Installation
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
- ## Initializer
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
- Create a file `config/initializers/seedster.rb` with content like this:
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
- ### Initializer config options
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
- ## Testing
151
+ ### Testing
135
152
 
136
153
  Run the test suite with `rake test`.
137
154
 
138
- ## Contributing
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
- ## Releasing a new version
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
- ## License
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
- ## Code of Conduct
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
@@ -14,5 +14,5 @@
14
14
  # limitations under the License.
15
15
  #
16
16
  module Seedster
17
- VERSION = '0.1.4'
17
+ VERSION = '0.1.5'
18
18
  end
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 = "Apache2"
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
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-06-24 00:00:00.000000000 Z
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
- - Apache2
85
+ - Apache-2.0
83
86
  metadata: {}
84
87
  post_install_message:
85
88
  rdoc_options: []