ft_42 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/ft_42 +9 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b97751e8896fa2ede78cbd7dd940a0e447170ad2
4
- data.tar.gz: 353737f501a46b2c39e42b4c05026d8c91c16152
3
+ metadata.gz: d767841b4e32ac4ee1a850bd7eaa0b428682eb64
4
+ data.tar.gz: 5cd984c027df793225fb99eb46e197e24683b7e3
5
5
  SHA512:
6
- metadata.gz: fb8fb4d2e2e5511a10a270ba6dee26337be42dfc4cc7c1465af4fac562584cd34f00095adc63ecff31d117e98211a7adf90a661b7c29f22977d072309d16d397
7
- data.tar.gz: 68d26cf4a6e66c426d0be019149835fb1f03a91d72ffda8374a52bbfb0e83eff1c3566dcb7179acf30b69e58b3116800ddb1d78142adbf81f3d45438fc2f7fcb
6
+ metadata.gz: 75e789b750ef553b4ce0a7dfc52eacdddb3e1ae11c9fd829d96915a664b11123d42b72485e8e05438e2bcb6131d7520688f57154558abea12c36cf6303a8eaa5
7
+ data.tar.gz: ca4bebaee42b69ab9d5ad739b22ea407166d0e0331c3cce68fac0e41122e62ddc109674b8252062627384b923db7582d0015787bdce543bc2ce6148a83e1cd61
data/bin/ft_42 CHANGED
@@ -4,6 +4,7 @@ require "action_view"
4
4
  require "pastel"
5
5
  require "oauth2"
6
6
  require "ruby-progressbar"
7
+ require "pp"
7
8
 
8
9
  HOURS_NEEDED = 38
9
10
  USERNAME = ARGV[0]
@@ -55,8 +56,10 @@ puts pastel.bright_green.bold("#{user['first_name']} #{user['last_name']}")
55
56
  active = false
56
57
  sessions.each do |session|
57
58
  if session["begin_at"].to_time - session["end_at"].to_time == -600.0
58
- puts "Is #{pastel.bright_green.bold('active')} at " + pastel.bright_green.bold("#{cluster(session['host'])}") + "."
59
- if active
59
+ unless active
60
+ puts "Is #{pastel.bright_green.bold('active')} at " + pastel.bright_green.bold("#{cluster(session['host'])}") + " computer #{session['host']}."
61
+ end
62
+ unless session["primary"]
60
63
  puts pastel.red.bold("Warning: Logged in on more than one computer. Please logout from #{session['host']} ASAP.")
61
64
  end
62
65
  active = true
@@ -76,6 +79,7 @@ if (percent_complete <= 100)
76
79
  puts progressbar_needed
77
80
  end
78
81
 
79
- puts "Currently working on #{pastel.bright_green.bold(in_progress.to_sentence)}."
80
- puts "You may contact #{user['first_name'].titleize} at #{pastel.bright_green.bold(ActiveSupport::NumberHelper.number_to_phone(phone))}."
81
- puts "Currently level: #{pastel.bright_green.bold(ActiveSupport::NumberHelper.number_to_rounded(user['cursus_users'].select { |cursus| cursus['cursus']['name'] == "42" }.first['level'], precision: 2))}"
82
+ puts "Is working on #{pastel.bright_green.bold(in_progress.to_sentence)}."
83
+ puts "Is level #{pastel.bright_green.bold(ActiveSupport::NumberHelper.number_to_rounded(user['cursus_users'].select { |cursus| cursus['cursus']['name'] == "42" }.first['level'], precision: 2))}"
84
+ puts "Has #{pastel.bright_green.bold(ActionView::Base.new.pluralize(user['correction_point'], 'correction point'))}.#{' *grabs pitchfork*' if user['correction_point'] > 6}"
85
+ puts "You can contact #{user['first_name'].titleize} at #{pastel.bright_green.bold(ActiveSupport::NumberHelper.number_to_phone(phone))}."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ft_42
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Fernandez