capistrano-tweaks 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 903085046951b2e3ec656015b6f35f528e684f9b
4
+ data.tar.gz: 5fac84b89a3156179b9e1ecb38b599b4e24287d4
5
+ SHA512:
6
+ metadata.gz: 05edd447cd2b45d3a7d7239781607dd33bb3f34c222565c7d6ae4fade1ebbdee8ac3cee57a60e0c0f9e63fdd533cd2b1c4c383672cfbe3d0bc85496faf162eae
7
+ data.tar.gz: c3626301f05bf7f0a86d5c531c920f37f8a6e40afd3b3e147a7b981cd3e2fffbbd62a08d5838b10c4b3a6b31f0d086fb351b29ee8ee7ba46d684270d0bf34634
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .idea
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Yaroslav Konoplov
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ ## Tweaks for Capistrano 3.x
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/capistrano-tweaks.svg)](https://badge.fury.io/rb/capistrano-tweaks)
4
+
5
+ ## Features
6
+ Tasks:
7
+ * `rails:console`
8
+
9
+ Utils:
10
+ * `execute_interactively`
11
+ * `expand_home_dir`
12
+
13
+ ## Installing gem
14
+ Add to your Gemfile:
15
+ ```ruby
16
+ gem 'capistrano-tweaks', '~> 1.0', require: false
17
+ ```
18
+
19
+ Require gem in your Capfile:
20
+ ```ruby
21
+ require 'capistrano/tweaks'
22
+ ```
@@ -0,0 +1,19 @@
1
+ # encoding: UTF-8
2
+ # frozen_string_literal: true
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'capistrano-tweaks'
6
+ s.version = '1.0.0'
7
+ s.author = 'Yaroslav Konoplov'
8
+ s.email = 'eahome00@gmail.com'
9
+ s.summary = 'Tweaks for Capistrano 3.x'
10
+ s.description = 'Tweaks for Capistrano 3.x'
11
+ s.homepage = 'https://github.com/yivo/capistrano-tweaks'
12
+ s.license = 'MIT'
13
+
14
+ s.files = `git ls-files -z`.split("\x0")
15
+ s.test_files = `git ls-files -z -- {test,spec,features}/*`.split("\x0")
16
+ s.require_paths = ['lib']
17
+
18
+ s.add_dependency 'capistrano', '~> 3.1'
19
+ end
@@ -0,0 +1,27 @@
1
+ # encoding: UTF-8
2
+ # frozen_string_literal: true
3
+
4
+ def execute_interactively(command, server)
5
+ exec "ssh", "#{server.user}@#{server.hostname}", "-t", command
6
+ end
7
+
8
+ # expand_home_dir('~/dir', user: 'deploy') => /home/deploy/dir
9
+ def expand_home_dir(command, options = {})
10
+ "/home/#{options.fetch(:user)}#{command[1..-1]}"
11
+ end
12
+
13
+ namespace :rails do
14
+ desc 'Remote application console'
15
+ task console: ['deploy:set_rails_env'] do
16
+ on release_roles(:app) do
17
+ within release_path do
18
+ with rails_env: fetch(:rails_env) do
19
+ execute_interactively command([:rails, 'console'], {}).to_command, @host
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ set :rvm_map_bins, fetch(:rvm_map_bins, []) + %w( rails )
27
+ set :rbenv_map_bins, fetch(:rbenv_map_bins, []) + %w( rails )
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-tweaks
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Yaroslav Konoplov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ description: Tweaks for Capistrano 3.x
28
+ email: eahome00@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - ".gitignore"
34
+ - LICENSE.txt
35
+ - README.md
36
+ - capistrano-tweaks.gemspec
37
+ - lib/capistrano/tweaks.rb
38
+ homepage: https://github.com/yivo/capistrano-tweaks
39
+ licenses:
40
+ - MIT
41
+ metadata: {}
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 2.6.8
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: Tweaks for Capistrano 3.x
62
+ test_files: []