success-unicorn 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/success_unicorn.rb +82 -0
- metadata +45 -0
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: ab3f5ea8bccee93c582fa4c1298c3c443c9ff7c9
         | 
| 4 | 
            +
              data.tar.gz: 8f2ce87d1b6f2d6962e4660f09c4cd59303238d5
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 6f7065dd2ff493adeb0a076d7a27ff957f2bcc87f114c5dd77c86f3640736d4df43b13894914df895ef8808e3b55c0936063c8904dab765dcb3e589c598071f1
         | 
| 7 | 
            +
              data.tar.gz: 4a8112cf2717df5c50dc0847dc75332f1c6ffd1eb4300a6677341e3f6665aa5d98fa9d6c01047f00e83fea911067fdd7ad663b8c82994c8a851978f05c471b77
         | 
| @@ -0,0 +1,82 @@ | |
| 1 | 
            +
            module SuccessUnicorn
         | 
| 2 | 
            +
              class MessageGenerator
         | 
| 3 | 
            +
                class << self
         | 
| 4 | 
            +
                  def generate(examples)
         | 
| 5 | 
            +
                    examples.none?(&:exception) ? success : error
         | 
| 6 | 
            +
                  end
         | 
| 7 | 
            +
             | 
| 8 | 
            +
             | 
| 9 | 
            +
                  private
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                  def success
         | 
| 12 | 
            +
                    call_printer(message: success_text)
         | 
| 13 | 
            +
                  end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                  def error
         | 
| 16 | 
            +
                    call_printer(message: error_text, failure: true)
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                  def call_printer(message:, failure: false)
         | 
| 20 | 
            +
                    printer ||= Printer.new
         | 
| 21 | 
            +
                    printer.print(message: message, failure: failure)
         | 
| 22 | 
            +
                  end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                  def success_text
         | 
| 25 | 
            +
                    <<END
         | 
| 26 | 
            +
                                           ,|
         | 
| 27 | 
            +
                                         //|                              ,|
         | 
| 28 | 
            +
                                       //,/                             -~ |
         | 
| 29 | 
            +
                                     // / |                         _-~   /  ,
         | 
| 30 | 
            +
                                   /'/ / /                       _-~   _/_-~ |
         | 
| 31 | 
            +
                                  ( ( / /'                   _ -~     _-~ ,/'
         | 
| 32 | 
            +
                                   \\~\\/'/|             __--~~__--\\ _-~  _/,
         | 
| 33 | 
            +
                           ,,)))))));, \\/~-_     __--~~  --~~  __/~  _-~ /
         | 
| 34 | 
            +
                        __))))))))))))));,>/\\   /        __--~~  \\-~~ _-~
         | 
| 35 | 
            +
                       -\\(((((''''(((((((( >~\\/     --~~   __--~' _-~ ~|
         | 
| 36 | 
            +
              --==//////((''  .     `)))))), /     ___---~~  ~~\\~~__--~
         | 
| 37 | 
            +
                      ))| @    ;-.     (((((/           __--~~~'~~/
         | 
| 38 | 
            +
                      ( `|    /  )      )))/      ~~~~~__\\__---~~__--~~--_
         | 
| 39 | 
            +
                         |   |   |       (/      ---~~~/__-----~~  ,;::'  \\         ,
         | 
| 40 | 
            +
                         o_);   ;        /      ----~~/           \\,-~~~\\  |       /|
         | 
| 41 | 
            +
                               ;        (      ---~~/         `:::|      |;|      < >
         | 
| 42 | 
            +
                              |   _      `----~~~~'      /      `:|       \\;\\_____//
         | 
| 43 | 
            +
                        ______/\\/~    |                 /        /         ~------~
         | 
| 44 | 
            +
                      /~;;.____/;;'  /          ___----(   `;;;/
         | 
| 45 | 
            +
                     / //  _;______;'------~~~~~    |;;/\\    /
         | 
| 46 | 
            +
                    //  | |                        /  |  \\;;,\\
         | 
| 47 | 
            +
                   (<_  | ;                      /',/-----'  _>
         | 
| 48 | 
            +
                    \\_| ||_                     //~;~~~~~~~~~
         | 
| 49 | 
            +
                        `\\_|    SUCCESS        (,~~
         | 
| 50 | 
            +
                                                \\~\\
         | 
| 51 | 
            +
                                                 ~~
         | 
| 52 | 
            +
            END
         | 
| 53 | 
            +
                  end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                  def error_text
         | 
| 56 | 
            +
                    <<END
         | 
| 57 | 
            +
                                _-.                       .-_
         | 
| 58 | 
            +
                             _..-'(                       )`-.._
         | 
| 59 | 
            +
                          ./'. '||\\\\.       (\\_/)       .//||` .`\\.
         | 
| 60 | 
            +
                       ./'.|'.'||||\\\\|..    )*.*(    ..|//||||`.`|.`\\.
         | 
| 61 | 
            +
                    ./'..|'.|| |||||\\```````  "  '''''''/||||| ||.`|..`\\.
         | 
| 62 | 
            +
                  ./'.||'.|||| ||||||||||||.     .|||||||||||| ||||.`||.`\\.
         | 
| 63 | 
            +
                 /'|||'.|||||| ||||||||||||{     }|||||||||||| ||||||.`|||`\\
         | 
| 64 | 
            +
                '.|||'.||||||| ||||||||||||{     }|||||||||||| |||||||.`|||.`
         | 
| 65 | 
            +
               '.||| ||||||||| |/'   ``\\||/`     '\\||/''   `\\| ||||||||| |||.`
         | 
| 66 | 
            +
               |/' \\./'     `\\./          |/\\   /\\|          \\./'     `\\./ `\\|
         | 
| 67 | 
            +
               V    V         V          }' `\\ /' `{          V         V    V
         | 
| 68 | 
            +
               `    `         `               U               '         '
         | 
| 69 | 
            +
                                           FAILURE
         | 
| 70 | 
            +
            END
         | 
| 71 | 
            +
                  end
         | 
| 72 | 
            +
                end
         | 
| 73 | 
            +
              end
         | 
| 74 | 
            +
             | 
| 75 | 
            +
              class Printer
         | 
| 76 | 
            +
                def print(message:, failure: false)
         | 
| 77 | 
            +
                  color = failure ? "31" : "32"
         | 
| 78 | 
            +
                  puts "\n"
         | 
| 79 | 
            +
                  puts "\e[#{color}m#{message}\e[0m"
         | 
| 80 | 
            +
                end
         | 
| 81 | 
            +
              end
         | 
| 82 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,45 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: success-unicorn
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.0.1
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Jeff Hostetler
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: bin
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2016-11-11 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies: []
         | 
| 13 | 
            +
            description: RSpec ASCII success and failure thingy
         | 
| 14 | 
            +
            email: fake@example.com
         | 
| 15 | 
            +
            executables: []
         | 
| 16 | 
            +
            extensions: []
         | 
| 17 | 
            +
            extra_rdoc_files: []
         | 
| 18 | 
            +
            files:
         | 
| 19 | 
            +
            - lib/success_unicorn.rb
         | 
| 20 | 
            +
            homepage: 
         | 
| 21 | 
            +
            licenses:
         | 
| 22 | 
            +
            - MIT
         | 
| 23 | 
            +
            metadata: {}
         | 
| 24 | 
            +
            post_install_message: 
         | 
| 25 | 
            +
            rdoc_options: []
         | 
| 26 | 
            +
            require_paths:
         | 
| 27 | 
            +
            - lib
         | 
| 28 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 29 | 
            +
              requirements:
         | 
| 30 | 
            +
              - - ">="
         | 
| 31 | 
            +
                - !ruby/object:Gem::Version
         | 
| 32 | 
            +
                  version: '0'
         | 
| 33 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 34 | 
            +
              requirements:
         | 
| 35 | 
            +
              - - ">="
         | 
| 36 | 
            +
                - !ruby/object:Gem::Version
         | 
| 37 | 
            +
                  version: '0'
         | 
| 38 | 
            +
            requirements: []
         | 
| 39 | 
            +
            rubyforge_project: 
         | 
| 40 | 
            +
            rubygems_version: 2.4.5
         | 
| 41 | 
            +
            signing_key: 
         | 
| 42 | 
            +
            specification_version: 4
         | 
| 43 | 
            +
            summary: RSpec ASCII success and failure thingy
         | 
| 44 | 
            +
            test_files: []
         | 
| 45 | 
            +
            has_rdoc: 
         |