Skip to content

Instantly share code, notes, and snippets.

View tyronet-sportsbet's full-sized avatar

Tyrone Trevorrow tyronet-sportsbet

View GitHub Profile
@tyronet-sportsbet
tyronet-sportsbet / generate_umbrella.rb
Created March 16, 2017 04:00
Generates a naïve umbrella header by assuming every header in the working folder or any of its subfolders is public and should be included
#!/usr/bin/env ruby
# Your umbrella header needs a comment in it like the below so this script
# knows which parts to replace
#
# /* IMPORTS BEGIN */
#
# /* IMPORTS END */
MODULE = ARGV[0] || File.basename(Dir.getwd)
@tyronet-sportsbet
tyronet-sportsbet / remove_missing_headers.rb
Created March 16, 2017 03:52
Searches through a provided Objective-C header and removes any imports to other headers that are not present in any folder under the current working folder tree
#!/usr/bin/env ruby
module_headers = Dir.glob("**/*.h").map {|f| File.basename(f) }
bridging_header = File.read(ARGV[0])
output_header = ""
bridging_header.lines.each do |l|
if match = l.match(/#import\s*"(.*)"/)
header = match.captures[0]
if module_headers.include?(header)