dekiru 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -0
- data/lib/dekiru/version.rb +1 -1
- data/lib/dekiru.rb +2 -1
- data/lib/generators/maintenance_script/maintenance_script_generator.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fac2069f365f91b45b8d73c28d5edc43019c77bc759a67be20587d34ba69cd6
|
4
|
+
data.tar.gz: 445b58a763dbd2d19615126e369074a83c31129495a444b46ba659147474c5eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5415cd694554c1d4f025b8a800ca948ad9ae57dac8ffe7eaa1b49ee2ff6199d2cbc07d1692a9a7c224f92873b2390a0a467de8d5c26e0a40777490c1dcdaf4ce
|
7
|
+
data.tar.gz: 0d69944fdc7f5f09dc08921be3e92eb05929feb8b319eae20c089c7d4344b584857ce24bded17d7173065eb7fc746188c9abb72af15fbf15e20f0e1ad7147a58
|
data/README.md
CHANGED
@@ -182,6 +182,25 @@ Deliverd Mailers!!
|
|
182
182
|
Are you sure to commit? (yes/no) > yes
|
183
183
|
```
|
184
184
|
|
185
|
+
ジェネレータを使って `Dekiru::DataMigrationOperator` を使ったメンテナンススクリプトを生成することができます。ファイル名にはスクリプトファイルを生成した日付が prefix として付与されます。
|
186
|
+
|
187
|
+
```
|
188
|
+
$ bin/rails g maintenance_script demo_migration
|
189
|
+
$ cat scripts/20230118_demo_migration.rb
|
190
|
+
Dekiru::DataMigrationOperator.execute('demo_migration') do
|
191
|
+
# write here
|
192
|
+
end
|
193
|
+
```
|
194
|
+
|
195
|
+
ファイルの出力先ディレクトリは、デフォルトではアプリケーションルート直下の `scripts` ディレクトリです。設定で出力先ディレクトリを変更することもできます。
|
196
|
+
|
197
|
+
```ruby
|
198
|
+
# config/initializer/dekiru.rb
|
199
|
+
Dekiru.configure do |config|
|
200
|
+
config.maintenance_script_directory = 'scripts/maintenance'
|
201
|
+
end
|
202
|
+
```
|
203
|
+
|
185
204
|
## Refinements
|
186
205
|
|
187
206
|
### Dekiru::CamelizeHash
|
data/lib/dekiru/version.rb
CHANGED
data/lib/dekiru.rb
CHANGED
@@ -21,10 +21,11 @@ module Dekiru
|
|
21
21
|
end
|
22
22
|
|
23
23
|
class Configuration
|
24
|
-
attr_accessor :mail_security_hook
|
24
|
+
attr_accessor :mail_security_hook, :maintenance_script_directory
|
25
25
|
|
26
26
|
def initialize
|
27
27
|
@mail_security_hook = false # default
|
28
|
+
@maintenance_script_directory = 'scripts'
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
@@ -4,7 +4,8 @@ class MaintenanceScriptGenerator < Rails::Generators::NamedBase
|
|
4
4
|
source_root File.expand_path('templates', __dir__)
|
5
5
|
|
6
6
|
def copy_maintenance_script_file
|
7
|
-
template 'maintenance_script.rb.erb',
|
7
|
+
template 'maintenance_script.rb.erb',
|
8
|
+
"#{Dekiru.configuration.maintenance_script_directory}/#{filename_date}_#{file_name}.rb"
|
8
9
|
end
|
9
10
|
|
10
11
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dekiru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akihiro Matsumura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http_accept_language
|