neruda: Check-in [1ec5d2d56e]

A simplistic way to publish a book online

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add some rainbow
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:1ec5d2d56ecda440b9b45d4dcbee49d3d1ddfdb246ce34d8f742a3ecd6d34692
User & Date: milouse 2017-08-30 22:54:09
Context
2017-08-30
22:56
New is replaced by a more generic create_or_edit rake task. Pablo now understand both new and edit command check-in: 1cbee7c621 user: milouse tags: trunk
22:54
Add some rainbow check-in: 1ec5d2d56e user: milouse tags: trunk
22:53
Output an error if the user try any command but setup when their neruda instance is not configured check-in: c8ca1db23e user: milouse tags: trunk
Changes

Changes to lib/tasks/sinatra.rake.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
23
24
25
26
27
28
29
30
31
32
33
34
35
36

require 'rainbow'

namespace :sinatra do
  desc 'Stop the underlaying sinatra application'
  task :stop do
    unless File.exist? 'tmp/pids/neruda.pid'
      STDERR.puts 'No pid file found'
      exit 1
    end
    pid = IO.read('tmp/pids/neruda.pid').strip.to_i
    Process.kill('TERM', pid)
    File.unlink 'tmp/pids/neruda.pid'
    puts Rainbow('Done').green
  end
................................................................................
    begin
      if ENV['APP_ENV'].nil?
        system({ 'APP_ENV' => loc_env }, cmd.join(' '))
      else
        sh(*cmd)
      end
    rescue Interrupt
      puts Rainbow(' Kthxbye').blue
    end
  end

  desc 'Restart local sinatra server'
  task restart: ['sinatra:stop', 'sinatra:start']
end







|







 







|






2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
23
24
25
26
27
28
29
30
31
32
33
34
35
36

require 'rainbow'

namespace :sinatra do
  desc 'Stop the underlaying sinatra application'
  task :stop do
    unless File.exist? 'tmp/pids/neruda.pid'
      STDERR.puts Rainbow('No pid file found').red
      exit 1
    end
    pid = IO.read('tmp/pids/neruda.pid').strip.to_i
    Process.kill('TERM', pid)
    File.unlink 'tmp/pids/neruda.pid'
    puts Rainbow('Done').green
  end
................................................................................
    begin
      if ENV['APP_ENV'].nil?
        system({ 'APP_ENV' => loc_env }, cmd.join(' '))
      else
        sh(*cmd)
      end
    rescue Interrupt
      puts Rainbow('Kthxbye').blue
    end
  end

  desc 'Restart local sinatra server'
  task restart: ['sinatra:stop', 'sinatra:start']
end