mina-infinum 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: ace11a7f3b5f8331db5cccf9e1ea8cb253c5c5a6
4
- data.tar.gz: bb81b69be0a3cfe99fca99ab967a125ae9a09989
3
+ metadata.gz: 487a801e93aad9760392da5d47f636d5516b7558
4
+ data.tar.gz: 192045df7f2206f02bf0c32cc6c90b4da1e0aab5
5
5
  SHA512:
6
- metadata.gz: f0884837e14f4fdd3b6c175609afb51302827ef9db0f92e9d3470c49fe396f7a625b1bfe2bb5214a191dd67427bd67d6768bb7ba3b3213fb763259199ac3e5ae
7
- data.tar.gz: 4e32c9887133e4c5312453983089d49b202e4bc14ab738fea20e9e5644515fccf4f3bcbda857cedd07393f27dba609cd0eff5bdf4160ba2a3cb62ba6ca533516
6
+ metadata.gz: 4cb211d0ab294636ed25a1e7df6c002df021264b94b1afa55d008f80d3cf23ab9b4b1dde2424a6d232f6e86d18e13bd55110cea349985edce1d9295e4bcbfd00
7
+ data.tar.gz: bef075b2c781a5b0c6c4ffbc07399b9cbafc2d24f501416cf1f11aa1de9aff9a243166a091c1876ff70418b1408ce774e6206f54359b970d87b7f84355de6e6e
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Mina::Infinum
2
2
 
3
+ For `mina 0.3.0` please take a look at [v0.3.0 branch](https://github.com/infinum/mina-infinum/tree/v0.3.0)
3
4
  ## Plugins
4
5
 
5
6
  ``` ruby
@@ -11,10 +12,27 @@
11
12
 
12
13
  Removed mina-delayed_job as we are moving towards delayed_job in processes.
13
14
 
15
+ ## Setup
16
+
17
+ ``` ruby
18
+ set :application_name # Used in background workers tasks
19
+ set :background_worker # Used in background workers tasks
20
+ ```
21
+
22
+ Background workers name:
23
+
24
+ ```ruby
25
+ [fetch(:background_worker), fetch(:application_name), fetch(:rails_env)].join('-') # dj-labs-production
26
+ ```
27
+
14
28
  ## Tasks
15
29
 
16
30
  ``` ruby
17
31
  :restart_application # restart passenger
32
+ :'background_workers:restart'
33
+ :'background_workers:start'
34
+ :'background_workers:stop'
35
+ :'background_workers:status'
18
36
  ```
19
37
 
20
38
  ## Contributing
@@ -0,0 +1,10 @@
1
+ def background_worker(state)
2
+ ensure!(:background_worker)
3
+ ensure!(:application_name)
4
+ comment %(Restarting delayed job)
5
+ command %(sudo #{state} #{background_worker_name})
6
+ end
7
+
8
+ def background_worker_name
9
+ [fetch(:background_worker), fetch(:application_name), fetch(:rails_env)].join('-')
10
+ end
@@ -1,4 +1,14 @@
1
+ desc 'Restart application'
1
2
  task :restart_application do
2
- queue %(echo "-----> Restarting application")
3
- queue! %(passenger-config restart-app --ignore-app-not-running #{deploy_to})
3
+ comment %(Restarting application)
4
+ command %(passenger-config restart-app --ignore-app-not-running #{fetch(:deploy_to)})
5
+ end
6
+
7
+ namespace :background_workers do
8
+ [:restart, :start, :stop, :status].each do |state|
9
+ desc "#{state.capitalize}ing background workers"
10
+ task state do
11
+ background_worker(state)
12
+ end
13
+ end
4
14
  end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Infinum
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
data/lib/mina/infinum.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'mina/infinum/version'
2
+ require 'mina/infinum/helpers'
2
3
  require 'mina/infinum/tasks'
3
4
 
4
5
  module Mina
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-infinum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stjepan Hadjic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-18 00:00:00.000000000 Z
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -126,6 +126,7 @@ files:
126
126
  - bin/console
127
127
  - bin/setup
128
128
  - lib/mina/infinum.rb
129
+ - lib/mina/infinum/helpers.rb
129
130
  - lib/mina/infinum/tasks.rb
130
131
  - lib/mina/infinum/version.rb
131
132
  - mina-infinum.gemspec