GithubHelp home page GithubHelp logo

sckott / cowsay Goto Github PK

View Code? Open in Web Editor NEW
292.0 11.0 47.0 5.35 MB

cowsay w/ more animals, in R

Home Page: https://sckott.github.io/cowsay/

License: Other

R 8.62% Makefile 0.06% HTML 91.02% CSS 0.30%
ascii-art rstats r r-stats

cowsay's Introduction

cowsay's People

Contributors

aedobbyn avatar ateucher avatar bgreenwell avatar brandmaier avatar brandongreenwell-8451 avatar cpsievert avatar davharris avatar florianm avatar guangchuangyu avatar jeremycg avatar kbroman avatar leeper avatar lucymcgowan avatar marionlouveaux avatar mnr avatar noamross avatar onertipaday avatar pboesu avatar richfitz avatar sckott avatar trinker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cowsay's Issues

buffalo

See tweets from Vince buffalo and company...

Prints everything to stderr instead of stdout

This example prints nothing if run in bash:

Rscript - 2>/dev/null <<!
library(cowsay)
say("Hello, Kitty!", "stretchycat")
!

It means that even the kitty is going to stderr, which is IMO unexpected.

I found this after trying to silence an annoying "error" message that seems
to be printed unconditionally if the crayon package isn't run on a color terminal.

Colors cannot be applied in this environment :( Try using a terminal or RStudio.

I would humbly request to not treat animals as if they were errors, which is surely not in the spirit of this package, and to respect people who pefer uncolored pets on their text terminals by default (don't print the message, just don't output colors in this case).

Standardize the spacing above animals' speech bubbles?

Spacing above the text differs depending on the animal, e.g. cat vs. chicken.

I think the cat spacing is preferable because there's a smaller gap, but fine as long as they're standard imo. (Removing the "Colors cannot be applied in this environment :( Try using a terminal or RStudio." line in the reprex below for simplicity.)

library(cowsay)

say(by = "cat")
#> 
#>  -------------- 
#> Hello world! 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#> 

say(by = "chicken")
#> 
#> 
#>  ----- 
#> Hello world! 
#>  ------ 
#>     \   
#>      \
#>          _
#>        _/ }
#>       `>' \
#>       `|   \
#>        |   /'-.     .-.
#>         \'     ';`--' .'
#>          \'.    `'-./
#>           '.`-..-;`
#>             `;-..'
#>             _| _|
#>             /` /` [nosig]
#> 

Created on 2019-01-23 by the reprex package (v0.2.1)

retrojunkie.com is offline

The www.retrojunkie.com site, linked from the README under "Where to find ASCII animal art", is offline. The hostname isn't even resolving, so it looks like it may be gone for good. Should the link be removed from the README?

$ ping retrojunkie.com
ping: cannot resolve retrojunkie.com: Unknown host
$ ping www.retrojunkie.com
ping: cannot resolve www.retrojunkie.com: Unknown host

encoding on windows

Hey @noamross @richfitz @trinker @leeper

We're having problems with this pkg on windows. E.g.,

screen shot 2014-09-18 at 8 58 48 am

But on unix does

say("asdfsf", "longcat", length = 4)

 ----- 
 asdfsf 
 ------ 
    \   
     \
    .ハ,,ハ
    ( ゚ω゚)
    |つ  つ
    |    |
    |    |
    |    |
    |    |
    U " U

This is what longcat is in the pkg:

  longcat <-
    '
\n ----- \n %s \n ------ \n    \\\   \n     \\\
    .\uFF8A,,\uFF8A
    ( \uFF9F\u03C9\uFF9F)
    |\u3064  \u3064
%s
    U " U
    '

Any way to fix this to work on windows?

Distinct project name, like "Rcowsay"?

Any chance of renaming this project and repo to "rcowsay" or something similar, to distinguish it from the original command line (Perl) cowsay and implementations in other languages, like the Java-based ricksbrown/cowsay? It would make discussing them a bit easier, and would make contributing to multiple cowsay projects easier with GitHub forks. Right now if I fork both projects, one of them ends up as "apjanke/cowsay-1", which isn't very descriptive.

why is animals object not exported?

subject says it all.

I would love to just be able to import animals with ::, as opposed to ::: (which has build checks yell at me).

An easy way to allow people (like my lazy self) to get cowsay animals without having to use ::: would be something like

#' @export
getAnimal <- function(animalName) {
    return(animals[animalName])
}

Just an idea, though...

'catfact' error

I'm getting an error trying to get a 'catfact'

say("catfact")
Error in open.connection(con, "rb") : HTTP error 503.

say(what = "catfact")
Error in open.connection(con, "rb") : HTTP error 503.

say(what = "catfact", by = "cat")
Error in open.connection(con, "rb") : HTTP error 503.

cowsay::say(what = "catfact", by = "cat")
Error in open.connection(con, "rb") : HTTP error 503.

Coming from this line

jsonlite::fromJSON("http://catfacts-api.appspot.com/api/facts?number=1")$facts

And going to that url shows the error

Python 2.5 is no longer available. Please refer to https://goo.gl/aESk5L for more information.


Session info ---------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.4 (2018-03-15)
 system   x86_64, darwin15.6.0        
 ui       RStudio (1.1.414)           
 language (EN)                        
 collate  en_AU.UTF-8                 
 tz       Australia/Melbourne         
 date     2018-04-06                  

Packages -------------------------------------------------------------------------------------------------------------------
 package    * version    date       source                          
 base       * 3.4.4      2018-03-15 local                           
 compiler     3.4.4      2018-03-15 local                           
 cowsay     * 0.5.0      2016-12-16 CRAN (R 3.4.0)                  
 curl         3.0        2017-10-06 CRAN (R 3.4.2)                  
 datasets   * 3.4.4      2018-03-15 local                           
 devtools     1.13.4     2017-11-09 CRAN (R 3.4.2)                  
 digest       0.6.15     2018-01-28 cran (@0.6.15)                  
 fortunes     1.5-4      2016-12-29 CRAN (R 3.4.0)                  
 graphics   * 3.4.4      2018-03-15 local                           
 grDevices  * 3.4.4      2018-03-15 local                           
 jsonlite     1.5        2017-06-01 cran (@1.5)                     
 memoise      1.1.0      2018-01-08 Github (hadley/memoise@611cfad) 
 methods    * 3.4.4      2018-03-15 local                           
 rmsfact      0.0.3      2016-08-04 CRAN (R 3.4.0)                  
 rstudioapi   0.7        2017-09-07 cran (@0.7)                     
 stats      * 3.4.4      2018-03-15 local                           
 tools        3.4.4      2018-03-15 local                           
 utils      * 3.4.4      2018-03-15 local                           
 withr        2.1.1.9000 2018-03-13 Github (jimhester/withr@5d05571)
 yaml         2.1.16     2017-12-12 cran (@2.1.16)

Remove speech bubble from ascii

It seems like the default way of specifying animals forces speech bubbles within the elements of the animals object, causing the output to be less pretty compared to the command line alternative.

< hello >
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

vs

 ----- 
hello 
 ------ 
    \   ^__^ 
     \  (oo)\ ________ 
        (__)\         )\ /\ 
             ||------w|
             ||      ||

