Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor creating Github::Nippou::Settings class #62

Merged
merged 5 commits into from
Aug 6, 2017
Merged

Conversation

masutaka
Copy link
Owner

@masutaka masutaka commented Aug 6, 2017

Related to #59

@masutaka masutaka changed the title Refactor creating Settings class Refactor creating Github::Nippou::Settings class Aug 6, 2017
@masutaka
Copy link
Owner Author

masutaka commented Aug 6, 2017

Refactor と言いつつ、壊れた YAML の時の出力が変わっています。バックトレースが出るようになった。(bundler: failed to load command: (snip) から下の行)

$ bundle exec bin/github-nippou -s 20170804
** YAML syntax error.

(<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 3 column 3
---
:format:
  **!!invalid!!**
  :line: "* [%{title}](%{url}) by %{user} %{status}"
:dictionary:
  :status:
    :merged: "**merged!**************"
    :closed: "**closed!**"

bundler: failed to load command: bin/github-nippou (bin/github-nippou)
Psych::SyntaxError: (<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 3 column 3
  /Users/masutaka/.rbenv/versions/2.4.1/lib/ruby/2.4.0/psych.rb:377:in `parse'
  /Users/masutaka/.rbenv/versions/2.4.1/lib/ruby/2.4.0/psych.rb:377:in `parse_stream'
  /Users/masutaka/.rbenv/versions/2.4.1/lib/ruby/2.4.0/psych.rb:325:in `parse'
  /Users/masutaka/.rbenv/versions/2.4.1/lib/ruby/2.4.0/psych.rb:252:in `load'
(snip)

変更前は exit しており、exit code 0 を返していた。これは CLI として好ましい動作ではない。かと言って、Github::Nippou::Commands と同じ exit! だと(テストを書いているだけに)テストを書くのが難しい。

ユーザーはエンジニアだろうし、バックトレースが出ても良いと思った。

@masutaka masutaka merged commit 8eae797 into master Aug 6, 2017
@masutaka masutaka deleted the settings-class branch August 6, 2017 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant