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 'rubygems' | |
gem 'nokogiri', ENV['NOKOGIRI_VERSION'] || '1.5.6' | |
require 'nokogiri' | |
xml = <<-XML | |
<xs:schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:ncs="http://www.nationalchildrensstudy.gov" xmlns:ncsdoc="http://www.nationalchildrensstudy.gov/doc" xmlns:xlink="http://www.w3.org/TR/WD-xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.nationalchildrensstudy.gov" elementFormDefault="unqualified" attributeFormDefault="unqualified"> | |
<xs:element ncsdoc:pii="P"/> | |
</xs:schema> | |
XML |
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 'socket' | |
require 'pp' | |
END_COMMUNICATION = "\0" | |
def start_child(n) | |
child_socket, parent_socket = Socket.pair(:UNIX, :DGRAM, 0) | |
maxlen = 1000 | |
pid = fork do |
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
source 'https://rubygems.org' | |
gem 'cancancan' |
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 'pp' | |
require 'rubygems' | |
GEM_NAME = ARGV.pop or fail "Please give a gem name" | |
api_result = `curl http://rubygems.org/api/v1/dependencies?gems=#{GEM_NAME}` | |
pp Marshal.load(api_result).sort_by { |dep| Gem::Version.new(dep[:number]) }.reverse | |
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
task :mustache_check => :environment do | |
require 'mustache/parser' | |
mustache_error = Struct.new(:record_type, :reference_identifier, :error_message) | |
text_error = lambda do |text| | |
begin | |
Mustache::Parser.new.compile(text) | |
nil | |
rescue Mustache::Parser::SyntaxError => e |
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
rm -rf threefoursix | |
rails --version | |
rails new threefoursix --skip-bundle | |
cd threefoursix | |
echo "gem 'surveyor'" >> Gemfile | |
bundle install | |
script/rails g surveyor:install |
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
ACTIVESUPPORT_SOURCE = ARGV.pop | |
if ACTIVESUPPORT_SOURCE | |
if File.directory?(ACTIVESUPPORT_SOURCE) | |
puts "Using ActiveSupport from #{ACTIVESUPPORT_SOURCE}" | |
$LOAD_PATH << ACTIVESUPPORT_SOURCE | |
else ACTIVESUPPORT_SOURCE | |
puts "Using ActiveSupport gem version #{ACTIVESUPPORT_SOURCE}" | |
require 'rubygems' | |
gem 'activesupport', ACTIVESUPPORT_SOURCE |
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
.bundle | |
Gemfile.lock | |
local-bundle |
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
aker-gems.jar | |
gem_home |
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
puts "rspec-core #{RSpec::Core::Version::STRING}" | |
class InstantiationCounter | |
def initialize(k) | |
$count ||= { } | |
$count[k] ||= 0 | |
$count[k] += 1 | |
@k = k | |
end |