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
has_many :parameters_store, :as => :parameterable do | |
def to_hash | |
Hash[*target.map{|p| [p.key, p.vaue]}.flatten] | |
end | |
def from_hash(hash) | |
end | |
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
#!/usr/bin/env ruby | |
## git-rank-contributors: a simple script to trace through the logs and | |
## rank contributors by the total size of the diffs they're responsible for. | |
## A change counts twice as much as a plain addition or deletion. | |
## | |
## Output may or may not be suitable for inclusion in a CREDITS file. | |
## Probably not without some editing, because people often commit from more | |
## than one address. | |
## |
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
function s:GetTestCmd() | |
let test_patterns = {} | |
let test_patterns['_test.rb$'] = "ruby %p" | |
let test_patterns['_spec.rb$'] = "spec -f specdoc %p" | |
for [pattern, cmd] in items(test_patterns) | |
if @% =~ pattern | |
return cmd | |
endif | |
endfor |
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
noremap <unique> <script> <Plug>RubyFileRun <SID>RunFile | |
noremap <SID>RunFile :call <SID>RunTests()<CR> | |
if !hasmapto('<Plug>RubyFileRun') | |
map <unique> <silent> <Leader>t <Plug>RubyFileRun | |
endif |
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
augroup RUBY | |
autocmd! | |
autocmd BufNewFile,BufRead *_test.rb compiler rubyunit | |
augroup 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
| Ebmaj7 Bb-7 | C7 | F-7 Ab-7 | B7 | B-7 | Eb7alt | |
E---------------|----------|--------------|--------|--------|-------------------- | |
B--6-----6------|--6-------|--8-----7-----|--7--7--|--7--7--|--7----------------- | |
G--7-----6------|--6-------|--8-----4-----|--8--8--|--7--7--|--6----------------- | |
D--5-----6------|--8-------|--6-8-6-6-----|--7--7--|--7--7--|--5----------------- | |
A--6------------|----5-6-7-|--8-----------|--------|--------|--6----------------- | |
E--------6---7--|--8-------|--------4-5-6-|--7--7--|--7--7--|-------------------- |
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
/* =Reset */ | |
* { margin: 0; padding: 0; } | |
body, html { height: 100%; } | |
body { font: 62.5%/1.5 Verdana, sans-serif; } | |
ul, ol { list-style: none; } | |
a { outline: none; } | |
a img { border:none; } | |
h1, h2, h3, h4, h5 { font-weight: normal; | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } |
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
## | |
def set_node_reported_at | |
puts '---' | |
puts report.time.inspect | |
node.update_attribute(:reported_at, report.time) | |
puts node.reported_at.inspect # <- wtf? | |
puts '---' | |
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
it "updates the node's reported_at timestamp" do | |
node = Node.generate(:name => @report_data.host) | |
Report.create(:report => @report_yaml) | |
node.reload | |
time_delta = (node.reported_at - @report_data.time).abs | |
(time_delta < 1).should be_true | |
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
'Report on creation updates the node's reported_at timestamp' FAILED | |
expected: Fri, 20 Nov 2009 01:08:50 UTC +00:00, | |
got: Fri, 20 Nov 2009 01:08:50 UTC +00:00 (using ==) |