This can be solved by giving the responsibility of creating the speech bubble to say function. Would this be a welcome change? I can look into it if I find some spare time.

Weird RJSONIO-jsonlite error upon import

When I import cowsay into my package, then install it (via devtools::install), I get the following error:

Note: the specification for S3 class “AsIs” in package ‘RJSONIO’ seems equivalent to one from package ‘jsonlite’: not turning on duplicate class definitions for this class.

Any idea that what's about?

Simplifying color argument

Hey Scott,

Just wondering, would it be possible to add functionality to say() that would allow for a single color argument? Having separate arguments for what_color and by_color is necessary. Most of the time, though, I specify these to be the same color. It would be nice to specify color = "blue", for example, and have that be equivalent to what_color = "blue", by_color = "blue".

Love the package by the way. Makes my coding work flow a little more fun :-)


thanks!

\   ^__^ 
 \  (oo)\ ________ 
    (__)\         )\ /\ 
         ||------w|
         ||      ||

--Ethan

No message when colors are NULL?

I am using cowsay in an R Markdown document and I get a message about colors despite my not using them e.g. (reprex uses knitr so you'll see the problem)

cowsay::say("rms", "rms")
#> Colors cannot be applied in this environment :( Try using a terminal or RStudio.
#> 
#> 
#>  ----- 
#> Richard Stallman won a Sudoku that started with only one number in each line. 
#>  ------ 
#>     \   
#>      \
#>                     @@@@@@ @
#>                   @@@@     @@
#>                  @@@@ =   =  @@ 
#>                 @@@ @ _   _   @@ 
#>                  @@@ @(0)|(0)  @@ 
#>                 @@@@   ~ | ~   @@
#>                 @@@ @  (o1o)    @@
#>                @@@    #######    @
#>                @@@   ##{+++}##   @@
#>               @@@@@ ## ##### ## @@@@
#>               @@@@@#############@@@@
#>              @@@@@@@###########@@@@@@
#>             @@@@@@@#############@@@@@
#>             @@@@@@@### ## ### ###@@@@
#>              @ @  @              @  @
#>                @                    @

Created on 2018-10-05 by the reprex package (v0.2.1)

Maybe

cowsay/R/say.r

Line 135 in 1a1a590

if (crayon::has_color() == FALSE) {

could also check whether the two color arguments are NULL?

Fix file request from CRAN

You have file 'cowsay/man/cowsay.Rd' with \docType{package}, likely
intended as a package overview help file, but without the appropriate
PKGNAME-package \alias as per "Documenting packages" in R-exts.

This seems to be the consequence of the breaking change

Using @doctype package no longer automatically adds a -package alias.
Instead document _PACKAGE to get all the defaults for package
documentation.

in roxygen2 7.0.0 (2019-11-12) having gone unnoticed, see
r-lib/roxygen2#1491.

As explained in the issue, to get the desired PKGNAME-package \alias
back, you should either change to the new approach and document the new
special sentinel

"_PACKAGE"

or manually add

@Aliases cowsay-package

if remaining with the old approach.

Please fix in your master sources as appropriate, and submit a fixed
version of your package within the next few months.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.