Class: FT_42
- Inherits:
-
Object
- Object
- FT_42
- Defined in:
- lib/ft_42.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ FT_42
constructor
A new instance of FT_42.
Constructor Details
#initialize(*args) ⇒ FT_42
Returns a new instance of FT_42.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/ft_42.rb', line 19 def initialize(*args) if (args.size > 2) if (args.first == "project") puts "This is a big request, it may take a minute or two." if (args.include?("after")) after = args.pop(3).join(" ") after = DateTime.parse(after) args.pop ft_42 = Client.new(args.second, args.last, after) elsif (args.include?("between")) before = args.pop(3).join(" ") before = DateTime.parse(before) args.pop after = args.pop(3).join(" ") after = DateTime.parse(after) args.pop ft_42 = Client.new(args.second, args.last, after, before) else ft_42 = Client.new(args.second, args.last) end else ft_42 = Client.new(args.first, args.third) end else ft_42 = Client.new(args.first) end if (args.first == "project") project = Project.new(ft_42.project) project_users = ProjectUsers.new(ft_42.project_users) project_print = ProjectPrinter.new(project) project_users_print = ProjectUsersPrinter.new(project_users) project_print.all project_users_print.all else user = User.new(ft_42.user) user_sessions = UserSessions.new(ft_42.user_sessions) user_print = UserPrinter.new(user) user_sessions_print = UserSessionsPrinter.new(user_sessions) if args.size == 1 user_print.all user_sessions_print.all elsif args.second == "sessions" user_sessions_print.sessions elsif args.second == "pic" if ENV["TERM_PROGRAM"] == "iTerm.app" system "iterm2-viewer /nfs/intrav2cdn/users/medium_#{args.first}.jpeg" end user_print.all user_sessions_print.all elsif args.second == "progress" user_print.all user_sessions_print.all user_sessions_print. else puts"Wrong arguments. Usage ft_42 [USER_LOGIN] [OPTIONAL CMD]" end end end |