This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BigDecimalWithoutTrailingZeroes < BigDecimal | |
def to_digits | |
_, significant_digits, _, exponent = split | |
if zero? | |
'0' | |
elsif exponent >= significant_digits.size | |
to_i.to_s | |
else | |
to_s('F') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :bundle do | |
def intersection | |
return @outdated if @outdated | |
@outdated = `bundle outdated` | |
@outdated = @outdated.split("\n").select{|line| line.include?("*")} | |
@outdated = @outdated.map{|gem| gem.match(/\* ([a-zA-Z0-9_-]+) /)[1]} | |
app_gems = File.readlines("Gemfile").select{|line| line.include?("gem ")} | |
app_gems = app_gems.map{|gem| gem.match(/gem '([a-zA-Z0-9_-]+)/)[1]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was just a branch off of master. We're not using the Federated path, | |
but we are using SSO (it'd be nice if we could make this a separate setting) | |
"""Logs a user in using a token from Keystone's POST.""" | |
referer = request.META.get('HTTP_REFERER') | |
auth_url = re.sub(r'/auth.*', '', referer) | |
- request.federated_login = True | |
+ request.federated_login = False | |
request.user = auth.authenticate(request=request, auth_url=auth_url) |