Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'pry'
- require 'utilise'
- files = Dir.glob('features/**/*.feature')
- reg = Regexp.new(/(\n)(\s{2}# [\w\s]+(?:\n)|)(\s{2}(?:@[\-\w ]+)+(?:\n)|)(\s{2}Scenario:)/)
- numbers = ([1] * 10 + [2] * 10 + [3] * 10)
- # for testing purposes
- # files = ['features/brandwatch/dashboards/components/general/mentions/views/table_view.feature']
- files.each do |file|
- contents = File.read(file)
- split = contents.split(reg)
- feature = split.shift
- if feature.include?('@community')
- feature.sub!('@community', "@community-#{numbers.shift}")
- puts "updated: #{file}"
- end
- feature << split.join()
- File.open(file, 'w') { |f| f.write(feature) }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement