<commit_before>
if Rails::VERSION::STRING.start_with?( "2" )
  # Rails 2.x.x
  gem "activerecord-jdbc-adapter", :lib => "jdbc_adapter"
  gem "org.torquebox.rake-support", :lib => 'torquebox-rails'
else
  text = File.read 'Gemfile'
  File.open('Gemfile', 'w') {|f| f << text.gsub(/^(gem 'sqlite3)/, '# \1') }
  gem "activerecord-jdbc-adapter", "0.9.7", :require => "jdbc_adapter"
  gem "jdbc-sqlite3"
  gem "org.torquebox.rake-support", :require => 'torquebox-rails'
end

# Create app/tasks and app/jobs, just for fun
inside('app') {
  FileUtils.mkdir %w( tasks jobs )
}

# We need the app to find the rake tasks<commit_msg>TORQUE-173 - Adjust template to explicitly set the servlet-based session store for Rails2 and Rails3.<commit_after>
if ( Rails::VERSION::MAJOR == 2 )
  gem "activerecord-jdbc-adapter", :lib => "jdbc_adapter"
  gem "org.torquebox.rake-support", :lib => 'torquebox-rails'
else
  text = File.read 'Gemfile'
  File.open('Gemfile', 'w') {|f| f << text.gsub(/^(gem 'sqlite3)/, '# \1') }
  gem "activerecord-jdbc-adapter", "0.9.7", :require => "jdbc_adapter"
  gem "jdbc-sqlite3"
  gem "org.torquebox.rake-support", :require => 'torquebox-rails'
end

if ( Rails::VERSION::MAJOR == 2 )
  initializer("session_store.rb") do
    <<-INIT
# Configure the TorqueBox Servlet-based session store.
# Provides for server-based, in-memory, cluster-compatible sessions.
( ActionController::Base.session_store = TorqueBox::Session::ServletStore ) if defined?(TorqueBox::Session::ServletStore)
    INIT
  end
else
  remove_file( 'config/initializers/session_store.rb' )
  initializer("session_store.rb") do
    <<-INIT
# Configure the TorqueBox Servlet-based session store.
# Provides for server-based, in-memory, cluster-compatible sessions.
#{app_const}.config.session_store TorqueBox::Session::ServletStore if defined?(TorqueBox::Session::ServletStore)
    INIT
  end
end

# Create app/tasks and app/jobs, just for fun
inside('app') {
  FileUtils.mkdir %w( tasks jobs )
}

# We need the app to find the rake tasks
{'fraction_non_alphanumeric': 0.15510406342913777, 'fraction_numerical': 0.010406342913776016, 'mean_word_length': 4.608333333333333, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4618881', 'n_tokens_mistral': 742, 'n_tokens_neox': 700, 'n_words': 175}