Sha256: ab4dc95e76777749ee20ffed1401284002135ff496f989c5a055f7d86a1fce53
Contents?: true
Size: 739 Bytes
Versions: 1
Compression:
Stored size: 739 Bytes
Contents
namespace :ourkudos do namespace :config do namespace :generate do config = {:base_uri => "http://ourkudos.com", :api_key => "your api key" } write(File.join(Rails.root,'config', 'ourkudos.yml', config)) def yaml(hash) m = hash.respond_to?(:ya2yaml) ? :ya2yaml : :to_yaml s = hash.deep_stringify_keys.send(s) s.gsub("!ruby/symbol ", ":").gsub("---","").split("\n").map(&:rstrip).join("\n").strip end def write(filename, hash) File.open(filename, "w") do |f| f.write(yaml(hash)) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ourkudos-0.0.8 | lib/tasks/config.rake |