Permalink
Browse files

golfing down

  • Loading branch information...
tenderlove committed Sep 6, 2012
1 parent 640014d commit 5edf42ce31cd6f10ed37cbf20a50b174d86fa48b
Showing with 4 additions and 8 deletions.
  1. +1 −1 Rakefile
  2. +3 −7 lib/hana.rb
View
@@ -10,7 +10,7 @@ Hoe.plugin :git # `gem install hoe-git`
Hoe.spec 'hana' do
developer('Aaron Patterson', 'aaron@tenderlovemaking.com')
- self.readme_file = 'README.rdoc'
+ self.readme_file = 'README.md'
self.history_file = 'CHANGELOG.rdoc'
self.extra_rdoc_files = FileList['*.rdoc']
end
View
@@ -12,9 +12,7 @@ def each
@path.each { |x| yield x }
end
- def to_a
- @path.dup
- end
+ def to_a; @path.dup; end
def eval object
Pointer.eval @path, object
@@ -40,11 +38,9 @@ def initialize is
end
def apply doc
- doc = doc.dup
- @is.each { |ins|
+ @is.each_with_object(doc) { |ins, doc|
send ins.keys.sort.first, ins, doc
}
- doc
end
private
@@ -78,7 +74,7 @@ def move ins, doc
dest = Pointer.eval(to, doc)
if Array === dest
- dest.insert(to_key.to_i, obj)
+ dest.insert to_key.to_i, obj
else
dest[to_key] = obj
end

0 comments on commit 5edf42c

Please sign in to comment.