4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/srs/cli/next-due.rb', line 4
def run!(arguments)
if not SRS::Workspace.initialised? then
puts "Current directory is not an SRS Workspace"
return 3
end
ws = SRS::Workspace.new
schedule = nil
if File.exists? "#{ws.dotsrs}/QUEUED" then
File.open("#{ws.dotsrs}/QUEUED", "r") do |queued_file|
schedule = queued_file.gets
end
end
if schedule == nil then
if File.exists? "#{ws.dotsrs}/REPEAT" then
File.open("#{ws.dotsrs}/REPEAT", "r") do |repeat_file|
schedule = repeat_file.gets
end
end
end
if not schedule == nil then
puts File.basename schedule
end
return 0
end
|