oneshot_task_generator 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b393ef99f9825283ca63b0d15cb43a01aa6a0f1c518fe5d17b6e1594c4b36b4d
|
4
|
+
data.tar.gz: b44d56f64fa40d48d674613e11fb8f8fde9962603d7df2f4e621e5eb46682921
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb13466ee0ea04f03fe02a75b91e56340bf295608d9332bd007c1864e64d149b058c5166d9fdc3c54be35f71f0ca9e1bd605d0af9d050ecd0fd638ab65261b02
|
7
|
+
data.tar.gz: db3788162691507b0e8d85cac7c002e01b809b05aea1c530304aeabd013bfc507bc0ed7857817ea914b1ea35eeee24b7e734000965daf4b1e33b5d8fbe36a029
|
data/README.md
CHANGED
@@ -83,6 +83,15 @@ namespace :oneshot do
|
|
83
83
|
end
|
84
84
|
```
|
85
85
|
|
86
|
+
### Directory
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
# config/initializers/oneshot_task_generator.rb
|
90
|
+
OneshotGenerator.configure do |config|
|
91
|
+
config.directory = 'your/favorite/directory' # Default: lib/tasks/oneshot
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
86
95
|
## Contributing
|
87
96
|
|
88
97
|
Bug reports and pull requests are welcome on GitHub at https://github.com/s-osa/oneshot_task_generator.
|
@@ -15,6 +15,7 @@ class OneshotGenerator < Rails::Generators::NamedBase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def create_file_with_template
|
18
|
-
|
18
|
+
path = File.join(@configuration.directory, "#{timestamp}_#{name.underscore}.rake")
|
19
|
+
template 'oneshot.rake.erb', path
|
19
20
|
end
|
20
21
|
end
|
@@ -1,6 +1,16 @@
|
|
1
1
|
class OneshotGenerator < Rails::Generators::NamedBase
|
2
2
|
class Configuration
|
3
|
+
DEFAULT_DIRECTORY = 'lib/tasks/oneshot'.freeze
|
4
|
+
|
3
5
|
attr_accessor :body, :arguments
|
6
|
+
|
7
|
+
def directory
|
8
|
+
@directory || DEFAULT_DIRECTORY
|
9
|
+
end
|
10
|
+
|
11
|
+
def directory=(dir)
|
12
|
+
@directory = dir
|
13
|
+
end
|
4
14
|
end
|
5
15
|
end
|
6
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oneshot_task_generator
|
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
|
- OSA Shunsuke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|