Sha256: 2210a579ad08761bd75b4bf151c44fa3d1ce81f32dfda7de6f4bceb36158fef5

Contents?: true

Size: 801 Bytes

Versions: 80

Compression:

Stored size: 801 Bytes

Contents

module Flydata
  module Command
    class Routine < Base
      def run
        print "#{Time.now} "
        unless flydata.credentials.authenticated?
          raise "Authentication error. Please login."
        end
        log_paths = retrieve_log_paths
        log_paths and log_paths.size() > 0 and log_paths.each { |path|
          if File.exist?(path) and File.writable?(path)
            puts "Start - #{path}. "
            Flydata::LogMonitor.new(path).setup.rotate
          else
            puts "Skip  - #{path}. System cannot access this path."
          end
        }
      end

      private
      def retrieve_log_paths
        data_entries = retrieve_data_entries
        data_entries.map {|e|
          e['log_path'] if e['log_deletion']
        }.compact
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
flydata-0.0.4.1 lib/flydata/command/routine.rb
flydata-0.0.4.0 lib/flydata/command/routine.rb
flydata-0.0.3.8 lib/flydata/command/routine.rb
flydata-0.0.3.7 lib/flydata/command/routine.rb
flydata-0.0.3.6 lib/flydata/command/routine.rb
flydata-0.0.3.5 lib/flydata/command/routine.rb
flydata-0.0.3.4 lib/flydata/command/routine.rb
flydata-0.0.3.3 lib/flydata/command/routine.rb
flydata-0.0.3.2 lib/flydata/command/routine.rb
flydata-0.0.3.1 lib/flydata/command/routine.rb
flydata-0.0.3 lib/flydata/command/routine.rb
flydata-0.0.3.rc1 lib/flydata/command/routine.rb
flydata-0.0.2.3 lib/flydata/command/routine.rb
flydata-0.0.2.2 lib/flydata/command/routine.rb
flydata-0.0.2.1 lib/flydata/command/routine.rb
flydata-0.0.2 lib/flydata/command/routine.rb
flydata-0.0.2.rc1 lib/flydata/command/routine.rb
flydata-0.0.1.2011102901 lib/flydata/command/routine.rb
flydata-0.0.1.nc2 lib/flydata/command/routine.rb
flydata-0.0.1.nc1 lib/flydata/command/routine.rb