You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/cli.rb
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,20 @@ def full
19
19
ProcessLdap.new(**new_options).process
20
20
end
21
21
22
+
desc"daily FROM_DATE","Processes all users in mcommunity modified or created after the FROM_DATE 000000 UTC. For full coverage, the FROM_DATE for a daily cronjob should be yesterday."
23
+
method_option:output_directory,type: :string,required: false,default: S.output_directory,desc: "Path to directory for output files"
24
+
method_option:base_name,type: :string,required: false,default: "patron_daily_#{Date.today.strftime("%Y%m%d")}",desc: "Basename for files put in the output directory"
25
+
method_option:size,type: :numeric,required: false,desc: "The maximum number of results to request"
26
+
defdaily(from_date)
27
+
new_options={
28
+
date: format_date(from_date),
29
+
base_name: options[:base_name],
30
+
output_directory: options[:output_directory],
31
+
size: options[:size]
32
+
}
33
+
ProcessLdapDaily.new(**new_options).process
34
+
end
35
+
22
36
desc"range","processes users for a given date range"
method_option:end_date,type: :string,required: false,desc: "The end of the date range. Inclusive. If not given, it defaults to whatever start_date is."
@@ -54,6 +68,8 @@ def ldap(uniqname)
54
68
defformat_date(date)
55
69
date=DateTime.parse(date)ifdate.is_a?String
56
70
date.strftime("%Y%m%d")
71
+
rescueDate::Error
72
+
abort("ERROR: parameter/option #{date} must be a valid date string\n")
0 commit comments