{"action":"created","issue":{"url":"https://api.github.com/repos/beanshell/beanshell/issues/79","repository_url":"https://api.github.com/repos/beanshell/beanshell","labels_url":"https://api.github.com/repos/beanshell/beanshell/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/beanshell/beanshell/issues/79/comments","events_url":"https://api.github.com/repos/beanshell/beanshell/issues/79/events","html_url":"https://github.com/beanshell/beanshell/pull/79","id":337306086,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4NTMzNDM2","number":79,"title":"Prompt management in console","user":{"login":"stefanofornari","id":43138,"node_id":"MDQ6VXNlcjQzMTM4","avatar_url":"https://avatars2.githubusercontent.com/u/43138?v=4","gravatar_id":"","url":"https://api.github.com/users/stefanofornari","html_url":"https://github.com/stefanofornari","followers_url":"https://api.github.com/users/stefanofornari/followers","following_url":"https://api.github.com/users/stefanofornari/following{/other_user}","gists_url":"https://api.github.com/users/stefanofornari/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanofornari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanofornari/subscriptions","organizations_url":"https://api.github.com/users/stefanofornari/orgs","repos_url":"https://api.github.com/users/stefanofornari/repos","events_url":"https://api.github.com/users/stefanofornari/events{/privacy}","received_events_url":"https://api.github.com/users/stefanofornari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-01T17:10:04Z","updated_at":"2018-07-02T05:19:52Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/beanshell/beanshell/pulls/79","html_url":"https://github.com/beanshell/beanshell/pull/79","diff_url":"https://github.com/beanshell/beanshell/pull/79.diff","patch_url":"https://github.com/beanshell/beanshell/pull/79.patch"},"body":"This PR is to delegate the management of the prompt to the the ConsoleInterface. This allows a better integration with console libraruies which usually manage the prompt on their own. It seems to be a functionality closer to the responsibility of the console rather than the interpreter.\r\n\r\nIt fundamentally adds a prompt() method to ConsoleInterface so that when Interpreter needs to show the prompt it calls the ConsoleInterface method. The code will probably explain it better than my words :)"},"comment":{"url":"https://api.github.com/repos/beanshell/beanshell/issues/comments/401675181","html_url":"https://github.com/beanshell/beanshell/pull/79#issuecomment-401675181","issue_url":"https://api.github.com/repos/beanshell/beanshell/issues/79","id":401675181,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTY3NTE4MQ==","user":{"login":"nickl-","id":1404606,"node_id":"MDQ6VXNlcjE0MDQ2MDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1404606?v=4","gravatar_id":"","url":"https://api.github.com/users/nickl-","html_url":"https://github.com/nickl-","followers_url":"https://api.github.com/users/nickl-/followers","following_url":"https://api.github.com/users/nickl-/following{/other_user}","gists_url":"https://api.github.com/users/nickl-/gists{/gist_id}","starred_url":"https://api.github.com/users/nickl-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickl-/subscriptions","organizations_url":"https://api.github.com/users/nickl-/orgs","repos_url":"https://api.github.com/users/nickl-/repos","events_url":"https://api.github.com/users/nickl-/events{/privacy}","received_events_url":"https://api.github.com/users/nickl-/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T05:19:52Z","updated_at":"2018-07-02T05:19:52Z","author_association":"MEMBER","body":"@stefanofornari  Thank you for the PR!\r\n\r\nSTATUS: Can't merge: Needs work:\r\n\r\n 1. CheckStyle fails the CI build (see travis).\r\n\r\nThere is a bash script located at [scripts/bsh-code-style-fixup](https://github.com/beanshell/beanshell/blob/merge-fork-beanshell2/scripts/bsh-code-style-fixup) which can help with fixing the white space issues.\r\n\r\n 2. Try and avoid unnecessarily adding additional dependencies.\r\n\r\nyou can use:\r\n\r\n```java\r\nbsh.setExitOnEOF(false);\r\n```\r\n\r\nto prevent `Interpreter.class` from calling `System.exit();` on `EOF` this will save us from having to add the new dependency. Besides I vaguely remember an existing junit rule which should accomplish the same... unless I am mistaken. \r\n\r\nAnyway new dependencies means more work, we need to maintain these dependencies, keeping them updated, checked for vulnerabilities, hope they keep backward compatibility, etc etc etc. The benefit should far outweigh the overhead... please motivate.\r\n\r\n 3. Code freeze\r\n\r\nOr maybe just a code chill =) we all know there is a lot still to be done on BeanShell but we are trying to work towards a stable release. New features are acceptable as long as they address an existing issue. \r\n\r\nIt is not clear what problem the addition of the `prompt()` method aims to resolve. It seems to only wrap the `print` method, so why don't we just stick with print for now? Rather work towards code coverage instead of adding new lines of code which seems counter productive. This topic like all others remain open for discussion, of course.\r\n\r\n 4. Prevent tests from outputting to stdout or stderr. \r\n\r\nIt can be as simple as replacing `System.out` with a custom print stream using `System.setOut`. With Interpreter there are several other options for replacing the output stream in use. You can also look at `Interpeter.redirectOutputToFile(filename)`, this file can then be used for asserts again. Do remember to also delete this on clean up.\r\n"}}
{"actor":{"display_login":"nickl-"}}