<commit_before># gsub_file 'config/database.yml', /database: lurker_app.*/, 'database: lurker_app'
# comment_lines 'config/database.yml', /username|password/
file 'config/database.yml', force: true do
  <<-CODE
default: &default
  adapter: postgresql
  encoding: unicode
  database: lurker_app
  pool: 5
test:
  <<: *default
  database: lurker_app_test
development:
  <<: *default
production:
  url: <%= ENV['DATABASE_URL'] %>
  CODE
end

copy_file "#{File.expand_path '../../bin/lurker', __FILE__}", "bin/lurker"
inject_into_file "bin/lurker", before: /require .lurker.$/ do
  <<-CODE
    if (simplecov_root = ENV['SIMPLECOV_ROOT']) && (simplecov_cmdname = ENV['SIMPLECOV_CMDNAME'])
      require 'simplecov'
      SimpleCov.start
      SimpleCov.root simplecov_root
      SimpleCov.command_name "\#{simplecov_cmdname}-binstub"
      SimpleCov.start do
        filters.clear # This will remove the :root_filter that comes via simplecov's defaults
        add_filter do |src|
          !(src.filename =~ /^\#{SimpleCov.root}\\/lib\\/lurker/)
        end
      end
    end
  CODE
end
chmod "bin/lurker", 0755

remove_file 'spec/spec_helper.rb'
remove_file 'app/models/user.rb'

generate 'rspec:install'

route <<-ROUTE
  mount Lurker::Server.to_rack(path: 'html'), at: "/#{Lurker::DEFAULT_URL_BASE}"

  namespace :api do
    namespace :v1 do
      resources :users do
        resources :repos
      end
    end
  end

  root to: redirect('/lurker')<commit_msg>WTF??? fix coveralls overall coverage<commit_after># gsub_file 'config/database.yml', /database: lurker_app.*/, 'database: lurker_app'
# comment_lines 'config/database.yml', /username|password/
file 'config/database.yml', force: true do
  <<-CODE
default: &default
  adapter: postgresql
  encoding: unicode
  database: lurker_app
  pool: 5
test:
  <<: *default
  database: lurker_app_test
development:
  <<: *default
production:
  url: <%= ENV['DATABASE_URL'] %>
  CODE
end

copy_file "#{File.expand_path '../../bin/lurker', __FILE__}", "bin/lurker"
inject_into_file "bin/lurker", before: /require .lurker.$/ do
  <<-CODE
    if (simplecov_root = ENV['SIMPLECOV_ROOT']) && (simplecov_cmdname = ENV['SIMPLECOV_CMDNAME'])
      require 'simplecov'
      SimpleCov.start
      SimpleCov.root simplecov_root
      SimpleCov.command_name "\#{simplecov_cmdname}-binstub"
      SimpleCov.start do
        filters.clear # This will remove the :root_filter that comes via simplecov's defaults
        add_filter do |src|
          # WTF??? if erb_schema_context gets into .resultset.json second time
          # coveralls WONT calculate overall coverage... o_O
          src.filename =~ /erb_schema_context/ || !(src.filename =~ /^\#{SimpleCov.root}\\/lib\\/lurker/)
        end
      end
    end
  CODE
end
chmod "bin/lurker", 0755

remove_file 'spec/spec_helper.rb'
remove_file 'app/models/user.rb'

generate 'rspec:install'

route <<-ROUTE
  mount Lurker::Server.to_rack(path: 'html'), at: "/#{Lurker::DEFAULT_URL_BASE}"

  namespace :api do
    namespace :v1 do
      resources :users do
        resources :repos
      end
    end
  end

  root to: redirect('/lurker')
{'fraction_non_alphanumeric': 0.133888532991672, 'fraction_numerical': 0.003843689942344651, 'mean_word_length': 3.4423897581792318, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 5, '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': '3367917', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1078, 'n_words': 253}