after_party 1.11.2 → 2.0.0

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: 7657bba3849b325107caef491606b9fdf9c1ed27eb457091dab2ccb04ef956c6
4
- data.tar.gz: 78fcbb1352e173192a2dff5d5ffede332ee1587083b653fdda02c8dcd1becb30
3
+ metadata.gz: e57f0e1f1e66fd351666b2af8821091b35f73c9d34281e59816cc9094cbe590d
4
+ data.tar.gz: 37ec5d9c41df200d1f86e4395d9ca8dedfc4ac14bc70aaeb7abc114ae3b6b3da
5
5
  SHA512:
6
- metadata.gz: 768ce9b023b2512ebe5f548cf1f60f6c2d283702587a2fa32a1724311e452642e5b2ae45bde7359741bf878b7261123a375dbdfd2b434aff0afe6c493a2b9856
7
- data.tar.gz: 5b6b8d921c951248f9839d4fdf2b9f96bb6392b440735e2b3a492357b99d351d938f6f16c49bcb9ef4126ab77b5f4fab4c9800bd72b31b8728fd3c058ddb7223
6
+ metadata.gz: d23202ce6cb9edaa8b1312da9fd8a6ef64badc12990fc7df90dfded2c8634ef39be4bc59ac390638a750a9a771193f7039d8f09990235e2f1e48934fa14bda40
7
+ data.tar.gz: 708f8b4b14796914e777cda1ad5aa973a17998ea850e1e52017ea412a54fc9d08018c4a0d38a54e8c1a394a6bcc88a4f8741a7309664c69567d6878ccdc675a8
@@ -1 +1,3 @@
1
- require 'after_party/models/active_record/task_record.rb'
1
+ # frozen_string_literal: true
2
+
3
+ require 'after_party/models/active_record/task_record'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AfterParty
2
4
  # Task Record is a persisted object recorded when a taks is run.
3
5
  class TaskRecord < ActiveRecord::Base
@@ -7,4 +9,4 @@ module AfterParty
7
9
  all.any? { |t| t.version == version }
8
10
  end
9
11
  end
10
- end
12
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AfterParty
2
4
  # Task Record is a persisted object recorded when a taks is run.
3
5
  class TaskRecord
@@ -10,4 +12,4 @@ module AfterParty
10
12
  all.any? { |t| t.version == version }
11
13
  end
12
14
  end
13
- end
15
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AfterParty
2
4
  # Task Recorder is responsible for collecting pending tasks and recording their execution
3
5
  class TaskRecorder
@@ -8,8 +10,8 @@ module AfterParty
8
10
 
9
11
  def self.pending_files
10
12
  Dir[FILE_MASK].collect { |f| TaskRecorder.new(f) }
11
- .select(&:pending?)
12
- .sort_by(&:timestamp)
13
+ .select(&:pending?)
14
+ .sort_by(&:timestamp)
13
15
  end
14
16
 
15
17
  def initialize(filename = '')
@@ -28,4 +30,4 @@ module AfterParty
28
30
  end
29
31
  end
30
32
  end
31
- end
33
+ end
@@ -1 +1,3 @@
1
- require 'after_party/models/mongoid/task_record.rb'
1
+ # frozen_string_literal: true
2
+
3
+ require 'after_party/models/mongoid/task_record'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'after_party'
2
4
  require 'rails'
3
5
  module AfterParty
@@ -16,4 +18,4 @@ module AfterParty
16
18
  load 'generators/install/install_generator.rb'
17
19
  end
18
20
  end
19
- end
21
+ end
data/lib/after_party.rb CHANGED
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # AfterParty is a moduke defined by gem after_party
2
4
  module AfterParty
3
- require 'after_party/railtie.rb' if defined?(Rails)
5
+ require 'after_party/railtie' if defined?(Rails)
4
6
 
5
7
  def self.setup
6
8
  yield self
7
9
  end
8
- end
10
+ end
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators'
2
4
 
3
5
  module AfterParty
4
6
  module Generators
5
7
  # Generates the after_party.rb in config/initializers and a migration file
6
8
  class InstallGenerator < Rails::Generators::Base
7
- source_root File.expand_path('../templates', __FILE__)
8
- argument :orm_name, :type => :string, :default => 'active_record'
9
+ source_root File.expand_path('templates', __dir__)
10
+ argument :orm_name, type: :string, default: 'active_record'
9
11
 
10
12
  def create_initializer_file
11
13
  template 'after_party.txt.erb', 'config/initializers/after_party.rb'
@@ -50,4 +52,4 @@ module AfterParty
50
52
  end
51
53
  end
52
54
  end
53
- end
55
+ end
@@ -1,10 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'date'
2
4
 
3
5
  module AfterParty
4
6
  module Generators
5
7
  # creates after_party tasks
6
8
  class TaskGenerator < Rails::Generators::Base
7
- source_root(File.expand_path('../templates', __FILE__))
9
+ FILE_MASK = File.join(Rails.root, 'lib/tasks/deployment/*.rake')
10
+ source_root(File.expand_path('templates', __dir__))
8
11
  argument(:name, type: :string)
9
12
  class_option(
10
13
  :description,
@@ -13,10 +16,15 @@ module AfterParty
13
16
  )
14
17
 
15
18
  def copy_deploy_task
16
- template(
17
- 'deploy.txt.erb',
18
- "lib/tasks/deployment/#{timestamp}_#{file_name}.rake"
19
- )
19
+ file_names = Dir[FILE_MASK].collect { |f| AfterParty::TaskRecorder.new(f) }.map { |f| f.task_name.to_s }
20
+ if file_names.include?(file_name)
21
+ puts 'Error: Please Create a unique task name'
22
+ else
23
+ template(
24
+ 'deploy.txt.erb',
25
+ "lib/tasks/deployment/#{timestamp}_#{file_name}.rake"
26
+ )
27
+ end
20
28
  end
21
29
 
22
30
  private
@@ -37,4 +45,4 @@ module AfterParty
37
45
  end
38
46
  end
39
47
  end
40
- end
48
+ end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :after_party do
2
4
  desc 'runs (in order) all pending after_party deployment tasks, if they have not run yet against the current db.'
3
- task :run => :environment do
5
+ task run: :environment do
4
6
  tasks = AfterParty::TaskRecorder.pending_files.map { |f| "after_party:#{f.task_name}" }
5
7
 
6
8
  tasks.each { |t| Rake::Task[t].invoke }
@@ -9,8 +11,8 @@ namespace :after_party do
9
11
  end
10
12
 
11
13
  desc 'Check the status of after_party deployment tasks'
12
- task :status => :environment do
13
- tasks = Dir[AfterParty::TaskRecorder::FILE_MASK].sort.collect do |filename|
14
+ task status: :environment do
15
+ tasks = Dir[AfterParty::TaskRecorder::FILE_MASK].collect do |filename|
14
16
  recorder = AfterParty::TaskRecorder.new(filename)
15
17
  {
16
18
  version: recorder.timestamp,
@@ -19,9 +21,9 @@ namespace :after_party do
19
21
  }
20
22
  end
21
23
 
22
- puts <<-TABLE
23
- Status Task ID Task Name
24
- --------------------------------------------------
24
+ puts <<~TABLE
25
+ Status Task ID Task Name
26
+ --------------------------------------------------
25
27
  TABLE
26
28
  tasks.each do |task|
27
29
  puts " #{task[:status]} #{task[:version]} #{task[:task_name].capitalize}"
data/lib/version.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Version
4
+ VERSION = '2.0.0'
5
+ end
metadata CHANGED
@@ -1,127 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: after_party
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Mitchell
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-25 00:00:00.000000000 Z
11
+ date: 2024-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: factory_bot
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '6'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: generator_spec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mongoid
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '7'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '7'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec
70
+ name: pg
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec-rails
84
+ name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.4'
89
+ version: '3'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.4'
96
+ version: '3'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop
98
+ name: rspec-rails
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '5'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '5'
111
111
  - !ruby/object:Gem::Dependency
112
- name: sqlite3
112
+ name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.3.6
117
+ version: '1'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.3.6
124
+ version: '1'
125
125
  description: Automated post-deploy tasks for Ruby/Rails. Your deployment is the party.
126
126
  This is the after party
127
127
  email: thestevemitchell@gmail.com
@@ -145,27 +145,29 @@ files:
145
145
  - lib/generators/task/task_generator.rb
146
146
  - lib/generators/task/templates/deploy.txt.erb
147
147
  - lib/tasks/deploy_task_runner.rake
148
+ - lib/version.rb
148
149
  homepage: http://github.com/theSteveMitchell/after_party
149
150
  licenses:
150
151
  - MIT
151
- metadata: {}
152
- post_install_message:
152
+ metadata:
153
+ rubygems_mfa_required: 'true'
154
+ post_install_message:
153
155
  rdoc_options: []
154
156
  require_paths:
155
157
  - lib
156
158
  required_ruby_version: !ruby/object:Gem::Requirement
157
159
  requirements:
158
- - - ">="
160
+ - - "~>"
159
161
  - !ruby/object:Gem::Version
160
- version: '0'
162
+ version: '3.0'
161
163
  required_rubygems_version: !ruby/object:Gem::Requirement
162
164
  requirements:
163
165
  - - ">="
164
166
  - !ruby/object:Gem::Version
165
167
  version: '0'
166
168
  requirements: []
167
- rubygems_version: 3.0.1
168
- signing_key:
169
+ rubygems_version: 3.2.3
170
+ signing_key:
169
171
  specification_version: 4
170
172
  summary: A rails engine that manages deploy tasks and versions using activeRecord
171
173
  or mongoid