after_party 1.10.0 → 1.11.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
- SHA1:
3
- metadata.gz: 01b1c179be9d5aed7883090886691ce229647a0f
4
- data.tar.gz: 3c77c460fdc5d94bf5216f67445e4ac1a58998e1
2
+ SHA256:
3
+ metadata.gz: 499bec9b25043b809f47e94020cebd5e73c86c90e2c4f7a98e3128dd75e2c571
4
+ data.tar.gz: d773680e03e580566d29bb1541f60ff249adf54f2e4894ab07fb34eeae27bdf6
5
5
  SHA512:
6
- metadata.gz: f64498a060f7f5c62a3a27efff821e19446fd51ec5933a0c4fb30f0b48208eac5fa3fda4a09bc3336d75b87405b801a9bd6f7ffc1026f1fc38a862278251b29e
7
- data.tar.gz: d7767f2746547645481bf38527cc6c5d5c90b087ba5fd890a7ede599bafdf54ffe60bde6a3c5aedce7e058199a68731fb07656556e923c5412e17322357332f3
6
+ metadata.gz: e63108fb11f9c2e2cd1bb75f6f9af388f9e51be8d868997459c24a5c2a953d0d1c8561c06e939a5be17e7a15c54613709d8d8a28846df859a3c4f72f0434283f
7
+ data.tar.gz: ca4d23a646bd5064a99552016569699cbe9f626691996c21915954dd2d49079f4d4002f782351aa263594894103305566d43cfa3008ac5bf3e8d53fba76f98ae
@@ -3,6 +3,7 @@ module AfterParty
3
3
  if ::Rails::VERSION::MAJOR.to_i == 3
4
4
  attr_accessible :version
5
5
  end
6
+
6
7
  def self.completed_task?(version)
7
8
  all.any?{|t| t.version == version}
8
9
  end
@@ -13,10 +13,18 @@ module AfterParty
13
13
 
14
14
  def copy_migration
15
15
  if requires_migration?
16
- template "migration.rb", "db/migrate/#{timestamp}_create_#{table_name}.rb"
16
+ if requires_version_tag?
17
+ template "migration.txt.erb", "db/migrate/#{timestamp}_create_#{table_name}.rb"
18
+ else
19
+ template "migration-rails-3-4.txt.erb", "db/migrate/#{timestamp}_create_#{table_name}.rb"
20
+ end
17
21
  end
18
22
  end
19
23
 
24
+ def requires_version_tag?
25
+ ActiveRecord::VERSION::MAJOR >= 5
26
+ end
27
+
20
28
  private
21
29
  def timestamp
22
30
  @timestamp ||= Time.now.utc.strftime("%Y%m%d%H%M%S")
@@ -28,6 +36,10 @@ module AfterParty
28
36
  Dir.glob("#{absolute}/[0-9]*_create_#{table_name}.rb").first
29
37
  end
30
38
 
39
+ def rails_version_for_migration
40
+ "#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"
41
+ end
42
+
31
43
  def requires_migration?
32
44
  orm_name == "active_record" && !migration_exists?
33
45
  end
@@ -4,4 +4,6 @@ AfterParty.setup do |config|
4
4
  # :mongoid (bson_ext recommended) by default. Other ORMs may be
5
5
  # available as additional gems.
6
6
  require "after_party/<%= orm_name %>.rb"
7
+
8
+
7
9
  end
@@ -0,0 +1,7 @@
1
+ class CreateTaskRecords < ActiveRecord::Migration[<%=rails_version_for_migration%>]
2
+ def change
3
+ create_table :<%= table_name %>, :id => false do |t|
4
+ t.string :version, :null => false
5
+ end
6
+ end
7
+ end
@@ -8,5 +8,5 @@ namespace :after_party do
8
8
  # Update task as completed. If you remove the line below, the task will
9
9
  # run with every deploy (or every time you call after_party:run).
10
10
  AfterParty::TaskRecord.create version: '<%= timestamp %>'
11
- end # task :<%= file_name %>
12
- end # namespace :after_party
11
+ end # task :<%= file_name %>
12
+ end # namespace :after_party
@@ -13,7 +13,7 @@ namespace :after_party do
13
13
 
14
14
  desc "Check the status of after_party deployment tasks"
15
15
  task :status => :environment do
16
- tasks = Dir[AfterParty::TaskRecorder::FILE_MASK].collect do |filename|
16
+ tasks = Dir[AfterParty::TaskRecorder::FILE_MASK].sort.collect do |filename|
17
17
  recorder = AfterParty::TaskRecorder.new(filename)
18
18
  {
19
19
  version: recorder.timestamp,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: after_party
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Mitchell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-05 00:00:00.000000000 Z
11
+ date: 2019-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: factory_girl_rails
84
+ name: factory_bot
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: sqlite3
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.3.6
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: 1.3.6
111
111
  description: Automated post-deploy tasks for Ruby/Rails. Your deployment is the party.
112
112
  This is the after party
113
113
  email: thestevemitchell@gmail.com
@@ -125,7 +125,8 @@ files:
125
125
  - lib/generators/install/USAGE
126
126
  - lib/generators/install/install_generator.rb
127
127
  - lib/generators/install/templates/after_party.rb
128
- - lib/generators/install/templates/migration.rb
128
+ - lib/generators/install/templates/migration-rails-3-4.txt.erb
129
+ - lib/generators/install/templates/migration.txt.erb
129
130
  - lib/generators/task/USAGE
130
131
  - lib/generators/task/task_generator.rb
131
132
  - lib/generators/task/templates/deploy.txt.erb
@@ -150,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
151
  version: '0'
151
152
  requirements: []
152
153
  rubyforge_project:
153
- rubygems_version: 2.4.8
154
+ rubygems_version: 2.7.8
154
155
  signing_key:
155
156
  specification_version: 4
156
157
  summary: A rails engine that manages deploy tasks and versions using activeRecord