Skip to content

Commit

Permalink
Updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Dec 4, 2010
1 parent 783deb6 commit bda4c95
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
11 changes: 5 additions & 6 deletions gemrc
@@ -1,10 +1,9 @@
---
:update_sources: true
gem: --no-ri --no-rdoc
:backtrace: false
:benchmark: false
:verbose: true
:bulk_threshold: 1000
:benchmark: false
:sources:
- http://gems.rubyforge.org/
- http://gemcutter.org/
:update_sources: true
:verbose: true
gem: --no-ri --no-rdoc
- http://production.s3.rubygems.org
4 changes: 4 additions & 0 deletions gitaliases
Expand Up @@ -5,6 +5,7 @@ alias gl='git pull --rebase'
alias rails_im_back='gl && sudo rake gems:install && sudo rake gems:install RAILS_ENV=cucumber && migrate && rake spec cucumber:ok'
alias gp='git push'
alias gpa='git push-all' # see [alias] in ~/.gitconfig
alias gap='git add -p'
alias gd='git diff | mate'
alias ga='git add'
alias gcl='git config --list'
Expand All @@ -20,6 +21,9 @@ alias gk='gitk --all &'
alias grh='git reset HEAD'
alias grhard='git reset --hard'

alias good='git bisect good'
alias bad='git bisect bad'

function gpar() {
for remote in `git remote show`
do
Expand Down
1 change: 0 additions & 1 deletion gitconfig
Expand Up @@ -23,6 +23,5 @@
editor = mate -w
excludesfile = ~/.gitignore
whitespace = fix

[help]
autocorrect = 1
2 changes: 1 addition & 1 deletion inputrc
Expand Up @@ -24,4 +24,4 @@ $endif

# Include system wide settings which are ignored
# by default if one has their own .inputrc
$include /etc/inputrc
$include /etc/inputrc
23 changes: 23 additions & 0 deletions publish.rb
@@ -0,0 +1,23 @@
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
Dir["**/*.xml"].each do |file|

xml = File.read(file)
parsed_file = File.open(file, "w+")

chapter_id = File.basename(file, ".xml")
original_xml = Nokogiri::XML(xml)
nodes = original_xml.xpath("//*")
ids = nodes.map { |n| (n["id"] && n["id"].split("_").last.to_i) || 0 }
last_id = ids.max || 0
new_id = last_id + 1

nodes.each do |e|
next if !e["id"].nil?
e.set_attribute("id", "#{chapter_id}_#{new_id}")
new_id += 1
end

parsed_file.write(original_xml.to_xml)
end

0 comments on commit bda4c95

Please sign in to comment.