oneshot_task_generator 0.1.2 → 0.1.3

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: 77a634e8444405323934760399fe072d64e7f9fc0e05cf6a9c717f9269b0117e
4
- data.tar.gz: 442f8c42afacc362fbb00a1034ffda2d0e1539e03ad0ac9675b9be88bb45cdb0
3
+ metadata.gz: b35743f117a7ab221abb9342c3259e5d73b9e53aa4de7956e3117350724ab187
4
+ data.tar.gz: 69a8cf94f8388777bf198fd96a7d08d291aeecdbb8e13980a3bd8c517a28c839
5
5
  SHA512:
6
- metadata.gz: eacee25b9c18394f02a6e8531e153666e9e89e4fd0a22188b2a6f4897d20efbe4a83a1428f97a3366a385f3be69dd146179c756295897499c89e7cf6e3940790
7
- data.tar.gz: 70fc7975103055903d8f688f48d8c0a536beae4638b704a8a352972f754b5b38f1d65656d541bb3392279922c57032d2e4c3d585e6d2873fa0bec78bdf959805
6
+ metadata.gz: 7e5a3c54e9bc6d7d8dade7ad1a2aa4546b76fb2fa4aa44c8149a9dd2a1432925b7170de6d729fa8cbf54153e9c5cf0d71158768d5aeed55fbd61e8589d44859c
7
+ data.tar.gz: 7a4a8921412ff677f61740be661098133943e7e9ed0d16c23d537f7296af7dd2b1b1d0ea340fa8f21822e27276b40be1c7c86bd7e30328ab3b0a5303a2aefcc1
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.1
4
+ - 2.4.4
5
5
  before_install: gem install bundler -v 2.0.1
data/README.md CHANGED
@@ -64,6 +64,25 @@ namespace :oneshot do
64
64
  end
65
65
  ```
66
66
 
67
+ ### Arguments
68
+
69
+ ```ruby
70
+ # config/initializers/ohesnot_task_generator.rb
71
+ OneshotGenerator.configure do |config|
72
+ config.arguments = ['task', 'args']
73
+ end
74
+ ```
75
+
76
+ ```ruby
77
+ # Skeleton for this file was generated by `bin/rails generate oneshot FooBar`
78
+ # For copy and paste: `bin/rake oneshot:foo_bar_20180208`
79
+ namespace :oneshot do
80
+ desc ''
81
+ task foo_bar_20180208: :environment do |task, args|
82
+ end
83
+ end
84
+ ```
85
+
67
86
  ## Contributing
68
87
 
69
88
  Bug reports and pull requests are welcome on GitHub at https://github.com/s-osa/oneshot_task_generator.
@@ -1,10 +1,6 @@
1
1
  class OneshotGenerator < Rails::Generators::NamedBase
2
2
  class Configuration
3
- attr_accessor :body
4
-
5
- def initialize
6
- @body = nil
7
- end
3
+ attr_accessor :body, :arguments
8
4
  end
9
5
  end
10
6
 
@@ -4,7 +4,7 @@
4
4
  <%= "# For copy and paste: `bin/rake oneshot:#{task_name}`" %>
5
5
  namespace :oneshot do
6
6
  desc ''
7
- task <%= task_name %>: :environment do
7
+ task <%= task_name %>: :environment do<%= configuration.arguments && " |#{configuration.arguments.join(", ")}|" %>
8
8
  <%- if configuration.body -%>
9
9
  <%- configuration.body.each_line.map(&:chomp).each do |line| -%>
10
10
  <%= line %>
@@ -1,3 +1,3 @@
1
1
  module OneshotTaskGenerator
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OSA Shunsuke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails