mina-data-migrate 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 81e3f2295199e6b56ffd2bc588631f3746282ba3a1dba07168d9d1078fc2e65c
4
+ data.tar.gz: e3946c21bca8334f7012556b930df2de547be7a95eeea1ea558d4aa6a93fd83f
5
+ SHA512:
6
+ metadata.gz: 4665a3f38831981425f5aadd230038b093bb78ecaf656966c3250613602fadba51e36420281fd1ce8b0e40cea057674a5443cf486fbb6e3d1d59ec150361b71d
7
+ data.tar.gz: 5fc7c4d62498cd0f75bf0572364f35addabb925890fde493ed079302427b958560cd6338dd526a78820d2848e06328e40dadaad66e77178f496ff5b51ab7c8c4
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mina_multistage.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2022 Vladimir Elchinov
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,77 @@
1
+ [![Gem Version](https://badge.fury.io/rb/mina-data-migrate.png)](http://badge.fury.io/rb/mina-multistage) [![Stories in Ready](https://badge.waffle.io/Endoze/mina-multistage.png?label=ready)](https://waffle.io/Endoze/mina-multistage)
2
+
3
+
4
+ # Mina::DataMigrate
5
+
6
+ Plugin for Mina that adds support for [data migrations](https://github.com/ilyakatz/data-migrate)
7
+
8
+
9
+ ## Installation & Usage
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```rb
14
+ gem 'mina-data-migrate', require: false
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ ```shell
20
+ $ bundle
21
+ ```
22
+
23
+ Require `mina/data-migrate` in your `config/deploy.rb`:
24
+
25
+ ```rb
26
+ require 'mina/data_migrate'
27
+ require 'mina/bundler'
28
+ require 'mina/rails'
29
+ require 'mina/git'
30
+
31
+ ...
32
+
33
+ task setup: :environment do
34
+ ...
35
+ end
36
+
37
+ desc 'Deploys the current version to the server.'
38
+ task deploy: :environment do
39
+ ...
40
+ end
41
+ ```
42
+
43
+
44
+ Update deploy task:
45
+
46
+ ```rb
47
+ # config/deploy.rb
48
+
49
+ desc 'Deploys the current version to the server.'
50
+ task deploy: :environment do
51
+ ...
52
+ # remove this line
53
+ # invoke :'rails:db_migrate'
54
+
55
+ # add new task
56
+ invoke :'rails:db_data_migrate'...
57
+ ...
58
+ end
59
+ ```
60
+
61
+ ## Configuration
62
+
63
+ * `data_migration_dirs` - array of dirs with data migrations (['db/data'] by default)
64
+
65
+
66
+ If you want to override the default values for any of these options, they should be set before requiring `mina/multistage`.
67
+
68
+
69
+
70
+
71
+ ## Contributing
72
+
73
+ 1. Fork it
74
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
75
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
76
+ 4. Push to the branch (`git push origin my-new-feature`)
77
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,5 @@
1
+ module Mina
2
+ module DataMigrate
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,20 @@
1
+
2
+ set :data_migration_dirs, ['db/data']
3
+
4
+ namespace :rails do
5
+ desc 'Migrate database'
6
+ task :db_data_migrate do
7
+ ensure!(:deploy_block, message: "Can't be run outside deploy do block. Please use mina 'rake[db_data_migrate]' instead")
8
+ if fetch(:force_migrate)
9
+ comment %(Migrating database with data)
10
+ command %(#{fetch(:rake)} db:migrate:with_data)
11
+ else
12
+ command check_for_changes_script(
13
+ at: fetch(:migration_dirs) + fetch(:data_migration_dirs),
14
+ skip: %(echo "-----> DB/data migrations unchanged; skipping migration"),
15
+ changed: %(echo "-----> Migrating database with data"
16
+ #{echo_cmd("#{fetch(:rake)} db:migrate:with_data")})
17
+ ), quiet: true
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'mina/data_migrate/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "mina-data-migrate"
8
+ spec.version = Mina::DataMigrate::VERSION
9
+ spec.authors = ["Vladimir Elchinov"]
10
+ spec.email = ["elik@elik.ru"]
11
+ spec.description = %q{Adds data migrations support to Mina}
12
+ spec.summary = %q{Adds data migrations support to Mina}
13
+ spec.homepage = "https://github.com/railsblueprint/mina-data-migrate/"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "mina", "~> 1.0"
22
+ spec.add_development_dependency "bundler", ">= 1.3.5"
23
+ spec.add_development_dependency "rake"
24
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mina-data-migrate
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Vladimir Elchinov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-09-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mina
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.5
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.3.5
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Adds data migrations support to Mina
56
+ email:
57
+ - elik@elik.ru
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/mina/data_migrate.rb
68
+ - lib/mina/data_migrate/version.rb
69
+ - mina_data_migrate.gemspec
70
+ homepage: https://github.com/railsblueprint/mina-data-migrate/
71
+ licenses:
72
+ - MIT
73
+ metadata: {}
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubygems_version: 3.0.3
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Adds data migrations support to Mina
93
+ test_files: []