schemate 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +23 -0
- data/Guardfile +70 -0
- data/LICENSE.txt +21 -0
- data/README.md +71 -0
- data/Rakefile +6 -0
- data/SECURITY.md +21 -0
- data/lib/generators/schemate/install_generator.rb +18 -0
- data/lib/generators/schemate/templates/schemate.rb +9 -0
- data/lib/schemate.rb +94 -0
- data/lib/schemate/config.rb +21 -0
- data/lib/schemate/version.rb +3 -0
- data/lib/tasks/export_schema.rake +13 -0
- data/lib/tasks/schemate_migrate.rake +25 -0
- data/schemate.gemspec +37 -0
- metadata +120 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e09e38daf99bb8d6110644ba081f5395590da85a855b0221e37e1fbd48e9f9d3
|
4
|
+
data.tar.gz: ef5c0210fa124bd84147207edbafea9c4ec2897987b03361aee28f1fac1033f8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ca3bd184a77bbd785d308317b4e157ecd62438f2c8d7cb26f556e0507b41273fd5b3145b3c274e80681ec393b0ae715adbd53394fc9c4c14a1c456110144160f
|
7
|
+
data.tar.gz: 783da2c32a78c589723d53c0f522f2ad7d0c08eb427a368884e431203fd361fb953a2cd915e5ec14ff4afaf16a85e462dbf180f5f338b46883dd809a2150a840
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at saito@palan.co.jp. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
group :development, :test do
|
6
|
+
gem 'byebug'
|
7
|
+
gem 'guard-rspec', require: false
|
8
|
+
gem 'rspec', require: false
|
9
|
+
|
10
|
+
gem "rubocop", ">= 0.49.0"
|
11
|
+
gem 'simplecov', require: false
|
12
|
+
|
13
|
+
gem 'codeclimate-test-reporter'
|
14
|
+
gem 'coveralls'
|
15
|
+
|
16
|
+
platforms :mri, :mingw do
|
17
|
+
gem 'pry', require: false
|
18
|
+
gem 'pry-coolline', require: false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Specify your gem's dependencies in schemate.gemspec
|
23
|
+
gemspec
|
data/Guardfile
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
19
|
+
# rspec may be run, below are examples of the most common uses.
|
20
|
+
# * bundler: 'bundle exec rspec'
|
21
|
+
# * bundler binstubs: 'bin/rspec'
|
22
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
23
|
+
# installed the spring binstubs per the docs)
|
24
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
25
|
+
# * 'just' rspec: 'rspec'
|
26
|
+
|
27
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
28
|
+
require "guard/rspec/dsl"
|
29
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
30
|
+
|
31
|
+
# Feel free to open issues for suggestions and improvements
|
32
|
+
|
33
|
+
# RSpec files
|
34
|
+
rspec = dsl.rspec
|
35
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
36
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
37
|
+
watch(rspec.spec_files)
|
38
|
+
|
39
|
+
# Ruby files
|
40
|
+
ruby = dsl.ruby
|
41
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
42
|
+
|
43
|
+
# Rails files
|
44
|
+
rails = dsl.rails(view_extensions: %w(erb haml slim))
|
45
|
+
dsl.watch_spec_files_for(rails.app_files)
|
46
|
+
dsl.watch_spec_files_for(rails.views)
|
47
|
+
|
48
|
+
watch(rails.controllers) do |m|
|
49
|
+
[
|
50
|
+
rspec.spec.call("routing/#{m[1]}_routing"),
|
51
|
+
rspec.spec.call("controllers/#{m[1]}_controller"),
|
52
|
+
rspec.spec.call("acceptance/#{m[1]}")
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
56
|
+
# Rails config changes
|
57
|
+
watch(rails.spec_helper) { rspec.spec_dir }
|
58
|
+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
59
|
+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
60
|
+
|
61
|
+
# Capybara features specs
|
62
|
+
watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
|
63
|
+
watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
|
64
|
+
|
65
|
+
# Turnip features and steps
|
66
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
67
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
68
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
69
|
+
end
|
70
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 eishi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# Schemate [![Build Status](https://travis-ci.org/eishis/schemate.svg?branch=master)](https://travis-ci.org/eishis/schemate) [![Coverage Status](https://coveralls.io/repos/github/eishis/schemate/badge.svg?branch=master)](https://coveralls.io/github/eishis/schemate?branch=master)
|
2
|
+
|
3
|
+
Export current schema of ActiveRecord models as markdown or CSV
|
4
|
+
|
5
|
+
The schema list (schemate.md) looks like this:
|
6
|
+
```
|
7
|
+
# Table name: `users`
|
8
|
+
## Columns
|
9
|
+
|FieldName |Attitutde |Size |NULL |Default |Comment |
|
10
|
+
|---|---|---|---|---|---|
|
11
|
+
|id |integer |8 |false | ||
|
12
|
+
|name |string |255 |true | ||
|
13
|
+
|email |string |255 |false | ||
|
14
|
+
|crypted_password |string |255 |true | ||
|
15
|
+
|salt |string |255 |true | ||
|
16
|
+
```
|
17
|
+
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
Add this line to your application's Gemfile:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
gem 'schemate'
|
24
|
+
```
|
25
|
+
|
26
|
+
And then execute:
|
27
|
+
|
28
|
+
$ bundle
|
29
|
+
|
30
|
+
Or install it yourself as:
|
31
|
+
|
32
|
+
$ gem install schemate
|
33
|
+
|
34
|
+
## Usage
|
35
|
+
|
36
|
+
Export schema to CSV:
|
37
|
+
|
38
|
+
$ bundle exec rake schemate:export_csv
|
39
|
+
|
40
|
+
Export schema to Markdown:
|
41
|
+
|
42
|
+
$ bundle exec rake schemate:export_md
|
43
|
+
|
44
|
+
## Configuration
|
45
|
+
To generate a configuration file(config/initializers/schemate.rb), to set default options:
|
46
|
+
|
47
|
+
$ rails g schemate:install
|
48
|
+
|
49
|
+
Edit this file to control auto generation, and output format.
|
50
|
+
|
51
|
+
By default, schema is exported only when you run `schemate:export_csv` or `schemate:export_md`.
|
52
|
+
If you want to export schema automatically with `rake db:migrate`, edit the file and change:
|
53
|
+
|
54
|
+
config.auto_generate = true
|
55
|
+
|
56
|
+
By default, auto generate file type is markdown.
|
57
|
+
If you want to generate file as csv, edit the file and change:
|
58
|
+
|
59
|
+
config.auto_generate_type = 'csv'
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/palan-inc/schemate. 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.
|
64
|
+
|
65
|
+
## License
|
66
|
+
|
67
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
68
|
+
|
69
|
+
## Code of Conduct
|
70
|
+
|
71
|
+
Everyone interacting in the Schemate project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/palan-inc/schemate/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/SECURITY.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
## Supported Versions
|
4
|
+
|
5
|
+
Use this section to tell people about which versions of your project are
|
6
|
+
currently being supported with security updates.
|
7
|
+
|
8
|
+
| Version | Supported |
|
9
|
+
| ------- | ------------------ |
|
10
|
+
| 5.1.x | :white_check_mark: |
|
11
|
+
| 5.0.x | :x: |
|
12
|
+
| 4.0.x | :white_check_mark: |
|
13
|
+
| < 4.0 | :x: |
|
14
|
+
|
15
|
+
## Reporting a Vulnerability
|
16
|
+
|
17
|
+
Use this section to tell people how to report a vulnerability.
|
18
|
+
|
19
|
+
Tell them where to go, how often they can expect to get an update on a
|
20
|
+
reported vulnerability, what to expect if the vulnerability is accepted or
|
21
|
+
declined, etc.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'securerandom'
|
2
|
+
|
3
|
+
module Schemate
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
|
7
|
+
|
8
|
+
desc 'Copy annotate_models rakefiles for automatic annotation'
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
10
|
+
|
11
|
+
# copy rake tasks
|
12
|
+
def copy_tasks
|
13
|
+
template 'schemate.rb', 'config/initializers/schemate.rb'
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
Schemate.configure do |config|
|
3
|
+
# == Auto generate
|
4
|
+
# A schema list is generated automatically when you run rails:db
|
5
|
+
# config.auto_generate = true
|
6
|
+
|
7
|
+
# If you want to export schema as csv. `md` by default
|
8
|
+
# config.auto_generate_type = 'csv'
|
9
|
+
end
|
data/lib/schemate.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
require "schemate/version"
|
2
|
+
|
3
|
+
module Schemate
|
4
|
+
if defined?(::Rails::Railtie)
|
5
|
+
class Railtie < ::Rails::Railtie
|
6
|
+
rake_tasks do
|
7
|
+
load "tasks/export_schema.rake"
|
8
|
+
load "tasks/schemate_migrate.rake"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class << self
|
14
|
+
def export(format:)
|
15
|
+
return if format.nil?
|
16
|
+
|
17
|
+
Rails.application.eager_load!
|
18
|
+
begin
|
19
|
+
export_as(format)
|
20
|
+
rescue StandardError => ex
|
21
|
+
STDERR.puts "Unable to export : #{ex.message}"
|
22
|
+
return
|
23
|
+
end
|
24
|
+
puts_complete_message(format)
|
25
|
+
end
|
26
|
+
|
27
|
+
def export_csv
|
28
|
+
CSV.open('schemate.csv', 'w') do |file|
|
29
|
+
ActiveRecord::Base.descendants.each do |model|
|
30
|
+
model_name = model.name
|
31
|
+
table_name = model_name.tableize
|
32
|
+
|
33
|
+
next unless tables.include?(table_name)
|
34
|
+
file << %W(#{table_name})
|
35
|
+
file << %w(FieldName Attitutde Size NULL Default Index Comment)
|
36
|
+
model.columns.each do |columns|
|
37
|
+
index = 'true' if model.connection.index_exists?(:"#{table_name}", :"#{columns.name}")
|
38
|
+
file << csv_row(columns, index)
|
39
|
+
end
|
40
|
+
file << %w()
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def csv_row(columns, index)
|
46
|
+
%W(
|
47
|
+
#{columns.name} #{columns.type} #{columns.limit}
|
48
|
+
#{columns.null} #{columns.default} #{index} #{columns.comment}
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
def export_md
|
53
|
+
File.open('schemate.md', 'w') do |file|
|
54
|
+
ActiveRecord::Base.descendants.each do |model|
|
55
|
+
model_name = model.name
|
56
|
+
table_name = model_name.tableize
|
57
|
+
|
58
|
+
next unless tables.include?(table_name)
|
59
|
+
file.puts("# Table name: `#{table_name}`\n")
|
60
|
+
file.puts('## Columns')
|
61
|
+
file.puts('|FieldName |Attitutde |Size |NULL |Default |Index |Comment |')
|
62
|
+
file.puts('|---|---|---|---|---|---|---|')
|
63
|
+
model.columns.each do |columns|
|
64
|
+
index = 'true' if model.connection.index_exists?(:"#{table_name}", :"#{columns.name}")
|
65
|
+
file.puts(md_row(columns, index))
|
66
|
+
end
|
67
|
+
file.puts("\n")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def md_row(columns, index)
|
73
|
+
"|#{columns.name} |#{columns.type} |#{columns.limit} |#{columns.null} |#{columns.default} |#{index} |#{columns.comment} |"
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
def export_as(format)
|
79
|
+
if format == 'csv'
|
80
|
+
export_csv
|
81
|
+
elsif format == 'md'
|
82
|
+
export_md
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def tables
|
87
|
+
@tables ||= ActiveRecord::Base.connection.tables
|
88
|
+
end
|
89
|
+
|
90
|
+
def puts_complete_message(format)
|
91
|
+
puts "complete! See schemate.#{format}!"
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'active_support/configurable'
|
2
|
+
module Schemate
|
3
|
+
def self.configure(&block)
|
4
|
+
yield @config ||= Schemate::Configuration.new
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.config
|
8
|
+
@config
|
9
|
+
end
|
10
|
+
|
11
|
+
class Configuration
|
12
|
+
include ActiveSupport::Configurable
|
13
|
+
config_accessor :auto_generate
|
14
|
+
config_accessor :auto_generate_type
|
15
|
+
end
|
16
|
+
|
17
|
+
configure do |config|
|
18
|
+
config.auto_generate = false
|
19
|
+
config.auto_generate_type = 'md'
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'csv'
|
2
|
+
|
3
|
+
namespace :schemate do
|
4
|
+
desc 'Create CSV file from schema information'
|
5
|
+
task export_csv: :environment do
|
6
|
+
Schemate.export(format: 'csv')
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'Create Markdown file from schema information'
|
10
|
+
task export_md: :environment do
|
11
|
+
Schemate.export(format: 'md')
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "schemate/config"
|
2
|
+
|
3
|
+
namespace :db do
|
4
|
+
[:migrate, :rollback].each do |cmd|
|
5
|
+
task cmd do
|
6
|
+
if Schemate.config.auto_generate_type == 'md'
|
7
|
+
Rake::Task['schemate:export_md'].invoke if Schemate.config.auto_generate
|
8
|
+
elsif Schemate.config.auto_generate_type == 'csv'
|
9
|
+
Rake::Task['schemate:export_csv'].invoke if Schemate.config.auto_generate
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
namespace cmd do
|
14
|
+
[:change, :up, :down, :reset, :redo].each do |t|
|
15
|
+
task t do
|
16
|
+
if Schemate.config.auto_generate_type == 'md'
|
17
|
+
Rake::Task['schemate:export_md'].invoke if Schemate.config.auto_generate
|
18
|
+
elsif Schemate.config.auto_generate_type == 'csv'
|
19
|
+
Rake::Task['schemate:export_csv'].invoke if Schemate.config.auto_generate
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/schemate.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "schemate/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "schemate"
|
8
|
+
spec.version = Schemate::VERSION
|
9
|
+
spec.authors = ["eishisaito", "yuh-pen", "TomoroKobori"]
|
10
|
+
spec.email = ["saito@palan.co.jp"]
|
11
|
+
|
12
|
+
spec.summary = 'Export Schema Data as CSV and Markdown format'
|
13
|
+
spec.description = 'Export Schema Data as CSV and Markdown format'
|
14
|
+
spec.homepage = 'https://github.com/palan-inc/schemate'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
# if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
# else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
+
# "public gem pushes."
|
24
|
+
# end
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
36
|
+
spec.add_development_dependency "coveralls"
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: schemate
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- eishisaito
|
8
|
+
- yuh-pen
|
9
|
+
- TomoroKobori
|
10
|
+
autorequire:
|
11
|
+
bindir: exe
|
12
|
+
cert_chain: []
|
13
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: bundler
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.15'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '1.15'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: rake
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '10.0'
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '10.0'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: rspec
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '3.0'
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '3.0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: coveralls
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
type: :development
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
description: Export Schema Data as CSV and Markdown format
|
72
|
+
email:
|
73
|
+
- saito@palan.co.jp
|
74
|
+
executables: []
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- ".coveralls.yml"
|
79
|
+
- ".gitignore"
|
80
|
+
- ".rspec"
|
81
|
+
- ".travis.yml"
|
82
|
+
- CODE_OF_CONDUCT.md
|
83
|
+
- Gemfile
|
84
|
+
- Guardfile
|
85
|
+
- LICENSE.txt
|
86
|
+
- README.md
|
87
|
+
- Rakefile
|
88
|
+
- SECURITY.md
|
89
|
+
- lib/generators/schemate/install_generator.rb
|
90
|
+
- lib/generators/schemate/templates/schemate.rb
|
91
|
+
- lib/schemate.rb
|
92
|
+
- lib/schemate/config.rb
|
93
|
+
- lib/schemate/version.rb
|
94
|
+
- lib/tasks/export_schema.rake
|
95
|
+
- lib/tasks/schemate_migrate.rake
|
96
|
+
- schemate.gemspec
|
97
|
+
homepage: https://github.com/palan-inc/schemate
|
98
|
+
licenses:
|
99
|
+
- MIT
|
100
|
+
metadata: {}
|
101
|
+
post_install_message:
|
102
|
+
rdoc_options: []
|
103
|
+
require_paths:
|
104
|
+
- lib
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
requirements: []
|
116
|
+
rubygems_version: 3.0.3
|
117
|
+
signing_key:
|
118
|
+
specification_version: 4
|
119
|
+
summary: Export Schema Data as CSV and Markdown format
|
120
|
+
test_files: []
|