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
# Remove the CSRF Check for Ajax Requests. | |
module ActionController | |
module RequestForgeryProtection | |
def verified_request? | |
!protect_against_forgery? || | |
request.method == :get || | |
request.xhr? || | |
!verifiable_request_format? || | |
form_authenticity_token == params[request_forgery_protection_token] | |
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
exec { "download redis-${version}": | |
command => "wget --output-document redis-${version}.tar.gz https://github.com/antirez/redis/archive/${version}.tar.gz", | |
cwd => '/usr/local/src', | |
path => ['/bin', '/usr/bin'], | |
creates => "/usr/local/src/redis-${version}.tar.gz", | |
} -> exec { "extract redis-${version}": | |
command => "tar xfz redis-${version}.tar.gz", | |
cwd => '/usr/local/src', | |
path => ['/bin', '/usr/bin'], | |
creates => "/usr/local/src/redis-${version}", |
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 require "TclOO" | |
oo::class create oss::class { | |
superclass oo::class | |
constructor { args } { | |
oo::class create [self].Meta | |
next {*}$args |
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
Arthurs-iMac-2:rugged arthur$ bin/rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0 | |
make -f Makefile.embed clean | |
rm -f src/attr.o src/attr_file.o src/blob.o src/branch.o src/buf_text.o src/buffer.o src/cache.o src/checkout.o src/clone.o src/commit.o src/commit_list.o src/compress.o src/config.o src/config_cache.o src/config_file.o src/crlf.o src/date.o src/delta-apply.o src/delta.o src/diff.o src/diff_driver.o src/diff_file.o src/diff_patch.o src/diff_print.o src/diff_tform.o src/diff_xdiff.o src/errors.o src/fetch.o src/fetchhead.o src/filebuf.o src/fileops.o src/filter.o src/fnmatch.o src/global.o src/graph.o src/hash.o src/hashsig.o src/ignore.o src/index.o src/indexer.o src/iterator.o src/merge.o src/merge_file.o src/message.o src/mwindow.o src/netops.o src/notes.o src/object.o src/object_api.o src/odb.o src/odb_loose.o src/odb_pack.o src/oid.o src/pack-objects.o src/pack.o src/path.o src/pathspec.o src/pool.o src/posix.o src/pqueue.o src/push.o src/refdb.o src/refdb_fs.o src/reflog.o src/refs.o src/refsp |
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
Arthurs-iMac-2:rugged arthur$ bin/rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0 | |
make -f Makefile.embed clean | |
rm -f src/attr.o src/attr_file.o src/blob.o src/branch.o src/buf_text.o src/buffer.o src/cache.o src/checkout.o src/clone.o src/commit.o src/commit_list.o src/compress.o src/config.o src/config_cache.o src/config_file.o src/crlf.o src/date.o src/delta-apply.o src/delta.o src/diff.o src/diff_driver.o src/diff_file.o src/diff_patch.o src/diff_print.o src/diff_tform.o src/diff_xdiff.o src/errors.o src/fetch.o src/fetchhead.o src/filebuf.o src/fileops.o src/filter.o src/fnmatch.o src/global.o src/graph.o src/hash.o src/hashsig.o src/ignore.o src/index.o src/indexer.o src/iterator.o src/merge.o src/merge_file.o src/message.o src/mwindow.o src/netops.o src/notes.o src/object.o src/object_api.o src/odb.o src/odb_loose.o src/odb_pack.o src/oid.o src/pack-objects.o src/pack.o src/path.o src/pathspec.o src/pool.o src/posix.o src/pqueue.o src/push.o src/refdb.o src/refdb_fs.o src/reflog.o src/refs.o src/refsp |
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
$:.unshift File.join(File.dirname(__FILE__), "lib") | |
require "rugged" | |
repo = Rugged::Repository.new(".") | |
10000000.times do | |
begin | |
Rugged::Reference.each(repo) do |ref| | |
raise "fail" | |
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
class RepositoryThreadedPushTest < Rugged::SandboxedTestCase | |
def setup | |
super | |
sandbox_init("testrepo.git") | |
@repos = (1..10).collect do |i| | |
sandbox_clone("testrepo.git", "testrepo#{i}.git").tap { |r| r.config['core.bare'] = true } | |
sandbox_clone("testrepo#{i}.git", "testrepo#{i}") | |
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
namespace eval Spec { | |
namespace eval Mocks { | |
nx::Class create MessageExpectation { | |
:property method_name:required | |
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 "benchmark/ips" | |
$LOAD_PATH.unshift("./lib") | |
require "rugged" | |
Benchmark.ips do |x| | |
# Typical mode, runs the block as many times as it can | |
x.report("Rugged::Repository.open") { Rugged::Repository.open("test/fixtures/testrepo.git") } |
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
$ rake test | |
Run options: --seed 60793 | |
# Running tests: | |
..........E.................................................................................... | |
Finished tests in 5.710699s, 16.6354 tests/s, 35.7224 assertions/s. | |
1) Error: |
NewerOlder