deploy_pin 1.3.1 → 1.3.2

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: f3006ccc3913b4cc7ee0b5d68b316ffb70ecef2bbfeae27c7efec65422246cdb
4
- data.tar.gz: d055a8554b590bc039915d3a2866f23aa8541db9ffe8c2c933294f54c2013785
3
+ metadata.gz: 0133c82dd0826300585629d58af3f3e10a58b481e7c65a589a834fd0d7d79bdd
4
+ data.tar.gz: 220af2e000347c6835673f664f3413d3775cba0d3f1ccb9778cd324fcce1f08a
5
5
  SHA512:
6
- metadata.gz: 70d4054142995c62609666711a87d4d4e42783bf4631e61f3a43e3407a9cd68654de65b0925655ca416fb65e41bccd3a2246125e446f5f4d8a9cb48f70e7ffd4
7
- data.tar.gz: 654cbb997e23bf9a2cc9d8579e71646f68fd669dfd92235da2a1d15b8b3d9775b01db714ce99e79e23e6389282a907c2f9ae5b573c348bd4b0d3f43105989903
6
+ metadata.gz: 602e2f80e418e91e0d0045b5f5635c001d221217566581df4eea11b499dcd974b188b5de5adc7b37452c156f2c00d35b8238e4bc80a6d50ba2c962d48df7952f
7
+ data.tar.gz: 202f198bb6197464495d7b418a568022b2869bf8800c959ffc09310db7a7335c16bd902652cda7b5ee2a734335bb88e35722f278f84005683935b29e6a0c9651
data/README.md CHANGED
@@ -21,9 +21,14 @@ deploy_pins is exactly what you need.
21
21
 
22
22
  To generate new task template file
23
23
  ```bash
24
- rails g deploy_pin:task
24
+ rails g deploy_pin:task some_task_title
25
25
  # or
26
- rails g deploy_pin:task --parallel
26
+ rails g deploy_pin:task some_task_title --parallel
27
+ ```
28
+
29
+ Also, you can specify author
30
+ ```bash
31
+ rails g deploy_pin:task some_task_title -a author_name
27
32
  ```
28
33
 
29
34
  To list all pending tasks
@@ -40,11 +45,10 @@ rake deploy_pin:run
40
45
 
41
46
  Please define allowed groups in `config/initializers/deploy_pin.rb`
42
47
  if you want to group tasks around "allowed_group"
43
-
44
48
  ```bash
45
- rails g deploy_pin:task allowed_group
49
+ rails g deploy_pin:task task_title -g allowed_group
46
50
  # or
47
- rails g deploy_pin:task allowed_group --parallel
51
+ rails g deploy_pin:task task_title -g allowed_group --parallel
48
52
  ```
49
53
 
50
54
  To list all pending tasks
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeployPin
4
- VERSION = '1.3.1'
4
+ VERSION = '1.3.2'
5
5
  end
@@ -2,7 +2,7 @@ Description:
2
2
  Creates tasks for execution on deployment
3
3
 
4
4
  Example:
5
- rails generate deploy_pin:task
5
+ rails generate deploy_pin:task some_name_of_task -a author -g I
6
6
 
7
7
  This will create:
8
- lib/deploy_pin/task.rb
8
+ lib/deploy_pin/{task_id}_some_name_of_task.rb
@@ -2,22 +2,23 @@
2
2
 
3
3
  class DeployPin::TaskGenerator < Rails::Generators::Base
4
4
  class_option :parallel, type: :boolean
5
- argument :group, default: DeployPin.fallback_group
5
+ argument :title, required: true
6
+ class_option :group, aliases: "-g", default: DeployPin.fallback_group
7
+ class_option :author, aliases: "-a"
6
8
 
7
9
  source_root File.expand_path('templates', __dir__)
8
10
 
9
11
  desc 'This generator creates deploy_pin task at lib/deploy_pin/'
10
12
  def create_task_file
11
- raise "Not allowed 'group' argument! possible values are #{DeployPin.groups}" \
12
- unless DeployPin.groups.include?(group)
13
-
14
13
  template_file = if options[:parallel]
15
14
  'parallel_task.rb.erb'
16
15
  else
17
16
  'task.rb.erb'
18
17
  end
19
18
 
19
+ @author = options[:author] || ENV["USER"]
20
+ @group = options[:group]
20
21
  @uuid = Time.now.strftime('%Y%m%d%H%M%S')
21
- template template_file, "#{DeployPin.tasks_path}/#{@uuid}_task.rb"
22
+ template template_file, "#{DeployPin.tasks_path}/#{@uuid}_#{title}.rb"
22
23
  end
23
24
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # <%= @uuid %>:<%= group %>
4
- # task_title: super duper task
3
+ # <%= @uuid %>:<%= @group %>
4
+ # task_title: <%= @author ? "@#{@author} #{title.titleize}" : "#{title.titleize}" %>
5
5
 
6
6
  # === parallel task code goes down here ===
7
7
  10.times { DeployPin::Record.create(uuid: "hello") }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # <%= @uuid %>:<%= group %>
4
- # task_title: super duper task
3
+ # <%= @uuid %>:<%= @group %>
4
+ # task_title: <%= @author ? "@#{@author} #{title.titleize}" : "#{title.titleize}" %>
5
5
 
6
6
  # === task code goes down here ===
7
7
  progressbar = ProgressBar.create(title: "Doing stuff", total: 20, format: '%t |%E | %B | %a')
@@ -12,4 +12,4 @@ progressbar = ProgressBar.create(title: "Doing stuff", total: 20, format: '%t |%
12
12
  # ActiveRecord::Base.connection.execute("select * from shipments;")
13
13
  # or
14
14
  # Shipment.all
15
- # end
15
+ # end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploy_pin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viktor Sych
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-09 00:00:00.000000000 Z
11
+ date: 2022-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize