runit-man 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/runit-man/app.rb +10 -7
- data/sv/run +3 -1
- data/sv/run.erb +2 -0
- metadata +2 -2
    
        data/lib/runit-man/app.rb
    CHANGED
    
    | @@ -130,9 +130,16 @@ class RunitMan < Sinatra::Base | |
| 130 130 | 
             
              class << self
         | 
| 131 131 | 
             
                def register_as_runit_service
         | 
| 132 132 | 
             
                  create_run_script
         | 
| 133 | 
            -
                   | 
| 134 | 
            -
                   | 
| 135 | 
            -
                   | 
| 133 | 
            +
                  all_r_dir    = File.join(RunitMan.all_services_directory, 'runit-man')
         | 
| 134 | 
            +
                  active_r_dir = File.join(RunitMan.active_services_directory, 'runit-man')
         | 
| 135 | 
            +
                  my_dir       = File.join(GEM_FOLDER, 'sv')
         | 
| 136 | 
            +
                  if File.symlink?(all_r_dir)
         | 
| 137 | 
            +
                    File.unlink(all_r_dir)
         | 
| 138 | 
            +
                  end
         | 
| 139 | 
            +
                  File.symlink(my_dir, all_r_dir)
         | 
| 140 | 
            +
                  unless File.symlink?(active_r_dir)
         | 
| 141 | 
            +
                    File.symlink(all_r_dir, active_r_dir)
         | 
| 142 | 
            +
                  end
         | 
| 136 143 | 
             
                end
         | 
| 137 144 |  | 
| 138 145 | 
             
                def enable_view_of(file_location)
         | 
| @@ -144,10 +151,6 @@ class RunitMan < Sinatra::Base | |
| 144 151 | 
             
                end
         | 
| 145 152 |  | 
| 146 153 | 
             
              private
         | 
| 147 | 
            -
                def do_cmd(command)
         | 
| 148 | 
            -
                  system(command) or raise "Cannot execute #{command}"
         | 
| 149 | 
            -
                end
         | 
| 150 | 
            -
             | 
| 151 154 | 
             
                def create_run_script
         | 
| 152 155 | 
             
                  script_name = File.join(GEM_FOLDER, 'sv', 'run')
         | 
| 153 156 | 
             
                  File.open(script_name, 'w') do |f|
         | 
    
        data/sv/run
    CHANGED
    
    
    
        data/sv/run.erb
    CHANGED
    
    | @@ -1,3 +1,5 @@ | |
| 1 1 | 
             
            #!/bin/sh
         | 
| 2 2 | 
             
            exec 2>&1
         | 
| 3 3 | 
             
            exec runit-man<% if server.kind_of?(String) %> -s "<%= server %>"<% end %><% if bind %> -b <%= bind %><% end %> -p <%= port %> -a "<%= active_services_directory %>" -f "<%= all_services_directory %>"<% files_to_view.each do |f| %> -v "<%= f %>"<% end %>
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            <%= files_to_view.join(',') %>
         |