{"action":"created","issue":{"url":"https://api.github.com/repos/peter-murach/pastel/issues/14","labels_url":"https://api.github.com/repos/peter-murach/pastel/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/peter-murach/pastel/issues/14/comments","events_url":"https://api.github.com/repos/peter-murach/pastel/issues/14/events","html_url":"https://github.com/peter-murach/pastel/issues/14","id":127171746,"number":14,"title":"Provide an option for Pastel to disable color (methods would be no-ops).","user":{"login":"keithrbennett","id":28410,"avatar_url":"https://avatars.githubusercontent.com/u/28410?v=3","gravatar_id":"","url":"https://api.github.com/users/keithrbennett","html_url":"https://github.com/keithrbennett","followers_url":"https://api.github.com/users/keithrbennett/followers","following_url":"https://api.github.com/users/keithrbennett/following{/other_user}","gists_url":"https://api.github.com/users/keithrbennett/gists{/gist_id}","starred_url":"https://api.github.com/users/keithrbennett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithrbennett/subscriptions","organizations_url":"https://api.github.com/users/keithrbennett/orgs","repos_url":"https://api.github.com/users/keithrbennett/repos","events_url":"https://api.github.com/users/keithrbennett/events{/privacy}","received_events_url":"https://api.github.com/users/keithrbennett/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-18T07:50:32Z","updated_at":"2016-01-19T22:55:56Z","closed_at":"2016-01-19T22:54:26Z","body":"(I have not yet started working with this gem, so I apologize in advance if this feature already exists.)\r\n\r\nColored output is very helpful when output to a terminal, but when output to a block device (e.g. by redirecting stdout on the command line to a file), it can be a big problem.  It would be great if Pastel instances had enabled and enabled= methods, or some other way to enable and disable production of the ANSI escape (color) sequences.  Then, the developer could test the stream to see what kind of device it is, and set the enabled attribute accordingly, e.g.\r\n\r\n```ruby\r\npastel.enabled = $stdout.tty?\r\n```\r\n\r\nFor cases where you would want to disable ANSI sequences in files (always, in my opinion), this would eliminate the need to do the test everywhere a pastel method is called.\r\n\r\nThis would also enable use of the same code using Pastel calls for building console messages and log messages, with two separate Pastel instances with different ```enabled``` settings."},"comment":{"url":"https://api.github.com/repos/peter-murach/pastel/issues/comments/173014859","html_url":"https://github.com/peter-murach/pastel/issues/14#issuecomment-173014859","issue_url":"https://api.github.com/repos/peter-murach/pastel/issues/14","id":173014859,"user":{"login":"peter-murach","id":444312,"avatar_url":"https://avatars.githubusercontent.com/u/444312?v=3","gravatar_id":"","url":"https://api.github.com/users/peter-murach","html_url":"https://github.com/peter-murach","followers_url":"https://api.github.com/users/peter-murach/followers","following_url":"https://api.github.com/users/peter-murach/following{/other_user}","gists_url":"https://api.github.com/users/peter-murach/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-murach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-murach/subscriptions","organizations_url":"https://api.github.com/users/peter-murach/orgs","repos_url":"https://api.github.com/users/peter-murach/repos","events_url":"https://api.github.com/users/peter-murach/events{/privacy}","received_events_url":"https://api.github.com/users/peter-murach/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T22:55:56Z","updated_at":"2016-01-19T22:55:56Z","body":"Yes it was intentional, but thank you for pointing it out that contributors may not necessarily appreciate to be forced to use a particular ruby version."}}