크래피를 AA화하고 clappy-say 해 본다

크래피 챌린지 Advent Calendar 2017 19일 기사입니다



최근 콘솔만 바라보고 있기 때문에 콘솔에서 이용 가능한 크래피를 만든다.

완성된 것


# docker run -it miyatama/clappysay:latest cowsay 'PACHI-PACHI!!'
 _______________
< PACHI-PACHI!! >
 ---------------
    \
     \
      \
                     ...(+ggggmmgMMM#Y7WK-
                   .dHBBY9C(JdHWHH=?5^ ?WN-..
                  .dD    .(MY|      .&_ (#9TXx
               ..+W3^   (dMC^   .-. (m{ (M0<dR
               (N0|    jW9?O&_ .Xk< (H{ (HZ>dP
               (#C^    dS:  dr  XMr (@}^(WZ>dR
               (#_     d0<  dr  (Mr .g} (WZ>dR
               (#_     dS:  dr   dr .@} (WZ<db
               (#_     dS:  dr   dr .Hl.(WZ|db
               (#_     dS:  dm,  d& .TMr(Wk~db
               (#_     dK<  dMb  dHl .dr(WN{dNm..
               (#_     dK:   db  jXI  dr.?M{d#'TQ+.
               (#_     dD|   dD  jXI .dr .g{db .dk=
               (#_     d&   ^_^  (<|^ d3  7^db.dHC~
               (#_     dr                     .HC
               (#_     dr                    .s=
               (#_     dR-                   (#|
               (#_     dK<                   (#~
               (#_     dK<                   (#~
               (#_     dK<                   (#~
               (#_     dK:                   (#_
               (Ms.    dK<                   (#_
               (WI_    dK:                   (#|
               (Uk~    dS:                   J#~
                .g{    dm2                  (y=
                 OW{    db.                .dD
                  dm&^  ?XK_              (&M
                   ?B+.  (MH_           .(H&|
                    _7Qg+ _7_          (w=|
                    ..(dMb  dMWWMo.   dm+
                  .(dMY7?|  d& .XMr   ?7Xme-
                .XY=| ^   .-dr  dMr      .TYWx.
               (mkodkkkkkQNNC~ .(MR-.       _jR-.
              jMMMB^     (YWMmgMMMMM8+J,      .m{
             jM#&^          d&|~~~~_.?HNs      ?dl
             dMb           .-gy   (d#_ ?Wp.     dHm
          .jHMMMHNo((JWNNNNMMMD   .dMNHMM#-      dM
        (+gMNmgggMMMM#YTMM#Y7|.+&gd9''|?TN0~     dM
     ..WM=^^^_~_~~<VME~ _^^.(dME|^    .dKC^     .dM
    (Q8|               ^.(gWY|        d8>      Jdf7
  .jW&                 (d9|           dH>  ..(d9:
 .dMNe-              .gV|             dNo.JdMM#_
 dMM%(9&.  ....,    (MB|              7WB9=^ J#_
 MMM&(jM{.(kZWMK.  (d@~                     ^j#_
 |BWa+@| dNdMM&J#_.dD                        J#_
 |-(<|^  (X#C1dS> qHC                        J#_
 MMMNmJJ..(TYY=  .dr                         J#_
 |I?7HMMMNms.    zW{                         J#_
 MNa&J-_?7TY^    zW>                         J#_
 Mz~?TMMHm&-     zW{                         (#~
 zH:   ?77'^     zX{                         (#_
  ?WHm.           dr                .k:      (#~
    ?74Qa-        ?Gx             .(gN{      (#~
       <?THK-  ..  ?WN-..........dH9UM{      (#~
           |_jdQmggx(?7HNNQQQM@?7?  (H{      (#~
               (#C|7YWMHY3  dD|    (MN{      (#~
               (#~   .Hl_   dr     (#=       (#~
               (#_   .H2    dr     (#_       (#~
               (#_   .@}    dr     (#_       (#~
               (#_   .@|    dr     (#_       (#~
               (#_   .g{    dr     (#_       (#~
              .d#_   .g{    dr     (#_       (#_
              JH8    .@|    dr    .d#_       (#|
              JR<   .gN{   .Mr    (d#        (#_
              dR<   (MB:   (Mr    (d@        (N+.
              dK    (#_    (Wr    (d@        (MN:
              db    (#_   .(Wr    (d@.       (MM:
              dN+-. (#_ .(kS7|    (d@        (#>
               (TMNmuNad#Y|       (dK.      .j#~
                .MMYvM=?          jH@     .gH8|
                .MH>              dM&    .H9:
                .Xb>              d@   .jKC
                .WNl              db .(Z=
                  ?THR...         vD.X:
                    _TYYWaJ..  .J+JJY
                         (dMNNNNkZ>


만들고 있어 무엇이지만, 작은 AA를 갖고 싶다.

일단 git에도 올렸다. miyatama/clappysay

만드는 과정



AA화



즐겁게 크래피 이미지를 다운로드하고,
코코라든지 코코로 AA화한다.



대단하다.

whalesay를 개조하여 clappysay 만들기



docker 설치하고 즐겁게 pull
docker pull docker/whalesay:latest

AA화한 크래피를 clappy.cow로 저장하고 image로 가져온다.
FROM docker/whalesay:latest

COPY clappy.cow /usr/local/share/cows/clappy.cow

RUN rm -f /usr/local/share/cows/default.cow \
  && ln -sv /usr/local/share/cows/clappy.cow /usr/local/share/cows/default.cow

CMD ["cowsay"]

빌드 및 실행
docker build -t miyatama/clappysay:latest .
docker run miyatama/clappysay:latest cowsay complete

했어! 오류입니다!
cowsay: Unterminated <> operator at /usr/local/share/cows/default.cow line 10.

오류를 잡다



clappy.cow의 내용적으로 히어 문서 같은.
무슨 히어 문서인지 알 수 없기 때문에 cowsay 속을 살펴본다.
#!/usr/bin/perl

##
## Cowsay 3.03
##
## This file is part of cowsay.  (c) 1999-2000 Tony Monroe.
##

use Text::Tabs qw(expand);
use Text::Wrap qw(wrap fill $columns);
use File::Basename;
use Getopt::Std;
use Cwd;

cowsay... 너 펄이었나...

우선 perl의 히어 문서가 어떤 것인지를 본다
  • Perl 히어 문서

  • 일단 오류가 될 것 같은 사람을 대체하십시오.
  • $
  • @ {

  • 잘 나왔다.
    docker run -it miyatama/clappysay:latest cowsay miyatama
    c7ee9840a46d
    c7ee9840a46d
     __________
    < miyatama >
     ----------
        \
         \
          \
                         ...(+ggggmmgMMM#Y7WK-
                       .dHBBY9C(JdHWHH=?5^ ?WN-..
                      .dD    .(MY|      .&_ (#9TXx
                   ..+W3^   (dMC^   .-. (m{ (M0<dR
                   (N0|    jW9?O&_ .Xk< (H{ (HZ>dP
                   (#C^    dS:  dr  XMr (@}^(WZ>dR
                   (#_     d0<  dr  (Mr .g} (WZ>dR
                   (#_     dS:  dr   dr .@} (WZ<db
                   (#_     dS:  dr   dr .Hl.(WZ|db
                   (#_     dS:  dm,  d& .TMr(Wk~db
                   (#_     dK<  dMb  dHl .dr(WN{dNm..
                   (#_     dK:   db  jXI  dr.?M{d#'TQ+.
                   (#_     dD|   dD  jXI .dr .g{db .dk=
                   (#_     d&   ^_^  (<|^ d3  7^db.dHC~
                   (#_     dr                     .HC
                   (#_     dr                    .s=
                   (#_     dR-                   (#|
                   (#_     dK<                   (#~
                   (#_     dK<                   (#~
                   (#_     dK<                   (#~
                   (#_     dK:                   (#_
                   (Ms.    dK<                   (#_
                   (WI_    dK:                   (#|
                   (Uk~    dS:                   J#~
                    .g{    dm2                  (y=
                     OW{    db.                .dD
                      dm&^  ?XK_              (&M
                       ?B+.  (MH_           .(H&|
                        _7Qg+ _7_          (w=|
                        ..(dMb  dMWWMo.   dm+
                      .(dMY7?|  d& .XMr   ?7Xme-
                    .XY=| ^   .-dr  dMr      .TYWx.
                   (mkodkkkkkQNNC~ .(MR-.       _jR-.
                  jMMMB^     (YWMmgMMMMM8+J,      .m{
                 jM#&^          d&|~~~~_.?HNs      ?dl
                 dMb           .-gy   (d#_ ?Wp.     dHm
              .jHMMMHNo((JWNNNNMMMD   .dMNHMM#-      dM
            (+gMNmgggMMMM#YTMM#Y7|.+&gd9''|?TN0~     dM
         ..WM=^^^_~_~~<VME~ _^^.(dME|^    .dKC^     .dM
        (Q8|               ^.(gWY|        d8>      Jdf7
      .jW&                 (d9|           dH>  ..(d9:
     .dMNe-              .gV|             dNo.JdMM#_
     dMM%(9&.  ....,    (MB|              7WB9=^ J#_
     MMM&(jM{.(kZWMK.  (d@~                     ^j#_
     |BWa+@| dNdMM&J#_.dD                        J#_
     |-(<|^  (X#C1dS> qHC                        J#_
     MMMNmJJ..(TYY=  .dr                         J#_
     |I?7HMMMNms.    zW{                         J#_
     MNa&J-_?7TY^    zW>                         J#_
     Mz~?TMMHm&-     zW{                         (#~
     zH:   ?77'^     zX{                         (#_
      ?WHm.           dr                .k:      (#~
        ?74Qa-        ?Gx             .(gN{      (#~
           <?THK-  ..  ?WN-..........dH9UM{      (#~
               |_jdQmggx(?7HNNQQQM@?7?  (H{      (#~
                   (#C|7YWMHY3  dD|    (MN{      (#~
                   (#~   .Hl_   dr     (#=       (#~
                   (#_   .H2    dr     (#_       (#~
                   (#_   .@}    dr     (#_       (#~
                   (#_   .@|    dr     (#_       (#~
                   (#_   .g{    dr     (#_       (#~
                  .d#_   .g{    dr     (#_       (#_
                  JH8    .@|    dr    .d#_       (#|
                  JR<   .gN{   .Mr    (d#        (#_
                  dR<   (MB:   (Mr    (d@        (N+.
                  dK    (#_    (Wr    (d@        (MN:
                  db    (#_   .(Wr    (d@.       (MM:
                  dN+-. (#_ .(kS7|    (d@        (#>
                   (TMNmuNad#Y|       (dK.      .j#~
                    .MMYvM=?          jH@     .gH8|
                    .MH>              dM&    .H9:
                    .Xb>              d@   .jKC
                    .WNl              db .(Z=
                      ?THR...         vD.X:
                        _TYYWaJ..  .J+JJY
                             (dMNNNNkZ>
    
    

    좋은 웹페이지 즐겨찾기