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 'pathname' | |
require 'lib/database_utils' | |
DatabaseUtils.establish_connection | |
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
# call-seq | |
# get_owner_from_svn_log(Pathname("path/to/source.java")) => owner_name | |
# | |
# if 'pathname' doesn't exist or there is no commit history then returns nil | |
def self.get_owner_from_svn_log(pathname) | |
log = `svn log #{pathname}` | |
first_commit_time = nil | |
committers = Hash.new(0) | |
log.reverse_each do |line| | |
if line =~ /^\w+? \| (\w+?) \| (.+?) \(.+?\) \| / |
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
# call-seq | |
# get_owner_from_svn_log(Pathname("path/to/source.java")) => owner_name | |
# | |
# if 'pathname' doesn't exist or there is no commit history then returns nil | |
def self.get_owner_from_svn_log(pathname) | |
log = `svn log #{pathname}` | |
first_commit_time = nil | |
commits = [] | |
log.each do |line| | |
commits << [$1, first_commit_time = Time.parse($2)] if line =~ /^\w+? \| (\w+?) \| (.+?) \(.+?\) \| / |
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
class Source < ActiveRecord::Base | |
belongs_to :owner | |
def self.create_from_pathname(pathname) | |
source = Source.new({:path => "", :tracename => ""}) | |
end | |
private |
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
package com.usps.webservice.msg; | |
public class ResponseWrapper<E> { | |
private Object response = null; | |
public ResponseWrapper(E response) { | |
this.response = response; | |
} | |
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
.svn/prop-base/ZipCodeLookUp.java.svn-base: | |
K 13 | |
svn:eol-style | |
V 6 | |
native | |
END |
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
danlynn:ZIPCodeLookupClient danlynn$ svn proplist --verbose ZipCodeLookUp.java | |
Properties on 'ZipCodeLookUp.java': | |
svn:eol-style | |
native |
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
Failures = Struct.new(:log, :last_success) | |
class Failures | |
def to_s | |
"log=#{log.size}, last_success=#{last_success}" | |
end | |
end | |
Failure = Struct.new(:time, :message) | |
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
Feature: Manage Users | |
In order to manage user details | |
As a security enthusiast | |
I want to edit user profiles only when authorized | |
Scenario Outline: Show or hide edit profile link | |
Given the following user records | |
| username | password | admin | | |
| bob | secret | false | | |
| admin | secret | true | |
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
# XmlObjectParser by Dan Lynn | |
xml_str = <<XMLEND | |
<inventory title="OmniCorp Store #45x10^3"> | |
<section name="health"> | |
<item upc="123456789" stock="12"> | |
<name>Invisibility Cream</name> | |
<price>14.50</price> | |
<description>Makes you invisible</description> | |
</item> |