oneshot_task_generator 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
  SHA256:
3
- metadata.gz: '0949a50a2b28085c2484021b65c336d62b23009cbe6684fb2a493049d12632fa'
4
- data.tar.gz: a0233a2086f30d2fc1ce7920be4310003e2f52440ee0ba4c25f9da577ea4aae2
3
+ metadata.gz: b393ef99f9825283ca63b0d15cb43a01aa6a0f1c518fe5d17b6e1594c4b36b4d
4
+ data.tar.gz: b44d56f64fa40d48d674613e11fb8f8fde9962603d7df2f4e621e5eb46682921
5
5
  SHA512:
6
- metadata.gz: 8399849ac3eed46c05b95097127d0b08d0f5494681261466116b0bbbbacacb842835dfb142d906cdb6fed06abe6149ad8dec0c5b01899149145f8b6da35658f2
7
- data.tar.gz: dbb0c1473312f8317262dfac53fd9cc8374414620f0cf35bcfa6b6d4d8aaed08b687764ef8ef1384e9ad2a47d47a137663e8720b41a99c8d8cffe73ac94ecaf7
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
- template 'oneshot.rake.erb', "lib/tasks/oneshot/#{timestamp}_#{name.underscore}.rake"
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
 
@@ -1,3 +1,3 @@
1
1
  module OneshotTaskGenerator
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
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
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-03-11 00:00:00.000000000 Z
11
+ date: 2020-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails