2d469660 by Jeff Balicki

clean up start

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent b113b825
Showing 1000 changed files with 3192 additions and 0 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_WITHOUT: "development:test"
DB_HOST=127.0.0.1
DB_NAME=commonwell_broker
DB_USER=root
DB_PASS=jeff518862
merchant_id = "376299332"
api_id = "bdE8c883e75941978540fab06b857C7B"
external_payment_client_id = "i3dgneUrHPXFyfDQWCyueNmNcI5uh441"
external_payment_client_secret = "0TtB9dgxvXZYSk7QjI8Ib15Q29Bl-wZYHjW-V1O3vrxAa$
external_payment_audience = "https://cmig-dev-payment-service.insurcloud.ca/"
external_payment = "https://api-dev03.nonprod.cmig.insurcloud.ca/payment-online$
external_payment_token = "https://insurcloud-dev.auth0.com/oauth/token"
\ No newline at end of file
This diff is collapsed. Click to expand it.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>corporate-site-2013</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
upload_max_filesize="100M"
post_max_size="100M"
memory_limit="100M"
\ No newline at end of file
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
# Customize this path to change the location of your custom tasks.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
source 'https://rubygems.org'
gem "capistrano", "~> 3.10"
gem 'capistrano-composer'
GEM
remote: https://rubygems.org/
specs:
airbrussh (1.3.0)
sshkit (>= 1.6.1, != 1.7.0)
capistrano (3.10.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-composer (0.0.6)
capistrano (>= 3.0.0.pre)
concurrent-ruby (1.0.5)
i18n (0.9.3)
concurrent-ruby (~> 1.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.2.0)
rake (12.3.0)
sshkit (1.15.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
PLATFORMS
ruby
DEPENDENCIES
capistrano (~> 3.10)
capistrano-composer
BUNDLED WITH
1.15.1
{
"require": {
"php": ">=5.4",
"symfony/var-dumper": "~2.6",
"vlucas/phpdotenv": "~1.1"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"config": {
"preferred-install": "dist"
},
"extra": {
"installer-paths": {
"wp-content/mu-plugins/{$name}/": [
"type:wordpress-muplugin"
],
"wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
],
"wp-content/themes/{$name}/": [
"type:wordpress-theme"
]
},
"wordpress-install-dir": "./"
}
}
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2b5fd6e0e1d56a6dc87df0aae3949d7d",
"packages": [
{
"name": "symfony/polyfill-mbstring",
"version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "3296adf6a6454a050679cde90f95350ad604b171"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
"reference": "3296adf6a6454a050679cde90f95350ad604b171",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2018-04-26T10:06:28+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v2.8.42",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "c7c7a988c44976c1634d2d1dad6422f5cc3de6b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c7c7a988c44976c1634d2d1dad6422f5cc3de6b3",
"reference": "c7c7a988c44976c1634d2d1dad6422f5cc3de6b3",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
},
"require-dev": {
"ext-iconv": "*",
"twig/twig": "~1.34|~2.4"
},
"suggest": {
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
"ext-symfony_debug": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"files": [
"Resources/functions/dump.php"
],
"psr-4": {
"Symfony\\Component\\VarDumper\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony mechanism for exploring and dumping PHP variables",
"homepage": "https://symfony.com",
"keywords": [
"debug",
"dump"
],
"time": "2018-06-15T06:44:46+00:00"
},
{
"name": "vlucas/phpdotenv",
"version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa",
"reference": "0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"autoload": {
"psr-0": {
"Dotenv": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD"
],
"authors": [
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "http://www.vancelucas.com"
}
],
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
"homepage": "http://github.com/vlucas/phpdotenv",
"keywords": [
"dotenv",
"env",
"environment"
],
"time": "2015-05-30T15:59:26+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.4"
},
"platform-dev": []
}
No preview for this file type
set :application, 'commonwell-web'
set :repo_url, 'git@git.gotenzing.com:commonwell/corporate-site-2013.git'
# Branch options
# Prompts for the branch name (defaults to current branch)
#ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp }
# Hardcodes branch to always be master
# This could be overridden in a stage config file
set :branch, :old_master_deploy
set :keep_releases, 2
set :deploy_to, -> { "/var/www/html/production/#{fetch(:application)}" }
# Use :debug for more verbose output when troubleshooting
set :log_level, :info
# Put all shared files/directories here (e.g. uploads that need to go on the NFS drive)
set :linked_files, fetch(:linked_files, []).push('.env', 'wordfence-waf.php')
set :linked_dirs, fetch(:linked_dirs, []).push('wp-content/wflogs','wp-content/uploads', 'wp-content/storage', 'wp-content/languages', 'wp-content/cache' , 'wp-content/wp-rocket-config')
namespace :deploy do
desc 'Sync servers'
task :sync do
on roles(:web), in: :sequence, wait: 5 do
execute("si #{fetch(:application)}")
end
end
end
namespace :deploy do
desc 'Sync servers'
task :sync_again do
on roles(:web), in: :sequence, wait: 5 do
execute("si #{fetch(:application)}")
end
end
end
namespace :deploy do
desc 'Install composer packages'
task :install_theme_packages do
on roles(:web), in: :sequence, wait: 5 do
execute "cd '#{release_path}'; /usr/bin/php72 /home/tenzing_www/bin/composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader"
end
end
end
namespace :deploy do
desc 'Install composer packages'
task :install_theme_packages do
on roles(:web), in: :sequence, wait: 5 do
execute "cd '#{release_path}/wp-content/themes/commonwell-corp'; /usr/bin/php72 /home/tenzing_www/bin/composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader"
end
end
end
# Override `git#create_release` to handle submodules
namespace :git do
desc 'Copy repo to releases'
task create_release: :'git:update' do
on roles(:all) do
with fetch(:git_environmental_variables) do
within repo_path do
execute :git, :clone, '-b', fetch(:branch), '--recursive', '.', release_path
end
end
end
end
end
# The above restart task is not run by default
# Uncomment the following line to run it on deploys if needed
# after 'deploy:publishing', 'deploy:restart'
namespace :deploy do
desc 'Remove Git Files'
task :cleanup do
on roles(:web), in: :sequence, wait: 5 do
execute "cd '#{release_path}/'; rm -Rf .git/ "
end
end
end
namespace :deploy do
desc 'set file permissions'
task :set_permissions do
on roles(:web), in: :sequence, wait: 5 do
execute "cd '#{release_path}/'; chmod -Rf 777 .htaccess wordfence-waf.php wp-content/advanced-cache.php "
end
end
end
namespace :deploy do
desc 'Update WordPress template root paths to point to the new release'
task :update_option_paths do
on roles(:app) do
within fetch(:release_path) do
if test :wp, :core, 'is-installed'
[:stylesheet_root, :template_root].each do |option|
# Only change the value if it's an absolute path
# i.e. The relative path "/themes" must remain unchanged
# Also, the option might not be set, in which case we leave it like that
value = capture :wp, :option, :get, option, raise_on_non_zero_exit: false
if value != '' && value != '/themes'
execute :wp, :option, :set, option, fetch(:release_path).join('web/wp/wp-content/themes')
end
end
end
end
end
end
end
# The above update_option_paths task is not run by default
# Note that you need to have WP-CLI installed on your server
# Uncomment the following line to run it on deploys if needed
# after 'deploy:publishing', 'deploy:update_option_paths'
after 'deploy:updated', 'deploy:install_theme_packages'
after 'deploy:updated', 'deploy:sync'
after 'deploy:updated', 'deploy:set_permissions'
after 'deploy:finished', 'deploy:sync_again'
set :stage, :production
# Simple Role Syntax
# ==================
role :web, %w{tenzing_www@web-1}
# you can set custom ssh options
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
# set it globally
# set :ssh_options, {
# keys: %w(~/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(password)
# }
fetch(:default_env).merge!(wp_env: :production)
set :application, 'commonwell-corp'
set :stage, :staging
set :branch, "new_product"
# Simple Role Syntax
# ==================
role :web, %w{tenzing_www@web-1}
# you can set custom ssh options
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
# set it globally
# set :ssh_options, {
# keys: %w(~/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(password)
# }
fetch(:default_env).merge!(wp_env: :staging)
No preview for this file type
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
This diff is collapsed. Click to expand it.
<?php
/**
* Created by PhpStorm.
* User: insu
* Date: 15-03-05
* Time: 10:06 AM
*/
require_once __DIR__ . '/../wp-config.php';
$mysqli = @new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if ($mysqli->connect_errno) {
echo "<h1>Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error . "</h1>\n";
die(1);
}
$results = $mysqli->query("show tables;");
if ($results === false or $mysqli->connect_errno) {
echo "MySQL error: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error . "\n";
die(2);
}
while ($row = $results->fetch_assoc()) {
$sql = "SHOW TABLE STATUS WHERE Name = '{$row['Tables_in_test']}'";
$thisTable = $mysqli->query($sql)->fetch_assoc();
if ($thisTable['Engine'] === 'MyISAM') {
$sql = "alter table " . $row['Tables_in_test'] . " ENGINE = InnoDB;";
echo $row['Tables_in_test'] . " is using the " . $thisTable['Engine'] . " Engine. [ Changing ]\n";
$mysqli->query($sql);
} else {
echo $row['Tables_in_test'] . ' is already using the ' . $thisTable['Engine'] . " Engine. [ Ignoring ]\n";
}
};
die(0);
\ No newline at end of file
<?php
phpinfo();
// $fields =
// array (
// 'location' =>
// array (
// 'name' => 'Location',
// 'field_name' => 'location',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'city' =>
// array (
// 'name' => 'City',
// 'field_name' => 'city',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'event_date' =>
// array (
// 'name' => 'Event Start Date',
// 'field_name' => 'event_date',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Short',
// 'custom_date_format' => '',
// ),
// ),
// 'event_date_end' =>
// array (
// 'name' => 'Event End Date (optional)',
// 'field_name' => 'event_date_end',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Short',
// 'custom_date_format' => '',
// ),
// ),
// 'time_start' =>
// array (
// 'name' => 'Start Time',
// 'field_name' => 'time_start',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'time_end' =>
// array (
// 'name' => 'End Time',
// 'field_name' => 'time_end',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'reg_open' =>
// array (
// 'name' => 'Registration Opens',
// 'field_name' => 'reg_open',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Short',
// 'custom_date_format' => '',
// ),
// ),
// 'early_bird_deadline' =>
// array (
// 'name' => 'Early Bird Deadline',
// 'field_name' => 'early_bird_deadline',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Medium',
// 'custom_date_format' => '',
// ),
// ),
// 'reg_deadline' =>
// array (
// 'name' => 'Registration Deadline',
// 'field_name' => 'reg_deadline',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Medium',
// 'custom_date_format' => '',
// ),
// ),
// 'cancel_deadline' =>
// array (
// 'name' => 'Cancellation Deadline',
// 'field_name' => 'cancel_deadline',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Medium',
// 'custom_date_format' => '',
// ),
// ),
// 'edit_deadline' =>
// array (
// 'name' => 'Edit Deadline',
// 'field_name' => 'edit_deadline',
// 'type' => 'datefield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'date_format' => 'Medium',
// 'custom_date_format' => '',
// ),
// ),
// 'cost' =>
// array (
// 'name' => 'Cost',
// 'field_name' => 'cost',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'early_bird_discount' =>
// array (
// 'name' => 'Early Bird ($) Discount ',
// 'field_name' => 'early_bird_discount',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'student_member_discount' =>
// array (
// 'name' => 'Student/Member ($) Discount',
// 'field_name' => 'student_member_discount',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'worth_cehours' =>
// array (
// 'name' => 'Worth CE Hours',
// 'field_name' => 'worth_cehours',
// 'type' => 'textfield',
// 'show_list' => 'off',
// 'extra' =>
// array (
// 'show_label' => 'yes',
// 'multiline' => 'no',
// ),
// ),
// 'is_archived_podcast' =>
// array (
// 'name' => 'Include in Archived Podcast',
// 'field_name' => 'is_archived_podcast',
// 'type' => 'checkbox',
// 'show_list' => false,
// 'extra' =>
// array (
// ),
// ),
// 'is_archived_webinar' =>
// array (
// 'name' => 'Include in Archived Webinars',
// 'field_name' => 'is_archived_webinar',
// 'type' => 'checkbox',
// 'show_list' => 'off',
// 'extra' =>
// array (
// ),
// ),
// 'event_include_on_home_page' =>
// array (
// 'name' => 'Include on Home Page',
// 'field_name' => 'event_include_on_home_page',
// 'type' => 'checkbox',
// 'show_list' => 'off',
// 'extra' =>
// array (
// ),
// ),
// );
// $new_fields = array();
// foreach($fields as $field){
// $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
// $charactersLength = strlen($characters);
// $randomString = '';
// for ($i = 0; $i < 13; $i++) {
// $randomString .= $characters[rand(0, $charactersLength - 1)];
// }
// error_log(print_r($field['name'], true));
// array_push($new_fields,
// array(
// 'key' => 'field_'.$randomString,
// 'label' => $field['name'],
// 'name' => $field['field_name'],
// 'type' => $field['type'],
// 'instructions' => '',
// 'required' => 0,
// 'conditional_logic' => 0,
// 'wrapper' =>
// (object) array(
// 'width' => '',
// 'class' => '',
// 'id' => '',
// ),
// 'default_value' => '',
// 'placeholder' => '',
// 'prepend' => '',
// 'append' => '',
// 'maxlength' => '',
// )
// );
// }
// var_dump(json_encode($new_fields));
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WordPress &#8250; ReadMe</title>
<link rel="stylesheet" href="wp-admin/css/install.css?ver=20100228" type="text/css" />
</head>
<body>
<h1 id="logo">
<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
<h2>First Things First</h2>
<p>Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I am proud to be a part of. Thousands of hours have gone into WordPress, and we are dedicated to making it better every day. Thank you for making it part of your world.</p>
<p style="text-align: right">&#8212; Matt Mullenweg</p>
<h2>Installation: Famous 5-minute install</h2>
<ol>
<li>Unzip the package in an empty directory and upload everything.</li>
<li>Open <span class="file"><a href="wp-admin/install.php">wp-admin/install.php</a></span> in your browser. It will take you through the process to set up a <code>wp-config.php</code> file with your database connection details.
<ol>
<li>If for some reason this does not work, do not worry. It may not work on all web hosts. Open up <code>wp-config-sample.php</code> with a text editor like WordPad or similar and fill in your database connection details.</li>
<li>Save the file as <code>wp-config.php</code> and upload it.</li>
<li>Open <span class="file"><a href="wp-admin/install.php">wp-admin/install.php</a></span> in your browser.</li>
</ol>
</li>
<li>Once the configuration file is set up, the installer will set up the tables needed for your site. If there is an error, double check your <code>wp-config.php</code> file, and try again. If it fails again, please go to the <a href="https://wordpress.org/support/forums/">WordPress support forums</a> with as much data as you can gather.</li>
<li><strong>If you did not enter a password, note the password given to you.</strong> If you did not provide a username, it will be <code>admin</code>.</li>
<li>The installer should then send you to the <a href="wp-login.php">login page</a>. Sign in with the username and password you chose during the installation. If a password was generated for you, you can then click on &#8220;Profile&#8221; to change the password.</li>
</ol>
<h2>Updating</h2>
<h3>Using the Automatic Updater</h3>
<ol>
<li>Open <span class="file"><a href="wp-admin/update-core.php">wp-admin/update-core.php</a></span> in your browser and follow the instructions.</li>
<li>You wanted more, perhaps? That&#8217;s it!</li>
</ol>
<h3>Updating Manually</h3>
<ol>
<li>Before you update anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</li>
<li>Delete your old WordPress files, saving ones you&#8217;ve modified.</li>
<li>Upload the new files.</li>
<li>Point your browser to <span class="file"><a href="wp-admin/upgrade.php">/wp-admin/upgrade.php</a>.</span></li>
</ol>
<h2>Migrating from other systems</h2>
<p>WordPress can <a href="https://wordpress.org/support/article/importing-content/">import from a number of systems</a>. First you need to get WordPress installed and working as described above, before using <a href="wp-admin/import.php">our import tools</a>.</p>
<h2>System Requirements</h2>
<ul>
<li><a href="https://secure.php.net/">PHP</a> version <strong>5.6.20</strong> or greater.</li>
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.0</strong> or greater.</li>
</ul>
<h3>Recommendations</h3>
<ul>
<li><a href="https://secure.php.net/">PHP</a> version <strong>7.4</strong> or greater.</li>
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.7</strong> or greater OR <a href="https://mariadb.org/">MariaDB</a> version <strong>10.2</strong> or greater.</li>
<li>The <a href="https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">mod_rewrite</a> Apache module.</li>
<li><a href="https://wordpress.org/news/2016/12/moving-toward-ssl/">HTTPS</a> support.</li>
<li>A link to <a href="https://wordpress.org/">wordpress.org</a> on your site.</li>
</ul>
<h2>Online Resources</h2>
<p>If you have any questions that are not addressed in this document, please take advantage of WordPress&#8217; numerous online resources:</p>
<dl>
<dt><a href="https://codex.wordpress.org/">The WordPress Codex</a></dt>
<dd>The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.</dd>
<dt><a href="https://wordpress.org/news/">The WordPress Blog</a></dt>
<dd>This is where you&#8217;ll find the latest updates and news related to WordPress. Recent WordPress news appears in your administrative dashboard by default.</dd>
<dt><a href="https://planet.wordpress.org/">WordPress Planet</a></dt>
<dd>The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.</dd>
<dt><a href="https://wordpress.org/support/forums/">WordPress Support Forums</a></dt>
<dd>If you&#8217;ve looked everywhere and still cannot find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.</dd>
<dt><a href="https://make.wordpress.org/support/handbook/appendix/other-support-locations/introduction-to-irc/">WordPress <abbr>IRC</abbr> (Internet Relay Chat) Channel</a></dt>
<dd>There is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (<a href="https://web.libera.chat/#wordpress">irc.libera.chat #wordpress</a>)</dd>
</dl>
<h2>Final Notes</h2>
<ul>
<li>If you have any suggestions, ideas, or comments, or if you (gasp!) found a bug, join us in the <a href="https://wordpress.org/support/forums/">Support Forums</a>.</li>
<li>WordPress has a robust plugin <abbr>API</abbr> (Application Programming Interface) that makes extending the code easy. If you are a developer interested in utilizing this, see the <a href="https://developer.wordpress.org/plugins/">Plugin Developer Handbook</a>. You shouldn&#8217;t modify any of the core code.</li>
</ul>
<h2>Share the Love</h2>
<p>WordPress has no multi-million dollar marketing campaign or celebrity sponsors, but we do have something even better&#8212;you. If you enjoy WordPress please consider telling a friend, setting it up for someone less knowledgeable than yourself, or writing the author of a media article that overlooks us.</p>
<p>WordPress is the official continuation of <a href="http://cafelog.com/">b2/caf&#233;log</a>, which came from Michel V. The work has been continued by the <a href="https://wordpress.org/about/">WordPress developers</a>. If you would like to support WordPress, please consider <a href="https://wordpress.org/donate/">donating</a>.</p>
<h2>License</h2>
<p>WordPress is free software, and is released under the terms of the <abbr>GPL</abbr> (GNU General Public License) version 2 or (at your option) any later version. See <a href="license.txt">license.txt</a>.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WordPress &#8250; ReadMe</title>
<link rel="stylesheet" href="wp-admin/css/install.css?ver=20100228" type="text/css" />
</head>
<body>
<h1 id="logo">
<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
<br /> Version 4.4
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
<h2>First Things First</h2>
<p>Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I&#8217;m proud to be a part of. Thousands of hours have gone into WordPress, and we&#8217;re dedicated to making it better every day. Thank you for making it part of your world.</p>
<p style="text-align: right">&#8212; Matt Mullenweg</p>
<h2>Installation: Famous 5-minute install</h2>
<ol>
<li>Unzip the package in an empty directory and upload everything.</li>
<li>Open <span class="file"><a href="wp-admin/install.php">wp-admin/install.php</a></span> in your browser. It will take you through the process to set up a <code>wp-config.php</code> file with your database connection details.
<ol>
<li>If for some reason this doesn&#8217;t work, don&#8217;t worry. It doesn&#8217;t work on all web hosts. Open up <code>wp-config-sample.php</code> with a text editor like WordPad or similar and fill in your database connection details.</li>
<li>Save the file as <code>wp-config.php</code> and upload it.</li>
<li>Open <span class="file"><a href="wp-admin/install.php">wp-admin/install.php</a></span> in your browser.</li>
</ol>
</li>
<li>Once the configuration file is set up, the installer will set up the tables needed for your blog. If there is an error, double check your <code>wp-config.php</code> file, and try again. If it fails again, please go to the <a href="https://wordpress.org/support/" title="WordPress support">support forums</a> with as much data as you can gather.</li>
<li><strong>If you did not enter a password, note the password given to you.</strong> If you did not provide a username, it will be <code>admin</code>.</li>
<li>The installer should then send you to the <a href="wp-login.php">login page</a>. Sign in with the username and password you chose during the installation. If a password was generated for you, you can then click on &#8220;Profile&#8221; to change the password.</li>
</ol>
<h2>Updating</h2>
<h3>Using the Automatic Updater</h3>
<p>If you are updating from version 2.7 or higher, you can use the automatic updater:</p>
<ol>
<li>Open <span class="file"><a href="wp-admin/update-core.php">wp-admin/update-core.php</a></span> in your browser and follow the instructions.</li>
<li>You wanted more, perhaps? That&#8217;s it!</li>
</ol>
<h3>Updating Manually</h3>
<ol>
<li>Before you update anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</li>
<li>Delete your old WordPress files, saving ones you&#8217;ve modified.</li>
<li>Upload the new files.</li>
<li>Point your browser to <span class="file"><a href="wp-admin/upgrade.php">/wp-admin/upgrade.php</a>.</span></li>
</ol>
<h2>Migrating from other systems</h2>
<p>WordPress can <a href="https://codex.wordpress.org/Importing_Content">import from a number of systems</a>. First you need to get WordPress installed and working as described above, before using <a href="wp-admin/import.php" title="Import to WordPress">our import tools</a>.</p>
<h2>System Requirements</h2>
<ul>
<li><a href="http://php.net/">PHP</a> version <strong>5.2.4</strong> or higher.</li>
<li><a href="http://www.mysql.com/">MySQL</a> version <strong>5.0</strong> or higher.</li>
</ul>
<h3>Recommendations</h3>
<ul>
<li><a href="http://php.net/">PHP</a> version <strong>5.6</strong> or higher.</li>
<li><a href="http://www.mysql.com/">MySQL</a> version <strong>5.6</strong> or higher.</li>
<li>The <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">mod_rewrite</a> Apache module.</li>
<li>A link to <a href="https://wordpress.org/">wordpress.org</a> on your site.</li>
</ul>
<h2>Online Resources</h2>
<p>If you have any questions that aren&#8217;t addressed in this document, please take advantage of WordPress&#8217; numerous online resources:</p>
<dl>
<dt><a href="https://codex.wordpress.org/">The WordPress Codex</a></dt>
<dd>The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.</dd>
<dt><a href="https://wordpress.org/news/">The WordPress Blog</a></dt>
<dd>This is where you&#8217;ll find the latest updates and news related to WordPress. Recent WordPress news appears in your administrative dashboard by default.</dd>
<dt><a href="https://planet.wordpress.org/">WordPress Planet</a></dt>
<dd>The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.</dd>
<dt><a href="https://wordpress.org/support/">WordPress Support Forums</a></dt>
<dd>If you&#8217;ve looked everywhere and still can&#8217;t find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.</dd>
<dt><a href="https://codex.wordpress.org/IRC">WordPress <abbr title="Internet Relay Chat">IRC</abbr> Channel</a></dt>
<dd>There is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (<a href="irc://irc.freenode.net/wordpress">irc.freenode.net #wordpress</a>)</dd>
</dl>
<h2>Final Notes</h2>
<ul>
<li>If you have any suggestions, ideas, or comments, or if you (gasp!) found a bug, join us in the <a href="https://wordpress.org/support/">Support Forums</a>.</li>
<li>WordPress has a robust plugin <abbr title="application programming interface">API</abbr> that makes extending the code easy. If you are a developer interested in utilizing this, see the <a href="https://codex.wordpress.org/Plugin_API" title="WordPress plugin API">plugin documentation in the Codex</a>. You shouldn&#8217;t modify any of the core code.</li>
</ul>
<h2>Share the Love</h2>
<p>WordPress has no multi-million dollar marketing campaign or celebrity sponsors, but we do have something even better&#8212;you. If you enjoy WordPress please consider telling a friend, setting it up for someone less knowledgable than yourself, or writing the author of a media article that overlooks us.</p>
<p>WordPress is the official continuation of <a href="http://cafelog.com/">b2/caf&#233;log</a>, which came from Michel V. The work has been continued by the <a href="https://wordpress.org/about/">WordPress developers</a>. If you would like to support WordPress, please consider <a href="https://wordpress.org/donate/" title="Donate to WordPress">donating</a>.</p>
<h2>License</h2>
<p>WordPress is free software, and is released under the terms of the <abbr title="GNU General Public License">GPL</abbr> version 2 or (at your option) any later version. See <a href="license.txt">license.txt</a>.</p>
</body>
</html>
This diff is collapsed. Click to expand it.
test commit.
\ No newline at end of file
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitc870c977e69b00574a49c4be5d77a175::getLoader();
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ENV['BUNDLER_VERSION'] = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('bundler', 'bundle', version)
else
gem "bundler", version
load Gem.bin_path("bundler", "bundle", version)
end
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ENV['BUNDLER_VERSION'] = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('bundler', 'bundler', version)
else
gem "bundler", version
load Gem.bin_path("bundler", "bundler", version)
end
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'capistrano' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
Gem.use_gemdeps
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('capistrano', 'cap', version)
else
gem "capistrano", version
load Gem.bin_path("capistrano", "cap", version)
end
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'capistrano' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
Gem.use_gemdeps
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('capistrano', 'capify', version)
else
gem "capistrano", version
load Gem.bin_path("capistrano", "capify", version)
end
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
Gem.use_gemdeps
version = ">= 0.a"
str = ARGV.first
if str
str = str.b[/\A_(.*)_\z/, 1]
if str and Gem::Version.correct?(str)
version = str
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('rake', 'rake', version)
else
gem "rake", version
load Gem.bin_path("rake", "rake", version)
end
No preview for this file type
No preview for this file type
/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/log/
/pkg/
/spec/reports/
/tmp/
*.bundle
*.so
*.o
*.a
mkmf.log
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 1.9
Exclude:
- "*.gemspec"
Metrics/AbcSize:
Exclude:
- "test/**/*"
Metrics/MethodLength:
Exclude:
- "test/**/*"
Metrics/ClassLength:
Exclude:
- "test/**/*"
Style/BarePercentLiterals:
EnforcedStyle: percent_q
Style/ClassAndModuleChildren:
Enabled: false
Style/Documentation:
Enabled: false
Style/DoubleNegation:
Enabled: false
Style/HashSyntax:
EnforcedStyle: hash_rockets
Style/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/TrivialAccessors:
AllowPredicates: true
language: ruby
rvm:
- 1.9
- 2.0
- 2.1
- 2.2
- 2.3.1
- 2.4.0
env:
- sshkit="master"
- sshkit="= 1.7.1"
- sshkit="= 1.6.1"
matrix:
exclude:
# Older versions of SSHKit don't work with Ruby 2.4, so skip those
- rvm: 2.4.0
env: sshkit="= 1.7.1"
- rvm: 2.4.0
env: sshkit="= 1.6.1"
include:
# Run Danger only once, on 2.4.0
- rvm: 2.4.0
script: bundle exec danger
before_install: gem install bundler --conservative --version '~> 1.13.7'
# Airbrussh Change Log
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning][Semver].
## [Unreleased]
* Your contribution here!
## [1.3.0][] (2017-06-16)
* [#109](https://github.com/mattbrictson/airbrussh/pull/109): Add configurable task prefix - [@gondalez](https://github.com/gondalez)
## [1.2.0][] (2017-04-14)
* [#95](https://github.com/mattbrictson/airbrussh/pull/95): colorize LogMessage label on WARN level and above - [@klyonrad](https://github.com/klyonrad)
* [#106](https://github.com/mattbrictson/airbrussh/pull/106): Remove the `log_file` parameter from the `CommandFormatter#exit_message` method; it was unused - [@mattbrictson](https://github.com/mattbrictson)
## [1.1.2][] (2017-01-02)
* Add Ruby 2.4.0 to testing matrix and fix Ruby 2.4 deprecation warnings
## [1.1.1][] (2016-09-09)
* When a Capistrano deploy fails and the error log is dumped to the console,
Airbrussh no longer truncates the error output. This ensures that important
troubleshooting information is not lost.
[#91](https://github.com/mattbrictson/airbrussh/issues/91)
## [1.1.0][] (2016-07-26)
* Use default color for info messages.
When using the `gray` color on some implementation of the `solarized`
theme the text is not visible. The `solarized` theme is popular and
bugs have been reported about missed error messages, so this patch
switches these messages to the default color.
(see [#84](https://github.com/mattbrictson/airbrussh/issues/84))
## [1.0.2][] (2016-05-13)
* Fix a crash that can happen in certain multi-server deployments when
Capistrano's `invoke` is used to switch Rake tasks in the middle of SSHKit
execution ([#78](https://github.com/mattbrictson/airbrussh/issues/78),
[#80](https://github.com/mattbrictson/airbrussh/pull/80))
## [1.0.1][] (2016-03-21)
* Fix support for fake TTYs reporting a 0 width console like Ruby's PTY library [#76](https://github.com/mattbrictson/airbrussh/pull/76)
## [1.0.0][] (2016-02-27)
* No changes since 1.0.0.beta1.
## [1.0.0.beta1][] (2015-12-27)
Breaking Changes:
* None
Added:
* Airbrussh can now be configured with an options Hash passed to the
`Airbrussh::Formatter` constructor. This is in order to standardize how all
SSHKit formatters are configured
(see [SSHKit #308](https://github.com/capistrano/sshkit/pull/308)).
## [0.8.0][] (2015-11-20)
* Airbrussh now displays the correct user@host output in the following edge-cases:
* Inside an SSHKit `as(:user => "...")` block
* When a user is specified using `set :ssh_options, :user => "..."` ([see #65](https://github.com/mattbrictson/airbrussh/issues/65))
## [0.7.0][] (2015-08-08)
Fixes:
* Handle truncation of raw/non-UTF8 output without crashing ([#57](https://github.com/mattbrictson/airbrussh/issues/57))
Other changes:
* Re-implement the "tail log on deploy failure" feature in pure Ruby ([#59](https://github.com/mattbrictson/airbrussh/issues/59))
* Code of contact added to the project
* Tests now run on Windows ([#55](https://github.com/mattbrictson/airbrussh/issues/55))
## [0.6.0][] (2015-07-10)
This is another release with mostly behind-the-scenes changes. If you notice any differences in Airbrussh's behavior in this version, [please report an issue](https://github.com/mattbrictson/airbrussh/issues).
Other changes:
* Bundler 1.10 is now required to build and test airbrussh (this doesn't affect users of airbrussh at all).
* If the directory containing the log file doesn't exist, Airbrussh will now attempt to create it using `FileUtils.mkdir_p` ([#30](https://github.com/mattbrictson/airbrussh/issues/30))
* By default Airbrussh now always prints `Using airbrussh format.` when it starts up. In previous versions, a bug caused this message to sometimes not be shown. To change or disable this message, set the `banner` configuration option as explained in the README.
## [0.5.1][] (2015-06-24)
* Fix `NameError: uninitialized constant Airbrussh::SimpleDelegator`
## [0.5.0][] (2015-06-24)
There are no changes to the actual behavior and feature set of Airbrussh in this release.
There are, however, many behind-the-scenes changes and improvements to overall code quality. This release also adds support for upcoming versions of SSHKit.
* Added Rubocop enforcement to Travis
* Added Code Climate and Coveralls checks (see badges in the README)
* Airbrussh now has good test coverage, and is tested by Travis against a matrix of Ruby and SSHKit versions ([@robd](https://github.com/robd))
* Changes to support the new SSHKit formatter API, as introduced in [SSHKit #257](https://github.com/capistrano/sshkit/pull/257) ([@robd](https://github.com/robd))
* `Airbrussh.reset` has been removed
* Airbrussh now has its own ANSI color code; it no longer relies on a third-party gem (i.e. `colorize`)
## [0.4.1][] (2015-05-06)
* Fix `Marshal.dump` warnings by removing `deep_copy` workaround that it is no longer needed for the latest SSHKit ([#10](https://github.com/mattbrictson/airbrussh/issues/10)).
## [0.4.0][] (2015-05-03)
* Changes to ensure compatibility with the upcoming version of SSHKit ([ec3122b](https://github.com/mattbrictson/airbrussh/commit/ec3122b101de53f2304723da842d5c8b6f70f4f3)).
* Explicitly specify UTF-8 encoding for source files, for Ruby 1.9.3 compatibility ([#9](https://github.com/mattbrictson/airbrussh/issues/9)).
## [0.3.0][] (2015-03-28)
* New `config.banner` option allows startup message to be disabled or changed (suggestion from [@justindowning](https://github.com/justindowning))
* New `config.command_output` option gives full control of whether airbrussh shows or hides the stderr and stdout data received from remote commands; see the usage section of the README for further explanation (suggestion from [@carlesso](https://github.com/carlesso))
## [0.2.1][] (2015-03-02)
* Un-pin SSHKit dependency now that SSHKit 1.7.1 has been released.
## [0.2.0][] (2015-03-02)
* Pin SSHKit dependency at `~> 1.6.1` to avoid a [bug in 1.7.0](https://github.com/capistrano/sshkit/issues/226) that causes command exit statuses to be omitted from the log.
## 0.0.1 (2015-02-19)
* Initial release
[Semver]: http://semver.org
[Unreleased]: https://github.com/mattbrictson/airbrussh/compare/v1.3.0...HEAD
[1.3.0]: https://github.com/mattbrictson/airbrussh/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/mattbrictson/airbrussh/compare/v1.1.2...v1.2.0
[1.1.2]: https://github.com/mattbrictson/airbrussh/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/mattbrictson/airbrussh/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/mattbrictson/airbrussh/compare/v1.0.2...v1.1.0
[1.0.2]: https://github.com/mattbrictson/airbrussh/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/mattbrictson/airbrussh/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/mattbrictson/airbrussh/compare/v1.0.0.beta1...v1.0.0
[1.0.0.beta1]: https://github.com/mattbrictson/airbrussh/compare/v0.8.0...v1.0.0.beta1
[0.8.0]: https://github.com/mattbrictson/airbrussh/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/mattbrictson/airbrussh/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/mattbrictson/airbrussh/compare/v0.5.1...v0.6.0
[0.5.1]: https://github.com/mattbrictson/airbrussh/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/mattbrictson/airbrussh/compare/v0.4.1...v0.5.0
[0.4.1]: https://github.com/mattbrictson/airbrussh/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/mattbrictson/airbrussh/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/mattbrictson/airbrussh/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/mattbrictson/airbrussh/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/mattbrictson/airbrussh/compare/v0.0.1...v0.2.0
Contributor Code of Conduct
As contributors and maintainers of this project, we pledge to respect all
people who contribute through reporting issues, posting feature requests,
updating documentation, submitting pull requests or patches, and other
activities.
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, or religion.
Examples of unacceptable behavior by participants include the use of sexual
language or imagery, derogatory comments or personal attacks, trolling, public
or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct. Project maintainers who do not
follow the Code of Conduct may be removed from the project team.
This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by opening an issue or contacting one or more of the project
maintainers.
This Code of Conduct is adapted from the Contributor Covenant
(http://contributor-covenant.org), version 1.1.0, available at
http://contributor-covenant.org/version/1/1/0/
# Contributing to airbrussh
Have a feature idea, bug fix, or refactoring suggestion? Contributions are welcome!
## Pull requests
1. Check [Issues][] to see if your contribution has already been discussed and/or implemented.
2. If not, open an issue to discuss your contribution. I won't accept all changes and do not want to waste your time.
3. Once you have the :thumbsup:, fork the repo, make your changes, and open a PR.
4. Don't forget to add your contribution and credit yourself in `CHANGELOG.md`!
## Coding guidelines
* This project has a coding style enforced by [RuboCop][]. Use hash rockets and double-quoted strings, and otherwise try to follow the [Ruby style guide][style].
* Writing tests is strongly encouraged! This project uses Minitest.
## Getting started
Note that Bundler 1.10 is required for development. Run `gem update bundler` to get the latest version.
After checking out the airbrussh repo, run `bin/setup` to install dependencies. Run `rake` to execute airbrussh's tests and RuboCop checks.
Airbrussh is designed to work against multiple versions of SSHKit and Ruby. In order to test this, we use the environment variable `sshkit` in order to run the tests against a specific version. The combinations of sshkit and ruby we support are specified in [.travis.yml](.travis.yml). To test all the versions locally, there is a `test_all.rb` bin file. This installs the gems and runs the tests for each sshkit version in [.travis.yml](.travis.yml). *Note: this will update your `Gemfile.lock` as each SSHKit gem version is installed. The gem version is restored to the default when the script exits.*
A Guardfile is also present, so if you'd like to use Guard to do a TDD workflow, then:
1. Run `bundle install --with extras` to get the optional guard dependencies
2. Run `guard` to monitor the filesystem and automatically run tests as you work
[Issues]: https://github.com/mattbrictson/airbrussh/issues
[RuboCop]: https://github.com/bbatsov/rubocop
[style]: https://github.com/bbatsov/ruby-style-guide
danger.import_dangerfile(github: "capistrano/danger")
source "https://rubygems.org"
# Specify your gem's dependencies in airbrussh.gemspec
gemspec
# Optional development dependencies; requires bundler >= 1.10.
# Note that these gems assume a Ruby 2.2 environment. Install them using:
#
# bundle install --with extras
#
group :extras, :optional => true do
gem "chandler"
gem "guard", ">= 2.2.2"
gem "guard-minitest"
gem "rb-fsevent"
gem "terminal-notifier-guard"
end
# Danger is used by Travis, but only for Ruby 2.0+
gem "danger", "~> 4.3" unless RUBY_VERSION == "1.9.3"
if (sshkit_version = ENV["sshkit"])
requirement = begin
Gem::Dependency.new("sshkit", sshkit_version).requirement
rescue ArgumentError
user, branch =
if sshkit_version.include?("#")
sshkit_version.split("#")
else
["capistrano", sshkit_version]
end
{ :github => "#{user}/sshkit", :branch => branch }
end
gem "sshkit", requirement
end
# json 2.0+ is not compatible with Ruby 1.9, so pin at older version.
gem "json", "~> 1.8" if RUBY_VERSION == "1.9.3"
# net-ssh 3.0+ is not compatible with Ruby 1.9, so pin at older version.
gem "net-ssh", "~> 2.8" if RUBY_VERSION == "1.9.3"
# term-ansicolor 1.4.0+ is not compatible with Ruby 1.9, so pin older version.
gem "term-ansicolor", "~> 1.3.2" if RUBY_VERSION == "1.9.3"
# tins 1.7.0+ is not compatible with Ruby 1.9, so pin at older version.
gem "tins", "~> 1.6.0" if RUBY_VERSION == "1.9.3"
guard :minitest do
# with Minitest::Unit
watch(%r{^test/(.*)\/?(.*)_test\.rb$})
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}#{m[2]}_test.rb" }
watch(%r{^test/minitest_helper\.rb$}) { "test" }
end
The MIT License (MIT)
Copyright (c) 2016 Matt Brictson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# Airbrussh
[![Gem Version](https://badge.fury.io/rb/airbrussh.svg)](http://badge.fury.io/rb/airbrussh)
[![Build Status](https://travis-ci.org/mattbrictson/airbrussh.svg?branch=master)](https://travis-ci.org/mattbrictson/airbrussh)
[![Build status](https://ci.appveyor.com/api/projects/status/h052rlq54sne3md6/branch/master?svg=true)](https://ci.appveyor.com/project/mattbrictson/airbrussh/branch/master)
[![Code Climate](https://codeclimate.com/github/mattbrictson/airbrussh/badges/gpa.svg)](https://codeclimate.com/github/mattbrictson/airbrussh)
[![Coverage Status](https://coveralls.io/repos/mattbrictson/airbrussh/badge.svg?branch=master)](https://coveralls.io/r/mattbrictson/airbrussh?branch=master)
Airbrussh is a concise log formatter for Capistrano and SSHKit. It displays well-formatted, useful log output that is easy to read. Airbrussh also saves Capistrano's verbose output to a separate log file just in case you need additional details for troubleshooting.
**As of April 2016, Airbrussh is bundled with Capistrano 3.5, and is Capistrano's default formatter! There is nothing additional to install or enable.** Continue reading to learn more about Airbrussh's features and configuration options.
If you aren't yet using Capistrano 3.5 (or wish to use Airbrussh with SSHKit directly), refer to the [advanced/legacy usage](#advancedlegacy-usage) section for installation instructions.
![Sample output](https://raw.github.com/mattbrictson/airbrussh/master/demo.gif)
For more details on how exactly Airbrussh affects Capistrano's output and the reasoning behind it, check out the blog post: [Introducing Airbrussh](https://mattbrictson.com/airbrussh).
-----
* [Usage](#usage)
* [Configuration](#configuration)
* [FAQ](#faq)
* [Advanced/legacy usage](#advancedlegacy-usage)
## Usage
Airbrussh is enabled by default in Capistrano 3.5 and newer. To manually enable Airbrussh (for example, when upgrading an existing project), set the Capistrano format like this:
```ruby
# In deploy.rb
set :format, :airbrussh
```
### What's displayed
When you run a Capistrano command, Airbrussh provides the following information in its output:
![Sample output](https://raw.github.com/mattbrictson/airbrussh/master/formatting.png)
* Name of Capistrano task being executed
* When each task started (minutes:seconds elapsed since the deploy began)
* The SSH command-line strings that are executed; for Capistrano tasks that involve running multiple commands, the numeric prefix indicates the command in the sequence, starting from `01`
* Stdout and stderr output from each command
* The duration of each command execution, per server
### What's *not* displayed
For brevity, Airbrussh does not show *everything* that Capistrano is doing. For example, it will omit Capistrano's `test` commands, which can be noisy and confusing. Airbrussh also hides things like environment variables, as well as `cd` and `env` invocations. To see a full audit of Capistrano's execution, including *exactly* what commands were run on each server, look at `log/capistrano.log`.
## Configuration
You can customize many aspects of Airbrussh's output. In Capistrano 3.5 and newer, this is done via the `:format_options` variable, like this:
```ruby
# Pass options to Airbrussh
set :format_options, color: false, truncate: 80
```
Here are the options you can use, and their effects (note that the defaults may be different depending on where Airbrussh is used; these are the defaults used by Capistrano 3.5):
|Option|Default|Usage|
|---|---|---|
|`banner`|`nil`|Provide a string (e.g. "Capistrano started!") that will be printed when Capistrano starts up.|
|`color`|`:auto`|Use `true` or `false` to enable or disable ansi color. If set to `:auto`, Airbrussh automatically uses color based on whether the output is a TTY, or if the SSHKIT_COLOR environment variable is set.|
|`command_output`|`true`|Set to `:stdout`, `:stderr`, or `true` to display the SSH output received via stdout, stderr, or both, respectively. Set to `false` to not show any SSH output, for a minimal look.|
|`log_file`|`log/capistrano.log`|Capistrano's verbose output is saved to this file to facilitate debugging. Set to `nil` to disable completely.|
|`truncate`|`:auto`|Set to a number (e.g. 80) to truncate the width of the output to that many characters, or `false` to disable truncation. If `:auto`, output is automatically truncated to the width of the terminal window, if it can be determined.|
|`task_prefix`|`nil`|A string to prefix to task output. Handy for output collapsing like [buildkite](https://buildkite.com/docs/builds/managing-log-output)'s `---` prefix|
## FAQ
**Airbrussh is not displaying the output of my commands! For example, I run `tail` in one of my capistrano tasks and airbrussh doesn't show anything. How do I fix this?**
Make sure Airbrussh is configured to show SSH output.
```ruby
set :format_options, command_output: true
```
**I haven't upgraded to Capistrano 3.5 yet. Can I still use Airbrussh?**
Yes! Capistrano 3.4.x is also supported. Refer to the [advanced/legacy usage](#advancedlegacy-usage) section for installation instructions.
**Does Airbrussh work with Capistrano 2?**
No, Capistrano 3 is required. We recommend Capistrano 3.4.0 or higher. Capistrano 3.5.0 and higher have Airbrussh enabled by default, with no installation needed.
**Does Airbrussh work with JRuby?**
JRuby is not officially supported or tested, but may work. You must disable automatic truncation to work around a known bug in the JRuby 9.0 standard library. See [#62](https://github.com/mattbrictson/airbrussh/issues/62) for more details.
```ruby
set :format_options, truncate: false
```
**I have a question that’s not answered here or elsewhere in the README.**
Please [open a GitHub issue](https://github.com/mattbrictson/airbrussh/issues/new) and we’ll be happy to help!
## Advanced/legacy usage
Although Airbrussh is built into Capistrano 3.5.0 and higher, it is also available as a plug-in for older versions. Airbrussh has been tested with MRI 1.9+, Capistrano 3.4.0+, and SSHKit 1.6.1+.
### Capistrano 3.4.x
Add this line to your application's Gemfile:
```ruby
gem "airbrussh", require: false
```
And then execute:
$ bundle
Finally, add this line to your application's Capfile:
```ruby
require "airbrussh/capistrano"
```
**Important:** explicitly setting Capistrano's `:format` option in your deploy.rb will override airbrussh. Remove this line if you have it:
```ruby
# Remove this
set :format, :pretty
```
Capistrano 3.4.x doesn't have the `:format_options` configuration system, so you will need to configure Airbrussh using this technique:
```ruby
Airbrussh.configure do |config|
config.color = false
config.command_output = true
# etc.
end
```
Refer to the [configuration](#configuration) section above for the list of supported options.
### SSHKit
If you are using SSHKit directly (i.e. without Capistrano), you can use Airbrussh like this:
```ruby
require "airbrussh"
SSHKit.config.output = Airbrussh::Formatter.new($stdout)
# You can also pass configuration options like this
SSHKit.config.output = Airbrussh::Formatter.new($stdout, color: false)
```
## History
Airbrussh started life as custom logging code within the [capistrano-mb][] collection of opinionated Capistrano recipes. In February 2015, the logging code was refactored into a standalone gem with its own configuration and documentation, and renamed `airbrussh`. In February 2016, Airbrussh was added as the default formatter in Capistrano 3.5.0.
## Roadmap
Airbrussh now has a stable feature set, excellent test coverage, is being used for production deployments, and has reached 1.0.0! If you have ideas for improvements to Airbrussh, please open a [GitHub issue](https://github.com/mattbrictson/airbrussh/issues/new).
## Contributing
Contributions are welcome! Read [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
[capistrano-mb]: https://github.com/mattbrictson/capistrano-mb
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
require "rubocop/rake_task"
RuboCop::RakeTask.new
# rubocop:disable Lint/HandleExceptions
begin
require "chandler/tasks"
rescue LoadError
end
task "release:rubygem_push" => "chandler:push" if defined?(Chandler)
task :default => [:test, :rubocop]
# Capistrano 3.5 upgrade guide for existing Airbrussh users
If you have been using Airbrussh with Capistrano, and are upgrading to Capistrano 3.5, then this guide is for you.
## What changed?
* Airbrussh is built into Capistrano starting with Capistrano 3.5.0, and is enabled by default.
* Capistrano 3.5 initializes Airbrussh with a default configuration that is different than Airbrussh+Capistrano 3.4.0.
* In Capistrano 3.5, `set :format_options, ...` is now the preferred mechanism for configuring Airbrussh.
## How to upgrade
1. Remove `gem "airbrussh"` from your Gemfile. Airbrussh is now included automatically by Capistrano.
2. Likewise, remove `require "capistrano/airbrussh"` from your Capfile. Capistrano now does this internally.
3. Remove `Airbrussh.configure do ... end` from your deploy.rb and replace with `set :format_options, ...` (see below).
## New configuration system
In Capistrano 3.5, Airbrussh is configured by assigning a configuration Hash to the `:format_options` variable. Here is a comparison of the old and new syntaxes:
```ruby
# Old syntax
Airbrussh.configure do |config|
config.color = false
end
# New syntax
set :format_options, color: false
```
Although the syntax is different, the names of the configuration keys have not changed.
## New defaults
Capistrano 3.5.0 changes Airbrussh defaults as follows:
* `banner: false`
* `command_output: true`
Therefore, after upgrading to Capistrano 3.5.0, you may notice Airbrussh's output has changed and become more verbose. To restore the defaults to what you were used to in older versions, do this:
```ruby
set :format_options, banner: :auto, command_output: false
```
## Trouble?
If you have any Airbrussh-related trouble with the upgrade, please [open an issue](https://github.com/mattbrictson/airbrussh/issues).
# coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "airbrussh/version"
Gem::Specification.new do |spec|
spec.name = "airbrussh"
spec.version = Airbrussh::VERSION
spec.authors = ["Matt Brictson"]
spec.email = ["airbrussh@mattbrictson.com"]
spec.summary = "Airbrussh pretties up your SSHKit and Capistrano output"
spec.description = "A replacement log formatter for SSHKit that makes "\
"Capistrano output much easier on the eyes. Just add "\
"Airbrussh to your Capfile and enjoy concise, useful "\
"log output that is easy to read."
spec.homepage = "https://github.com/mattbrictson/airbrussh"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_dependency "sshkit", [">= 1.6.1", "!= 1.7.0"]
spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "coveralls", "~> 0.8.15"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "minitest", "~> 5.10"
spec.add_development_dependency "minitest-reporters", "~> 1.1"
spec.add_development_dependency "mocha", "~> 1.2"
spec.add_development_dependency "rubocop", "~> 0.41.2"
end
version: '{build}'
skip_tags: true
environment:
matrix:
- ruby_version: "23"
- ruby_version: "23-x64"
install:
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
- gem install bundler --no-document --conservative --version 1.10.5
- bundle install --retry=3
test_script:
- bundle exec rake
build: off
#!/usr/bin/env ruby
require "bundler/setup"
require "airbrussh"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start
require "irb"
IRB.start
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
bundle install
# Do any other automated setup that you need to do here
#!/usr/bin/env ruby
require "yaml"
require "English"
ruby24 = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.4.0")
YAML.load_file(".travis.yml")["env"].each do |sshkit_version|
# Older versions of SSHKit don't work with Ruby 2.4, so skip those
next if ruby24 && sshkit_version !~ /master/
puts "\e[0;34;49m== Running tests against #{sshkit_version} ==\e[0m"
output = `#{sshkit_version} bundle update`
raise "bundle update failed: #{output}" unless $CHILD_STATUS.success?
system("#{sshkit_version} bundle exec rake test")
end
system("bundle exec rake rubocop")
at_exit do
puts "\e[0;34;49m== Resetting sshkit ==\e[0m"
system("bundle update")
end
require "airbrussh/configuration"
require "airbrussh/formatter"
require "airbrussh/version"
module Airbrussh
def self.configuration(options={})
return options if options.is_a?(::Airbrussh::Configuration)
@configuration ||= Configuration.new
@configuration.apply_options(options)
end
def self.configure
yield(configuration)
end
end
require "airbrussh/capistrano/tasks"
tasks = Airbrussh::Capistrano::Tasks.new(self)
# Hook into Capistrano's init process to set the formatter
namespace :load do
task :defaults do
tasks.load_defaults
end
end
# Capistrano failure hook
namespace :deploy do
task :failed do
tasks.deploy_failed
end
end
require "airbrussh"
require "airbrussh/colors"
require "airbrussh/console"
require "forwardable"
require "shellwords"
module Airbrussh
module Capistrano
# Encapsulates the rake behavior that integrates Airbrussh into Capistrano.
# This class allows us to easily test the behavior using a mock to stand in
# for the Capistrano DSL.
#
# See airbrussh/capistrano.rb to see how this class is used.
#
class Tasks
extend Forwardable
def_delegators :dsl, :set, :env
def_delegators :config, :log_file
include Airbrussh::Colors
def initialize(dsl, stderr=$stderr, config=Airbrussh.configuration)
@dsl = dsl
@stderr = stderr
@config = config
configure
warn_if_missing_dsl
end
# Behavior for the rake load:defaults task.
def load_defaults
require "sshkit/formatter/airbrussh"
set :format, :airbrussh
end
# Behavior for the rake deploy:failed task.
def deploy_failed
return unless airbrussh_is_being_used?
return if log_file.nil?
error_line
error_line(red("** DEPLOY FAILED"))
error_line(yellow("** Refer to #{log_file} for details. "\
"Here are the last 20 lines:"))
error_line
error_line(tail_log_file)
end
private
attr_reader :dsl, :stderr, :config
# Change airbrussh's default configuration to be more appropriate for
# capistrano.
def configure
config.log_file = "log/capistrano.log"
config.monkey_patch_rake = true
end
# Verify that capistrano and rake DSLs are present
def warn_if_missing_dsl
return if %w(set namespace task).all? { |m| dsl.respond_to?(m, true) }
error_line(
red("WARNING: airbrussh/capistrano must be loaded by Capistrano in "\
"order to work.\nRequire this gem within your application's "\
"Capfile, as described here:\n"\
"https://github.com/mattbrictson/airbrussh#installation")
)
end
def err_console
@err_console ||= begin
# Ensure we do not truncate the error output
err_config = config.dup
err_config.truncate = false
Airbrussh::Console.new(stderr, err_config)
end
end
def error_line(line="\n")
line.each_line(&err_console.method(:print_line))
end
# Returns a String containing the last 20 lines of the log file. Since
# this method uses a fixed-size buffer, fewer than 20 lines may be
# returned in cases where the lines are extremely long.
def tail_log_file
open(log_file) do |file|
file.seek(-[8192, file.size].min, IO::SEEK_END)
file.readlines.last(20).join
end
end
def airbrussh_is_being_used?
# Obtain the current formatter from the SSHKit backend
output = env.backend.config.output
output.is_a?(Airbrussh::Formatter)
end
end
end
end
module Airbrussh
# Very basic support for ANSI color, so that we don't have to rely on
# any external dependencies.
module Colors
ANSI_CODES = {
:red => 31,
:green => 32,
:yellow => 33,
:blue => 34,
:gray => 90
}.freeze
# Define red, green, blue, etc. methods that return a copy of the
# String that is wrapped in the corresponding ANSI color escape
# sequence.
ANSI_CODES.each do |name, code|
define_method(name) do |string|
"\e[0;#{code};49m#{string}\e[0m"
end
module_function(name)
end
end
end
# encoding: UTF-8
require "airbrussh/colors"
require "delegate"
# rubocop:disable Style/AsciiComments
module Airbrussh
# Decorates an SSHKit Command to add string output helpers and the
# command's position within currently executing rake task:
#
# * position - zero-based position of this command in the list of
# all commands that have been run in the current rake task; in
# some cases this could be nil
class CommandFormatter < SimpleDelegator
include Airbrussh::Colors
def initialize(command, position)
super(command)
@position = position
end
# Prefixes the line with the command number and removes the newline.
#
# format_output("hello\n") # => "01 hello"
#
def format_output(line)
"#{number} #{line.chomp}"
end
# Returns the abbreviated command (in yellow) with the number prefix.
#
# start_message # => "01 echo hello"
#
def start_message
"#{number} #{yellow(abbreviated)}"
end
# Returns a green (success) or red (failure) message depending on the
# exit status.
#
# exit_message # => "✔ 01 user@host 0.084s"
# exit_message # => "✘ 01 user@host 0.084s"
#
def exit_message
message = if failure?
red(failure_message)
else
green(success_message)
end
message << " #{runtime}"
end
private
def user_at_host
user_str = host.user || (host.ssh_options || {})[:user]
host_str = host.hostname
[user_str, host_str].compact.join("@")
end
def runtime
format("%5.3fs", super)
end
def abbreviated
to_s.sub(%r{^/usr/bin/env }, "")
end
def number
format("%02d", @position.to_i + 1)
end
def success_message
"✔ #{number} #{user_at_host}"
end
def failure_message
"✘ #{number} #{user_at_host}"
end
end
end
require "airbrussh/colors"
require "airbrussh/console_formatter"
require "airbrussh/log_file_formatter"
module Airbrussh
class Configuration
attr_accessor :log_file, :monkey_patch_rake, :color, :truncate, :banner,
:command_output, :task_prefix
def initialize
self.log_file = nil
self.monkey_patch_rake = false
self.color = :auto
self.truncate = :auto
self.banner = :auto
self.command_output = false
self.task_prefix = nil
end
def apply_options(options)
return self if options.nil?
options.each do |key, value|
if respond_to?(writer = "#{key}=")
public_send(writer, value)
else
warn_unrecognized_key(key)
end
end
self
end
def banner_message
return nil unless banner
return banner unless banner == :auto
msg = "Using airbrussh format."
if log_file
msg << "\n"
msg << "Verbose output is being written to #{Colors.blue(log_file)}."
end
msg
end
# This returns an array of formatters appropriate for the configuration.
# Depending on whether a log file is configured, this could be just the
# Airbrussh:ConsoleFormatter, or that plus the LogFileFormatter.
def formatters(io)
fmts = [Airbrussh::ConsoleFormatter.new(io, self)]
fmts.unshift(Airbrussh::LogFileFormatter.new(log_file)) if log_file
fmts
end
def show_command_output?(sym)
command_output == true || Array(command_output).include?(sym)
end
private
def warn_unrecognized_key(key)
$stderr.puts("Ignoring unrecognized Airbrussh option: #{key}")
end
end
end
# encoding: UTF-8
require "io/console"
module Airbrussh
# Helper class that wraps an IO object and provides methods for truncating
# output, assuming the IO object represents a console window.
#
# This is useful for writing log messages that will typically show up on
# an ANSI color-capable console. When a console is not present (e.g. when
# running on a CI server) the output will gracefully degrade.
class Console
attr_reader :output, :config
def initialize(output, config=Airbrussh.configuration)
@output = output
@config = config
end
# Writes to the IO after first truncating the output to fit the console
# width. If the underlying IO is not a TTY, ANSI colors are removed from
# the output. A newline is always added. Color output can be forced by
# setting the SSHKIT_COLOR environment variable.
def print_line(obj="")
string = obj.to_s
string = truncate_to_console_width(string) if console_width
string = strip_ascii_color(string) unless color_enabled?
write(string + "\n")
output.flush
end
# Writes directly through to the IO with no truncation or color logic.
# No newline is added.
def write(string)
output.write(string || "")
end
alias << write
def truncate_to_console_width(string)
string = (string || "").rstrip
ellipsis = utf8_supported?(string) ? "…" : "..."
width = console_width
if strip_ascii_color(string).length > width
width -= ellipsis.length
string.chop! while strip_ascii_color(string).length > width
string << "#{ellipsis}\e[0m"
else
string
end
end
def strip_ascii_color(string)
(string || "").gsub(/\033\[[0-9;]*m/, "")
end
def console_width
width = case (truncate = config.truncate)
when :auto
IO.console.winsize.last if @output.tty?
when Integer
truncate
end
width if width.to_i > 0
end
private
def color_enabled?
case config.color
when true
true
when :auto
ENV["SSHKIT_COLOR"] || @output.tty?
else
false
end
end
def utf8_supported?(string)
string.encode("UTF-8").valid_encoding?
rescue Encoding::UndefinedConversionError
false
end
end
end
require "airbrussh/colors"
require "airbrussh/command_formatter"
require "airbrussh/console"
require "airbrussh/rake/context"
require "sshkit"
module Airbrussh
class ConsoleFormatter < SSHKit::Formatter::Abstract
include Airbrussh::Colors
extend Forwardable
attr_reader :config, :context
def_delegators :context, :current_task_name, :register_new_command
def initialize(io, config=Airbrussh.configuration)
super(io)
@config = config
@context = Airbrussh::Rake::Context.new(config)
@console = Airbrussh::Console.new(original_output, config)
write_banner
end
def write_banner
print_line(config.banner_message) if config.banner_message
end
def log_command_start(command)
return if debug?(command)
first_execution = register_new_command(command)
command = decorate(command)
print_task_if_changed
print_indented_line(command.start_message) if first_execution
end
def log_command_data(command, stream_type, string)
return if debug?(command)
return unless config.show_command_output?(stream_type)
command = decorate(command)
string.each_line do |line|
print_indented_line(command.format_output(line))
end
end
def log_command_exit(command)
return if debug?(command)
command = decorate(command)
print_indented_line(command.exit_message, -2)
end
def write(obj)
case obj
when SSHKit::Command
log_command_start(obj)
log_and_clear_command_output(obj, :stderr)
log_and_clear_command_output(obj, :stdout)
log_command_exit(obj) if obj.finished?
when SSHKit::LogMessage
write_log_message(obj)
end
end
alias << write
private
attr_accessor :last_printed_task
def write_log_message(log_message)
return if debug?(log_message)
print_task_if_changed
print_indented_line(format_log_message(log_message))
end
def format_log_message(log_message)
case log_message.verbosity
when SSHKit::Logger::WARN
"#{yellow('WARN')} #{log_message}"
when SSHKit::Logger::ERROR
"#{red('ERROR')} #{log_message}"
when SSHKit::Logger::FATAL
"#{red('FATAL')} #{log_message}"
else
log_message.to_s
end
end
# For SSHKit versions up to and including 1.7.1, the stdout and stderr
# output was available as attributes on the Command. Print the data for
# the specified command and stream if enabled and clear the stream.
# (see Airbrussh::Configuration#command_output).
def log_and_clear_command_output(command, stream)
output = command.public_send(stream)
log_command_data(command, stream, output)
command.public_send("#{stream}=", "")
end
def print_task_if_changed
return if current_task_name.nil?
return if current_task_name == last_printed_task
self.last_printed_task = current_task_name
print_line("#{config.task_prefix}#{clock} #{blue(current_task_name)}")
end
def clock
@start_at ||= Time.now
duration = Time.now - @start_at
minutes = (duration / 60).to_i
seconds = (duration - minutes * 60).to_i
format("%02d:%02d", minutes, seconds)
end
def debug?(obj)
obj.verbosity <= SSHKit::Logger::DEBUG
end
def decorate(command)
Airbrussh::CommandFormatter.new(command, @context.position(command))
end
def print_line(string)
@console.print_line(string)
end
def print_indented_line(string, offset=0)
indent = " " * (6 + offset)
print_line([indent, string].join)
end
end
end
require "sshkit"
module Airbrussh
# This class quacks like an SSHKit::Formatter, but when any formatting
# methods are called, it simply forwards them to one more more concrete
# formatters. This allows us to split out the responsibilities of
# ConsoleFormatter and LogFileFormatter into two separate classes, with
# DelegatingFormatter forwarding the logging messages to both at once.
#
class DelegatingFormatter
FORWARD_METHODS = %w(
fatal error warn info debug log
log_command_start log_command_data log_command_exit
).freeze
DUP_AND_FORWARD_METHODS = %w(<< write).freeze
attr_reader :formatters
def initialize(formatters)
@formatters = formatters
end
FORWARD_METHODS.each do |method|
define_method(method) do |*args|
formatters.map { |f| f.public_send(method, *args) }.last
end
end
# For versions of SSHKit up to and including 1.7.1, the LogfileFormatter
# and ConsoleFormatter (and all of SSHKit's built in formatters) clear
# the stdout and stderr data in the command obj. Therefore, ensure only
# one of the formatters (the last one) gets the original command. This is
# also the formatter whose return value is passed to the caller.
#
DUP_AND_FORWARD_METHODS.each do |method|
define_method(method) do |command_or_log_message|
formatters[0...-1].each do |f|
f.public_send(method, command_or_log_message.dup)
end
formatters.last.public_send(method, command_or_log_message)
end
end
end
end
require "airbrussh"
require "airbrussh/delegating_formatter"
# This is the formatter class that conforms to the SSHKit Formatter API and
# provides the airbrussh functionality to SSHKit. Note however that this class
# doesn't do much by itself; instead, it delegates to the ConsoleFormatter
# and (optionally) the LogFileFormatter, which handle the bulk of the logic.
#
module Airbrussh
class Formatter < Airbrussh::DelegatingFormatter
def initialize(io, options_or_config_object={})
config = ::Airbrussh.configuration(options_or_config_object)
# Delegate to ConsoleFormatter and (optionally) LogFileFormatter,
# based on the configuration.
super(config.formatters(io))
end
end
end
require "delegate"
require "fileutils"
require "logger"
require "sshkit"
module Airbrussh
# A Pretty formatter that sends its output to a specified log file path.
# LogFileFormatter takes care of creating the file (and its parent
# directory) if it does not already exist, opens it for appending, and writes
# a delimiter message. The file is automatically rotated if it reaches 20 MB.
#
class LogFileFormatter < SimpleDelegator
attr_reader :path
def initialize(path, formatter_class=SSHKit::Formatter::Pretty)
@path = path
ensure_directory_exists if path.is_a?(String)
super(formatter_class.new(log_file_io))
write_delimiter
end
private
def write_delimiter
delimiter = []
delimiter << "-" * 75
delimiter << "START #{Time.now} cap #{ARGV.join(' ')}"
delimiter << "-" * 75
delimiter.each do |line|
write(SSHKit::LogMessage.new(SSHKit::Logger::INFO, line))
end
end
def ensure_directory_exists
FileUtils.mkdir_p(File.dirname(path))
end
def log_file_io
@io ||= ::Logger.new(path, 1, 20_971_520)
end
end
end
require "rake"
module Airbrussh
module Rake
# Maintains information about what Rake task is currently being invoked,
# in order to be able to decorate SSHKit commands with additional
# context-sensitive information. Works via a monkey patch to Rake::Task,
# which can be disabled via by setting
# Airbrussh.configuration.monkey_patch_rake = false.
#
# Note that this class is not thread-safe. Normally this is not a problem,
# but some Capistrano users are known to use `invoke` to switch the Rake
# task in the middle of an SSHKit thread, which causes Context to get very
# confused. It such scenarios Context is not reliable and may return `nil`
# for the `position` of a command.
#
class Context
def initialize(config=Airbrussh.configuration)
@history = []
@enabled = config.monkey_patch_rake
self.class.install_monkey_patch if enabled?
end
# Returns the name of the currently-executing rake task, if it can be
# determined. If monkey patching is disabled, this will be nil.
def current_task_name
return nil unless enabled?
self.class.current_task_name
end
# Update the context when a new command starts by:
# * Clearing the command history if the rake task has changed
# * Recording the command in the history
#
# Returns whether or not this command was the first execution
# of this command in the current rake task
def register_new_command(command)
reset_history_if_task_changed
first_execution = !history.include?(command.to_s)
history << command.to_s
history.uniq!
first_execution
end
# The zero-based position of the specified command in the current rake
# task. May be `nil` in certain multi-threaded scenarios, so be careful!
def position(command)
history.index(command.to_s)
end
class << self
attr_accessor :current_task_name
def install_monkey_patch
return if ::Rake::Task.instance_methods.include?(:_airbrussh_execute)
::Rake::Task.class_exec do
alias_method :_airbrussh_execute, :execute
def execute(args=nil) # rubocop:disable Lint/NestedMethodDefinition
::Airbrussh::Rake::Context.current_task_name = name.to_s
_airbrussh_execute(args)
end
end
end
end
private
attr_reader :history
attr_accessor :last_task_name
def reset_history_if_task_changed
history.clear if last_task_name != current_task_name
self.last_task_name = current_task_name
end
def enabled?
@enabled
end
end
end
end
# frozen_string_literal: true
module Airbrussh
VERSION = "1.3.0".freeze
end
require "airbrussh/formatter"
# Capistrano's formatter configuration requires that the formatter class
# be in the SSHKit::Formatter namespace. So we declare
# SSHKit::Formatter::Airbrussh that simply functions as an alias for
# Airbrussh::Formatter.
module SSHKit
module Formatter
class Airbrussh < Airbrussh::Formatter
end
end
end
---
engines:
duplication:
enabled: true
config:
languages:
- ruby
fixme:
enabled: true
rubocop:
enabled: false
ratings:
paths:
- "**.rb"
- "bin/*"
- "exe/*"
exclude_paths:
- bundler.gemspec
- "*.md"
- lib/bundler/ssl_certs/*.pem
- lib/bundler/vendor/**/*
- lib/bundler/templates/**/*.tt
- man/*
- spec/**/*
- Rakefile
# Please do not submit patches for including directives to ignore IDE/editor
# generated files. Use a global gitignore as described in
# https://help.github.com/articles/ignoring-files and find useful gitignore
# samples at https://github.com/github/gitignore
# files created by running the specs
/tmp/
# gems built by `rake build`
/pkg/
# output from ronn
/lib/bundler/man/
man/*
!man/*.ronn
# rspec failure tracking
.rspec_status
--format documentation
--color
--warnings
inherit_from:
- .rubocop_todo.yml
AllCops:
TargetRubyVersion: 1.9
Exclude:
- tmp/**/*
- lib/bundler/vendor/**/*
DisplayCopNames: true
# Lint
# They are idiomatic
Lint/AssignmentInCondition:
Enabled: false
Lint/EndAlignment:
EnforcedStyleAlignWith: variable
AutoCorrect: true
Lint/UnusedMethodArgument:
Enabled: false
# Style
Style/AccessModifierIndentation:
EnforcedStyle: outdent
Style/Alias:
EnforcedStyle: prefer_alias_method
Style/AlignParameters:
EnforcedStyle: with_fixed_indentation
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Style/MultilineBlockChain:
Enabled: false
Style/MultilineOperationIndentation:
EnforcedStyle: indented
Style/PerlBackrefs:
Enabled: false
Style/SingleLineBlockParams:
Enabled: false
Style/SpaceInsideBlockBraces:
SpaceBeforeBlockParameters: false
Style/TrivialAccessors:
Enabled: false
# We adopted raise instead of fail.
Style/SignalException:
EnforcedStyle: only_raise
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line.
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingUnderscoreVariable:
Enabled: false
# `String.new` is preferred style with enabled frozen string literal
Style/EmptyLiteral:
Enabled: false
# 1.8.7 support
Style/HashSyntax:
EnforcedStyle: hash_rockets
Style/Lambda:
Enabled: false
Style/DotPosition:
EnforcedStyle: trailing
Style/EachWithObject:
Enabled: false
Style/SpecialGlobalVars:
Enabled: false
Style/TrailingCommaInArguments:
Enabled: false
Performance/FlatMap:
Enabled: false
# Metrics
# We've chosen to use Rubocop only for style, and not for complexity or quality checks.
Metrics/ClassLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/BlockNesting:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Metrics/BlockLength:
Enabled: false
# It will be obvious which code is complex, Rubocop should only lint simple
# rules for us.
Metrics/PerceivedComplexity:
Enabled: false
language: ruby
script: rake spec:travis
before_script:
- travis_retry rake spec:travis:deps
- travis_retry rake man:build
- travis_retry rake spec:rubygems:clone_rubygems_$RGV
branches:
only:
- master
- auto
- /.+-dev$/
- /.+-stable$/
notifications:
slack:
on_success: change
on_failure: always
rooms:
- secure: JxBi7DDJGkIF/7f/FSN/HUHpvV4EKfQccZHTPd1b2pNJn3GXo6u+tNVbAw2WjxYzPyPQI3ZcYBCU9SEXp/i7VmG8uMzh8Kyildw+miSKYKVb90uYqcsXWzbxwyNBgJLvyDkzST45H5lgnyAicee3WkFes/WDZikIajbH7ztdb04=
addons:
code_climate:
repo_token:
secure: "TrzIv116JLGUxm6PAUskCYrv8KTDguncKROVwbnjVPKTGDAgoDderd8JUdDEXrKoZ9qGLD2TPYKExt9/QDl71E+qHdWnVqWv4HKCUk2P9z/VLKzHuggOUBkCXiJUhjywUieCJhI3N92bfq2EjSBbu2/OFHqWOjLQ+QCooTEBjv8="
rvm:
- 2.4.1
- 2.3.4
- 2.2.7
- 2.1.10
- 2.0.0
- 1.9.3
- 1.8.7
# Rubygems versions MUST be available as rake tasks
# see Rakefile:125 for the list of possible RGV values
env:
# We need to know if changes to rubygems will break bundler on release
- RGV=master
# Test the latest rubygems release with all of our supported rubies
- RGV=v2.6.8
matrix:
include:
# Ruby 2.4, Rubygems 2.6.8 and up
# Ruby 2.3, Rubygems 2.5.1 and up
- rvm: 2.2.6
env: RGV=v2.5.2
# Ruby 2.2, Rubygems 2.4.5 and up
- rvm: 2.2.6
env: RGV=v2.4.8
# Ruby 2.1, Rubygems 2.2.2 and up
- rvm: 2.1.10
env: RGV=v2.2.5
# Ruby 2.0.0, Rubygems 2.0.0 and up
- rvm: 2.0.0
env: RGV=v2.2.5
- rvm: 2.0.0
env: RGV=v2.1.11
- rvm: 2.0.0
env: RGV=v2.0.14
# Ruby 1.9.3, Rubygems 1.5.3 and up
- rvm: 1.9.3
env: RGV=v2.2.5
- rvm: 1.9.3
env: RGV=v2.1.11
- rvm: 1.9.3
env: RGV=v2.0.14
- rvm: 1.9.3
env: RGV=v1.8.29
- rvm: 1.9.3
env: RGV=v1.7.2
- rvm: 1.9.3
env: RGV=v1.6.2
- rvm: 1.9.3
env: RGV=v1.5.3
# Ruby 1.8.7, Rubygems 1.3.6 and up
- rvm: 1.8.7
env: RGV=v2.2.5
# ALLOWED FAILURES
# since the great Travis image outage, frequent random segfaults :'(
- rvm: 1.8.7
env: RGV=v2.0.14
- rvm: 1.8.7
env: RGV=v1.8.29
- rvm: 1.8.7
env: RGV=v1.7.2
- rvm: 1.8.7
env: RGV=v1.6.2
- rvm: 1.8.7
env: RGV=v1.5.3
- rvm: 1.8.7
env: RGV=v1.4.2
- rvm: 1.8.7
env: RGV=v1.3.7
- rvm: 1.8.7
env: RGV=v1.3.6
# Ruby-head (we want to know how we're doing, but not fail the build)
- rvm: ruby-head
env: RGV=master
allow_failures:
- rvm: 1.8.7
env: RGV=v2.0.14
- rvm: 1.8.7
env: RGV=v1.8.29
- rvm: 1.8.7
env: RGV=v1.7.2
- rvm: 1.8.7
env: RGV=v1.6.2
- rvm: 1.8.7
env: RGV=v1.5.3
- rvm: 1.8.7
env: RGV=v1.4.2
- rvm: 1.8.7
env: RGV=v1.3.7
- rvm: 1.8.7
env: RGV=v1.3.6
- rvm: ruby-head
env: RGV=master
This diff could not be displayed because it is too large.
# Bundler Code of Conduct
The Bundler project strongly values contributors from anywhere, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, ethnicity, age, religion, or nationality. As a result, the Bundler team has agreed to and enforces this code of conduct in order to provide a harassment-free experience for everyone who participates in the development of Bundler.
### Summary
Harassment in code and discussion or violation of physical boundaries is completely unacceptable anywhere in the Bundler project’s codebases, issue trackers, chat rooms, mailing lists, meetups, and any other events. Violators will be warned and then blocked or banned by the core team at or before the 3rd violation.
### In detail
Harassment includes offensive verbal comments related to level of experience, gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, ethnicity, age, religion, nationality, the use of sexualized language or imagery, deliberate intimidation, stalking, sustained disruption, and unwelcome sexual attention.
Individuals asked to stop any harassing behavior are expected to comply immediately.
Maintainers, including the core team, are also subject to the anti-harassment policy.
If anyone engages in abusive, harassing, or otherwise unacceptable behavior, including maintainers, we may take appropriate action, up to and including warning the offender, deletion of comments, removal from the project’s codebase and communication systems, and escalation to GitHub support.
If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact a member of [the core team](http://bundler.io/contributors.html) or [email the core team](mailto:team@bundler.io) immediately.
We expect everyone to follow these rules anywhere in the Bundler project’s codebases, issue trackers, IRC channel, group chat, and mailing lists.
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
Finally, don't forget that it is human to make mistakes! We all do. Let’s work together to help each other, resolve issues, and learn from the mistakes that we will all inevitably make from time to time.
### Thanks
Thanks to the [JSConf Code of Conduct](http://jsconf.com/codeofconduct.html) and [Fedora Code of Conduct](http://fedoraproject.org/code-of-conduct) for inspiration and ideas. Additional thanks to [Contributor Covenant](http://contributor-covenant.org) for the [default code of conduct](https://github.com/bundler/bundler/blob/master/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt) included in generated gems.
### License
<p class="license" xmlns:dct="http://purl.org/dc/terms/" xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#">
To the extent possible under law, <a rel="dct:publisher" href="http://bundler.io">The Bundler Team</a> has waived all copyright and related or neighboring rights to the <span property="dct:title">Bundler Code of Conduct</span>. This work is published from the <span property="vcard:Country" datatype="dct:ISO3166" content="US" about="http://bundler.io">United States.</span>
<br>
<br>
<a rel="license" href="http://creativecommons.org/publicdomain/zero/1.0/">
<img src="http://i.creativecommons.org/p/zero/1.0/88x31.png" style="border-style: none;" alt="CC0">
</a>
</p>
# Contributing to Bundler
Welcome to Bundler! We are so happy that you're here. We know it can be daunting to joining a new open source project, so here's a quick overview of what you can expect from this documentation.
Bundler welcomes contributions from *everyone*. While contributing, please follow the project [code of conduct](http://bundler.io/conduct.html), so that everyone can be included.
## Quick start
Some guides you might find useful:
* [Submitting pull requests](doc/development/PULL_REQUESTS.md)
* [Filing an issue](doc/contributing/ISSUES.md)
* [Bug triage](doc/contributing/BUG_TRIAGE.md)
## Comprehensive guides
Not finding what you're looking for? More comprehensive guides are [available here](doc/README.md).
Portions copyright (c) 2010 Andre Arko
Portions copyright (c) 2009 Engine Yard
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[![Version ](https://img.shields.io/gem/v/bundler.svg?style=flat)](https://rubygems.org/gems/bundler)
[![Build Status](https://img.shields.io/travis/bundler/bundler/master.svg?style=flat)](https://travis-ci.org/bundler/bundler)
[![Code Climate](https://img.shields.io/codeclimate/github/bundler/bundler.svg?style=flat)](https://codeclimate.com/github/bundler/bundler)
[![Inline docs ](http://inch-ci.org/github/bundler/bundler.svg?style=flat)](http://inch-ci.org/github/bundler/bundler)
# Bundler: a gem to bundle gems
Bundler makes sure Ruby applications run the same code on every machine.
It does this by managing the gems that the application depends on. Given a list of gems, it can automatically download and install those gems, as well as any other gems needed by the gems that are listed. Before installing gems, it checks the versions of every gem to make sure that they are compatible, and can all be loaded at the same time. After the gems have been installed, Bundler can help you update some or all of them when new versions become available. Finally, it records the exact versions that have been installed, so that others can install the exact same gems.
### Installation and usage
To install:
```
gem install bundler
```
Bundler is most commonly used to manage your application's dependencies. To use it for this:
```
bundle init
echo 'gem "rspec"' >> Gemfile
bundle install
bundle exec rspec
```
See [bundler.io](http://bundler.io) for the full documentation.
### Troubleshooting
For help with common problems, see [TROUBLESHOOTING](doc/TROUBLESHOOTING.md).
Still stuck? Try [filing an issue](doc/contributing/ISSUES.md).
### Supporting
<a href="https://rubytogether.org/"><img src="https://rubytogether.org/images/rubies.svg" width=200></a><br/>
Bundler is maintained by <a href="https://rubytogether.org/">Ruby Together</a>, a grassroots initiative committed to supporting the critical Ruby infrastructure you rely on. Contribute today <a href="https://rubytogether.org/developers">as an individual</a> or even better, <a href="https://rubytogether.org/companies">as a company</a>, and ensure that Bundler, RubyGems, and other shared tooling is around for years to come.
### Other questions
To see what has changed in recent versions of Bundler, see the [CHANGELOG](CHANGELOG.md).
To get in touch with the Bundler core team and other Bundler users, please see [getting help](doc/contributing/GETTING_HELP.md).
### Contributing
If you'd like to contribute to Bundler, that's awesome, and we <3 you. There's a guide to contributing to Bundler (both code and general help) over in [our documentation section](doc/README.md).
### Code of Conduct
Everyone interacting in the Bundler project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [Bundler code of conduct](https://github.com/bundler/bundler/blob/master/CODE_OF_CONDUCT.md).
#!/usr/bin/env ruby
# frozen_string_literal: true
load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"]
require "rubygems"
bundler_spec = Gem::Specification.load(File.expand_path("../../bundler.gemspec", __FILE__))
bundler_spec.dependencies.each do |dep|
begin
gem dep.name, dep.requirement
rescue Gem::LoadError => e
$stderr.puts "#{e.message} (#{e.class})"
end
end
Gem.finish_resolve if Gem.respond_to?(:finish_resolve)
load Gem.bin_path("rake", "rake")
#!/usr/bin/env ruby
# frozen_string_literal: true
load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"]
require "rubygems"
bundler_spec = Gem::Specification.load(File.expand_path("../../bundler.gemspec", __FILE__))
bundler_spec.dependencies.each do |dep|
gem dep.name, dep.requirement
end
Gem.finish_resolve if Gem.respond_to?(:finish_resolve)
load Gem.bin_path("rspec-core", "rspec")
#!/usr/bin/env ruby
# frozen_string_literal: true
load File.expand_path("../with_rubygems", __FILE__) if ENV["RGV"]
require "rubygems"
bundler_spec = Gem::Specification.load(File.expand_path("../../bundler.gemspec", __FILE__))
bundler_spec.dependencies.each do |dep|
gem dep.name, dep.requirement
end
gem "rubocop", "= 0.48.0"
Gem.finish_resolve if Gem.respond_to?(:finish_resolve)
load Gem.bin_path("rubocop", "rubocop")
#!/usr/bin/env ruby
# frozen_string_literal: true
require "pathname"
def run(*cmd)
return if system(*cmd)
raise "Running `#{cmd.join(" ")}` failed"
end
version = ENV.delete("RGV")
rubygems_path = Pathname.new(__FILE__).join("../../tmp/rubygems").expand_path
unless rubygems_path.directory?
rubygems_path.parent.mkpath unless rubygems_path.directory?
run("git", "clone", "https://github.com/rubygems/rubygems.git", rubygems_path.to_s)
end
Dir.chdir(rubygems_path) do
version = "v#{version}" if version =~ /\A\d/
run("git", "checkout", version, "--quiet")
end if version
rubygems_lib = rubygems_path + "lib"
ENV["RUBYOPT"] = %(-I#{rubygems_lib} #{ENV["RUBYOPT"]})
if $0 != __FILE__
ARGV.unshift($0)
elsif cmd = ARGV.first
possible_dirs = [
Pathname.new(__FILE__) + "..",
Pathname.new(__FILE__) + "../../exe",
rubygems_path + "bin",
]
cmd = possible_dirs.map do |dir|
dir.join(cmd).expand_path
end.find(&:file?)
ARGV[0] = cmd.to_s if cmd
end
exec(*ARGV)
# coding: utf-8
# frozen_string_literal: true
lib = File.expand_path("../lib/", __FILE__)
$:.unshift lib unless $:.include?(lib)
require "bundler/version"
Gem::Specification.new do |s|
s.name = "bundler"
s.version = Bundler::VERSION
s.license = "MIT"
s.authors = [
"André Arko", "Samuel Giddins", "Chris Morris", "James Wen", "Tim Moore",
"André Medeiros", "Jessica Lynn Suttles", "Terence Lee", "Carl Lerche",
"Yehuda Katz"
]
s.email = ["team@bundler.io"]
s.homepage = "http://bundler.io"
s.summary = "The best way to manage your application's dependencies"
s.description = "Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably"
if s.respond_to?(:metadata=)
s.metadata = {
"bug_tracker_uri" => "http://github.com/bundler/bundler/issues",
"changelog_uri" => "https://github.com/bundler/bundler/blob/master/CHANGELOG.md",
"homepage_uri" => "https://bundler.io/",
"source_code_uri" => "http://github.com/bundler/bundler/",
}
end
s.required_ruby_version = ">= 1.8.7"
s.required_rubygems_version = ">= 1.3.6"
s.add_development_dependency "automatiek", "~> 0.1.0"
s.add_development_dependency "mustache", "0.99.6"
s.add_development_dependency "rake", "~> 10.0"
s.add_development_dependency "rdiscount", "~> 2.2"
s.add_development_dependency "ronn", "~> 0.7.3"
s.add_development_dependency "rspec", "~> 3.5"
s.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
# we don't check in man pages, but we need to ship them because
# we use them to generate the long-form help for each command.
s.files += Dir.glob("man/**/*")
s.bindir = "exe"
s.executables = %w(bundle bundler)
s.require_paths = ["lib"]
end
# Docs: Contributing and developing Bundler
_If you're looking for documentation on how to use Bundler: visit [bundler.io](http://bundler.io/), or run `bundle help` from the command line. You may also be interested in [troubleshooting common issues](TROUBLESHOOTING.md) found when using Bundler._
Bundler welcomes contributions from *everyone*. While contributing, please follow the project [code of conduct](http://bundler.io/conduct.html), so that everyone can be included.
If you'd like to help make Bundler better, you totally rock! Thanks for helping us make Bundler better.
## Contributing
* [Overview & getting started](contributing/README.md)
* [How you can help: your first contributions!](contributing/HOW_YOU_CAN_HELP.md)
* [Bug triage](contributing/BUG_TRIAGE.md)
* [Getting help](contributing/GETTING_HELP.md)
* [Filing issues](contributing/ISSUES.md)
* [Community](contributing/COMMUNITY.md)
## Development
* [Overview](development/README.md)
* [Development setup](development/SETUP.md)
* [Submitting pull requests](development/PULL_REQUESTS.md)
* [Adding new features](development/NEW_FEATURES.md)
* [Releasing Bundler](development/RELEASING.md)
## Documentation
* [Overview](documentation/README.md)
* [Writing docs for man pages](documentation/WRITING.md)
* [Documentation vision](documentation/VISION.md)