oneshot_task_generator 0.0.1

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
+ SHA1:
3
+ metadata.gz: 2d95571491a35232bc1229f5fc8c38b82b45efd0
4
+ data.tar.gz: 41ce05fcd9b90173dbe785656aa8c36e60cbccaa
5
+ SHA512:
6
+ metadata.gz: d552062163765c421d0174d108c13aecdac11e9dbae8673db3da100f9c857fb34e5d4ab526eab2a1eae28c22738086fc252ef313069c643671c8f34a19ea163e
7
+ data.tar.gz: '095751893072868ef0119e10eccdba49c34a6a1b4cc64f0d1e79a815de7a8010895d960449e794ec97c0727e68dcf7eb0df82df9244585606d0054680cc0196d'
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.1
5
+ before_install: gem install bundler -v 1.16.0
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in oneshot_generator.gemspec
6
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 OSA Shunsuke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ [![Build Status](https://travis-ci.org/s-osa/oneshot_task_generator.svg?branch=master)](https://travis-ci.org/s-osa/oneshot_task_generator)
2
+
3
+ # OneshotTaskGenerator
4
+
5
+ Simple rake task generator for oneshot tasks.
6
+
7
+ ```sh
8
+ $ bin/rake generate oneshot FooBar
9
+ create lib/tasks/oneshot/20180205_foo_bar.rake
10
+ ```
11
+
12
+ Then, skeleton file for oneshot rake task will be generated.
13
+
14
+ ```ruby
15
+ # Skeleton for this file was generated by `bin/rails generate oneshot FooBar`
16
+ # For copy and paste: `bin/rake oneshot:foo_bar_20180205`
17
+ namespace :oneshot do
18
+ desc ''
19
+ task foo_bar_20180205: :environment do
20
+ end
21
+ end
22
+ ```
23
+
24
+ ## Installation
25
+
26
+ Add this line to your application's Gemfile:
27
+
28
+ ```ruby
29
+ gem 'oneshot_generator'
30
+ ```
31
+
32
+ And then execute:
33
+
34
+ ```
35
+ $ bundle
36
+ ```
37
+
38
+ ## Contributing
39
+
40
+ Bug reports and pull requests are welcome on GitHub at https://github.com/s-osa/oneshot_task_generator.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Generate a skeleton for oneshot rake task
3
+
4
+ Example:
5
+ rails generate oneshot update_some_data
6
+
7
+ This will create:
8
+ lib/tasks/oneshot/YYYYMMDD_update_some_data.rake
@@ -0,0 +1,15 @@
1
+ class OneshotGenerator < Rails::Generators::NamedBase
2
+ source_root File.expand_path('../templates', __FILE__)
3
+
4
+ attr_reader :current, :timestamp, :task_name
5
+
6
+ def setup
7
+ @current = Time.current
8
+ @timestamp = @current.strftime('%Y%m%d')
9
+ @task_name = "#{name.underscore}_#{timestamp}"
10
+ end
11
+
12
+ def create_file_with_template
13
+ template 'oneshot.rake.erb', "lib/tasks/oneshot/#{timestamp}_#{name.underscore}.rake"
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ <%= "# Skeleton for this file was generated by `bin/rails generate oneshot #{name}`" %>
2
+ <%= "# For copy and paste: `bin/rake oneshot:#{task_name}`" %>
3
+ namespace :oneshot do
4
+ desc ''
5
+ task <%= task_name %>: :environment do
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ require 'oneshot_task_generator/version'
2
+
3
+ module OneshotTaskGenerator
4
+ end
@@ -0,0 +1,3 @@
1
+ module OneshotTaskGenerator
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,34 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'oneshot_task_generator/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'oneshot_task_generator'
7
+ spec.version = OneshotTaskGenerator::VERSION
8
+ spec.authors = ['OSA Shunsuke']
9
+ spec.email = ['hhelibebcnofnenamg@gmail.com']
10
+
11
+ spec.summary = %q{Generator for oneshot rake task}
12
+ spec.homepage = 'https://github.com/s-osa/oneshot_task_generator'
13
+
14
+ if spec.respond_to?(:metadata)
15
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
16
+ else
17
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
18
+ end
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ f.match(%r{^(test|spec|features)/})
22
+ end
23
+ spec.bindir = 'exe'
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ['lib']
26
+
27
+ spec.add_runtime_dependency 'rails', '>= 3.0.0'
28
+
29
+ spec.add_development_dependency 'ammeter'
30
+ spec.add_development_dependency 'bundler', '~> 1.16'
31
+ spec.add_development_dependency 'rake', '~> 10.0'
32
+ spec.add_development_dependency 'rspec', '~> 3.0'
33
+ spec.add_development_dependency 'sqlite3'
34
+ end
metadata ADDED
@@ -0,0 +1,141 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: oneshot_task_generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - OSA Shunsuke
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-02-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: ammeter
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.16'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.16'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sqlite3
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description:
98
+ email:
99
+ - hhelibebcnofnenamg@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".travis.yml"
107
+ - Gemfile
108
+ - LICENSE
109
+ - README.md
110
+ - Rakefile
111
+ - lib/generators/oneshot/USAGE
112
+ - lib/generators/oneshot/oneshot_generator.rb
113
+ - lib/generators/oneshot/templates/oneshot.rake.erb
114
+ - lib/oneshot_task_generator.rb
115
+ - lib/oneshot_task_generator/version.rb
116
+ - oneshot_task_generator.gemspec
117
+ homepage: https://github.com/s-osa/oneshot_task_generator
118
+ licenses: []
119
+ metadata:
120
+ allowed_push_host: https://rubygems.org
121
+ post_install_message:
122
+ rdoc_options: []
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ requirements: []
136
+ rubyforge_project:
137
+ rubygems_version: 2.6.14
138
+ signing_key:
139
+ specification_version: 4
140
+ summary: Generator for oneshot rake task
141
+ test_files: []