Sha256: 158d594c1783d41bf5d058360811cfc5694d1b707d7d588d69ba42ead31bab51
Contents?: true
Size: 938 Bytes
Versions: 61
Compression:
Stored size: 938 Bytes
Contents
class Object # Puts a text in the form: # 12:34:56: text here # def timed_exclaim text exclaim "#{Time.now.strftime("%H:%M:%S")}: #{text}" end # Just outputs the given text to the logger. # # Note: stubbed in spec_helper.rb # def exclaim text Picky.logger.info text Picky.logger.flush end # Puts a text that informs the user of a missing gem. # def warn_gem_missing gem_name, message Picky.logger.warn <<-WARNING Warning: #{gem_name} gem missing! To use #{message}, you need to: 1. Add the following line to Gemfile: gem '#{gem_name}' or require '#{gem_name}' for example at the top of your app.rb file. 2. Then, run: bundle update WARNING end # Indents each line by <tt>amount=2</tt> spaces. # def indented_to_s amount = 2 ary = self.respond_to?(:join) ? self : self.to_s.split("\n") ary.map { |s| "#{" "*amount}#{s}"}.join("\n") end end
Version data entries
61 entries across 61 versions & 1 rubygems