Skip to content

Instantly share code, notes, and snippets.

View mxriverlynn's full-sized avatar
🏳️‍🌈
coding while trans

River Lynn Bailey mxriverlynn

🏳️‍🌈
coding while trans
View GitHub Profile
@mxriverlynn
mxriverlynn / nant-build-file.xml
Created January 7, 2010 22:47
yet another reason that I love ruby / rake, vs nant
<target name="compress.css" verbose="true" description="compress the css files">
<foreach item="File" property="file.path">
<in>
<items>
<include name="css\*.css" />
</items>
</in>
<do>
<property name="filename" value="css\${path::get-file-name(file.path)}" />
<exec program="java" commandline="-jar ${tools}\YUICompressor\build\yuicompressor-2.4.2.jar --type css -o ${filename} ${filename}" />
module AttrMethods
class << Object
@@array_methods = {}
@@hash_methods = {}
def attr_array(*method_names)
@@array_methods[self] = method_names
end
def attr_hash(*method_names)
@@hash_methods[self] = method_names
# the verbose, annoying to maintain way :(
module MyModule
@@my_attribute = nil
def MyModule.my_attribute=(value)
@@my_attribute = value
end
def MyModule.my_attribute
public static class ServiceBusExtensions
{
public static bool HasSubscribersFor<T>(this IServiceBus serviceBus, T message)
{
IEnumerable<Action<object>> enumerable = serviceBus.OutboundPipeline.Enumerate(message);
return enumerable.Count() > 0;
}
}
class Symbol
def to_setting
self.to_s.gsub("_", " ").gsub(/\b\w/){$&.upcase}.gsub(" ", "")
end
end
:output_dir.to_setting #=> "OutputDir"
require 'albacore'
Albacore::log_level = :verbose
class MSBuild
attr_array :parameters
def run_command(command_name="", command_parameters="")
command_parameters += " #{@parameters.join(' ')}"
super(command_name, command_parameters)
end
nunit :unittests do |nunit|
#you can set the working directory using nunit.command_directory - poorly named, i know. will fix that in next release.
nunit.command_directory = "src/tests/bin/release/"
#note: the path_to_command is relative to the working directory
nunit.path_to_command = "../../../../nunit/nunit-console.exe"
#note: the path to the assemblies is also relative to the working directory
nunit.assemblies "tests.dll"
end
public class SomeNewCode
{
private ISomeOldCode {get; set; }
public SomeNewCode(ISomeOldCode someOldCode)
{
SomeOldCode = someOldCode;
}
}
public interface ISomeOldCode
We couldn’t find that file to show.
require 'albacore'
task :default => [:buildall]
task :buildall do
FileList.new("./**/*.sln").each do |sln|
msbuild "build_#{sln}", [:solution] do |msb, args|
msb.solution = args.solution
msb.targets :clean, :build