From 9d77662dd8ef039545401711f45cbf4a91190d0f Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Mon, 19 Jan 2015 10:07:58 +0000 Subject: [PATCH] fix syntax highlighting --- .../capistrano-pure-ruby/index.markdown | 1 + .../advanced-features/console/index.markdown | 8 ++++---- .../getting-started/before-after/index.markdown | 12 ++++++------ .../getting-started/local-tasks/index.markdown | 12 ++++++------ .../password-authentication/index.markdown | 4 ++-- documentation/getting-started/tasks/index.markdown | 4 ++-- .../getting-started/user-input/index.markdown | 8 ++++---- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/documentation/advanced-features/capistrano-pure-ruby/index.markdown b/documentation/advanced-features/capistrano-pure-ruby/index.markdown index 97bb8661..ba161bd4 100644 --- a/documentation/advanced-features/capistrano-pure-ruby/index.markdown +++ b/documentation/advanced-features/capistrano-pure-ruby/index.markdown @@ -3,6 +3,7 @@ title: Capistrano in ruby script layout: default --- Instead of building a config folder and deploy, you may want to programmatically set everything in a single ruby script. This could be done as follows: + {% highlight ruby %} require 'capistrano/all' diff --git a/documentation/advanced-features/console/index.markdown b/documentation/advanced-features/console/index.markdown index 0348d2fc..3e5117ad 100644 --- a/documentation/advanced-features/console/index.markdown +++ b/documentation/advanced-features/console/index.markdown @@ -11,13 +11,13 @@ Execute arbitrary remote commands, to use this simply add `require 'capistrano/console'` which will add the necessary tasks to your environment: -``` sh +{% highlight bash %} $ bundle exec cap staging console -``` +{% endhighlight %} Then, after setting up the server connections, this is how that might look: -``` sh +{% highlight bash %} $ bundle exec cap production console capistrano console - enter command to execute on production production> uptime @@ -30,4 +30,4 @@ production> who DEBUG [9ce34809] Command: /usr/bin/env who DEBUG [9ce34809] leehambley pts/0 2013-06-13 17:11 (port-11262.pppoe.wtnet.de) INFO [9ce34809] Finished in 0.420 seconds command successful. -``` +{% endhighlight %} diff --git a/documentation/getting-started/before-after/index.markdown b/documentation/getting-started/before-after/index.markdown index b94b36f6..fab212fb 100644 --- a/documentation/getting-started/before-after/index.markdown +++ b/documentation/getting-started/before-after/index.markdown @@ -5,7 +5,7 @@ layout: default Where calling on the same task name, executed in order of inclusion -``` ruby +{% highlight ruby %} # call an existing task before :starting, :ensure_user @@ -20,12 +20,12 @@ end after :finishing, :notify do # end -``` +{% endhighlight %} If it makes sense for your use case (often, that means *generating a file*) the Rake prerequisite mechanism can be used: -``` ruby +{% highlight ruby %} desc "Create Important File" file 'important.txt' do |t| sh "touch #{t.name}" @@ -36,11 +36,11 @@ task :upload => 'important.txt' do |t| upload!(t.prerequisites.first, '/tmp') end end -``` +{% endhighlight %} The final way to call out to other tasks is to simply `invoke()` them: -``` ruby +{% highlight ruby %} namespace :example do task :one do on roles(:all) { info "One" } @@ -50,6 +50,6 @@ namespace :example do on roles(:all) { info "Two" } end end -``` +{% endhighlight %} This method is widely used. diff --git a/documentation/getting-started/local-tasks/index.markdown b/documentation/getting-started/local-tasks/index.markdown index c21c680d..3d0faa57 100644 --- a/documentation/getting-started/local-tasks/index.markdown +++ b/documentation/getting-started/local-tasks/index.markdown @@ -5,7 +5,7 @@ layout: default Local tasks can be run by replacing `on` with `run_locally`: -```ruby +{% highlight ruby %} desc 'Notify service of deployment' task :notify do run_locally do @@ -14,22 +14,22 @@ task :notify do end end end -``` +{% endhighlight %} Of course, you can always just use standard ruby syntax to run things locally: -```ruby +{% highlight ruby %} desc 'Notify service of deployment' task :notify do %x('RAILS_ENV=development bundle exec rake "service:notify"') end -``` +{% endhighlight %} Alternatively you could use the rake syntax: -```ruby +{% highlight ruby %} desc "Notify service of deployment" task :notify do sh 'RAILS_ENV=development bundle exec rake "service:notify"' end -``` +{% endhighlight %} diff --git a/documentation/getting-started/password-authentication/index.markdown b/documentation/getting-started/password-authentication/index.markdown index dc0d40b3..b95b38aa 100644 --- a/documentation/getting-started/password-authentication/index.markdown +++ b/documentation/getting-started/password-authentication/index.markdown @@ -5,7 +5,7 @@ layout: default Password authentication can be done via `set` and `ask` in your deploy environment file (e.g.: config/deploy/production.rb) -```ruby +{% highlight ruby %} set :password, ask('Server password', nil) server 'server.domain.com', user: 'ssh_user_name', port: 22, password: fetch(:password), roles: %w{web app db} -``` +{% endhighlight %} diff --git a/documentation/getting-started/tasks/index.markdown b/documentation/getting-started/tasks/index.markdown index 632155d6..ed7198c3 100644 --- a/documentation/getting-started/tasks/index.markdown +++ b/documentation/getting-started/tasks/index.markdown @@ -1,4 +1,4 @@ -``` ruby +{% highlight ruby %} server 'example.com', roles: [:web, :app] server 'example.org', roles: [:db, :workers] desc "Report Uptimes" @@ -8,7 +8,7 @@ task :uptime do info "Host #{host} (#{host.roles.to_a.join(', ')}):\t#{capture(:uptime)}" end end -``` +{% endhighlight %} **Note**: diff --git a/documentation/getting-started/user-input/index.markdown b/documentation/getting-started/user-input/index.markdown index ae6c5cb0..da88360d 100644 --- a/documentation/getting-started/user-input/index.markdown +++ b/documentation/getting-started/user-input/index.markdown @@ -3,7 +3,7 @@ title: User Input layout: default --- -``` ruby +{% highlight ruby %} desc "Ask about breakfast" task :breakfast do ask(:breakfast, "pancakes") @@ -11,12 +11,12 @@ task :breakfast do execute "echo \"$(whoami) wants #{fetch(:breakfast)} for breakfast!\"" end end -``` +{% endhighlight %} Perfect, who needs telephones. When using `ask` to get user input, you can pass `echo: false` to prevent the input from being displayed: -```ruby +{% highlight ruby %} ask(:database_password, "default", echo: false) -``` +{% endhighlight %}