This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler' | |
raise "Pass in local gems like: LOCAL_GEMS=foo,bar bundle ..." unless ENV['LOCAL_GEMS'] | |
LOCAL_GEMS = ENV['LOCAL_GEMS'].split(',') | |
class Bundler::Dsl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'bundler' | |
changelog_file = 'CHANGELOG' | |
entries = "" | |
helper = Bundler::GemHelper.new(Dir.pwd) | |
current_version = "v#{helper.gemspec.version}" | |
starting_version = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
rss = '.+?Rss:\s+(\d+)' | |
share = '.+?Shared_Clean:\s+(\d+)' | |
share << '.+?Shared_Dirty:\s+(\d+)' | |
priv = '.+?Private_Clean:\s+(\d+)' | |
priv << '.+?Private_Dirty:\s+(\d+)' | |
MEM_REGEXP = /\[heap\]#{rss}#{share}#{priv}/m | |
def mem_usage_linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Add your gems here | |
# | |
gemfile_contents = <<-EOF | |
source "http://rubygems.org" | |
gem 'clamp' | |
gem 'iniparse' | |
gem 'rest-client' | |
gem 'json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tmpdir' | |
require 'fileutils' | |
# scope bundling for this script to a directory based on its path | |
tmpdir = "#{Dir.tmpdir}/script_bundler/#{File.expand_path(__FILE__).gsub(/\W+/, '_')}" | |
FileUtils.mkdir_p(tmpdir) | |
gemfile = "#{tmpdir}/Gemfile" | |
gemfile_lock = "#{gemfile}.lock" |