<commit_before>#
#  ApplicationController.rb
#  GitNub
#
#  Created by <NAME> on 3/1/08.
#  Copyright (c) 2008 Active Reload, LLC. All rights reserved.
#
$VERBOSE = nil
require 'rubygems'
require 'osx/cocoa'
require 'mime-types/lib/mime/types'
require 'grit/lib/grit'
require 'lib/time_extensions'
require 'InfoWindowController'

OSX.ns_import 'CommitSummaryCell'
include OSX

REPOSITORY_LOCATION = ENV['PWD'].nil? ? '' : ENV['PWD']

class ApplicationController < OSX::NSObject <commit_msg>Make nub (or open -a GitNub) work from subdirectories<commit_after>#
#  ApplicationController.rb
#  GitNub
#
#  Created by <NAME> on 3/1/08.
#  Copyright (c) 2008 Active Reload, LLC. All rights reserved.
#
$VERBOSE = nil
require 'rubygems'
require 'pathname'
require 'osx/cocoa'
require 'mime-types/lib/mime/types'
require 'grit/lib/grit'
require 'lib/time_extensions'
require 'InfoWindowController'

OSX.ns_import 'CommitSummaryCell'
include OSX

# we use ENV['PWD'] instead of Dir.getwd if it exists so
# `open GitNub` will work, since that launches us at / but leaves ENV['PWD'] intact
pwd = Pathname.new(ENV['PWD'].nil? ? Dir.getwd : ENV['PWD'])
REPOSITORY_LOCATION = pwd + `cd #{pwd} && git rev-parse --git-dir 2>/dev/null`.chomp

class ApplicationController < OSX::NSObject 
{'fraction_non_alphanumeric': 0.131496062992126, 'fraction_numerical': 0.013385826771653543, 'mean_word_length': 4.995283018867925, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1038983', 'n_tokens_mistral': 481, 'n_tokens_neox': 462, 'n_words': 124}