<commit_before>require 'pathname'

unless defined? Vagrant
  raise "i expect to be required from a Vagrantfile"
end

module VagrantOnRails
  class << self
    def vmware?
      !!(defined? HashiCorp)
    end

    def host_rails_root
      @rails_root ||= begin
        Pathname.pwd.tap do |pwd|
          unless pwd.join('config', 'boot.rb').file?
            raise 'run me with a rails app as PWD, using VAGRANT_CWD to refer to my directory'
          end
        end
      end
    end

    def guest_rails_root
      "/srv/#{app_name}"
    end

    def app_name
      @app_name ||= host_rails_root.basename.to_s
    end

    def hostname
      "#{app_name}.vagrant.dev"
    end

    def ip_address
      "10.20.1.3"
    end

    def box_url
      if vmware?
        'http://files.vagrantup.com/precise64_vmware.box'
      else
        'http://files.vagrantup.com/precise64.box'
      end
    end
  end
end

<commit_msg>support multiple simultaneous apps with a terrible hack<commit_after>require 'pathname'

unless defined? Vagrant
  raise "i expect to be required from a Vagrantfile"
end

module VagrantOnRails
  class << self
    def vmware?
      !!(defined? HashiCorp)
    end

    def host_rails_root
      @rails_root ||= begin
        Pathname.pwd.tap do |pwd|
          unless pwd.join('config', 'boot.rb').file?
            raise 'run me with a rails app as PWD, using VAGRANT_CWD to refer to my directory'
          end
        end
      end
    end

    def guest_rails_root
      "/srv/#{app_name}"
    end

    def app_name
      @app_name ||= host_rails_root.basename.to_s
    end

    def hostname
      "#{app_name}.vagrant.dev"
    end

    def ip_address
      "10.20.1.#{app_name.getbyte(0)}"
    end

    def box_url
      if vmware?
        'http://files.vagrantup.com/precise64_vmware.box'
      else
        'http://files.vagrantup.com/precise64.box'
      end
    end
  end
end


{'fraction_non_alphanumeric': 0.08923884514435695, 'fraction_numerical': 0.010498687664041995, 'mean_word_length': 2.069243156199678, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '6054979', 'n_tokens_mistral': 702, 'n_tokens_neox': 666, 'n_words': 171}