<commit_before>def add_project_setting_tag(tag_name, setting, value)
  Around(tag_name) do |scenario, block|
    original_value = APP_CONFIG[setting]
    APP_CONFIG[setting] = value
    block.call
    APP_CONFIG[setting] = original_value
  end
end

add_project_setting_tag('@lightweight', :use_jnlps, false)

{ gses: :use_gse,
  adhoc_workgroups: :use_adhoc_workgroups
  }.each{|tag_name, setting|
    add_project_setting_tag("@enable_#{tag_name}", setting, true)
    add_project_setting_tag("@disable_#{tag_name}", setting, false)
  }<commit_msg>allow connect to localhost during @javascript cukes<commit_after>def add_project_setting_tag(tag_name, setting, value)
  Around(tag_name) do |scenario, block|
    original_value = APP_CONFIG[setting]
    APP_CONFIG[setting] = value
    block.call
    APP_CONFIG[setting] = original_value
  end
end

add_project_setting_tag('@lightweight', :use_jnlps, false)

{ gses: :use_gse,
  adhoc_workgroups: :use_adhoc_workgroups
  }.each{|tag_name, setting|
    add_project_setting_tag("@enable_#{tag_name}", setting, true)
    add_project_setting_tag("@disable_#{tag_name}", setting, false)
  }

# capybara needs to make a connection to the rails app that it starts up
# note Around is broken in cucumber becuase it doesn't happen before the Background steps
# and also note that After happens before the capybara deletes the session so disabling
# the network in an After causes an WebMock failure
Before('@javascript') do
  # only allowing localhost connections will let us track down code that
  # connects to external services, but if that is a problem you can
  # change this to:
  # WebMock.allow_net_connect!
  WebMock.disable_net_connect!(:allow_localhost => true)
end
Before('~@javascript') do
  WebMock.disable_net_connect!
end
{'fraction_non_alphanumeric': 0.09014084507042254, 'fraction_numerical': 0.0, 'mean_word_length': 5.651685393258427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4521042', 'n_tokens_mistral': 584, 'n_tokens_neox': 564, 'n_words': 157}