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 ensure DreddHooks::Server can be used as library #10

Closed

Commits on Apr 24, 2016

  1. Add default Rake task

    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    9c493f4 View commit details
    Browse the repository at this point in the history
  2. Refactor default to use Rake for testing

    There is a quite widespread convention that the default Rake task
    runs the test suite (Travis CI uses it for example).
    
    Running the Cucumber features using running 'cucumber'
    (resp. 'bundle exec cucumber') is still possible. Also more
    Rake tasks could be added for convenience, and the debug scenarios
    cold be run using 'rake cucumber:debug' for example.
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    11323c6 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'refactor-normalize-test-suite-usage'

    As a Ruby developer new to this project
    In order to get started quickly
    And know which part of the test suite is intended to be run daily
    When I run rake
    Then I want to see the entire test suite output
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    3e186e7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1518760 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'add-changelog'

    As a developer who considers updating Dredd Hooks Ruby
    In order to have a clear idea of which changes I should expect
    I want them described in a CHANGELOG
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    6fd3467 View commit details
    Browse the repository at this point in the history
  6. Add Gemfile.lock

    This file SHOULD NOT be ignored, because it is the only way to
    ensure the bundle consitency accross different repositories.
    
    It should never be edited by hand either, and any change to the
    Gemfile or gemspec should be committed with the corresponding
    Gemfile.lock - run 'bundle install' to update the lock.
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    02b0e11 View commit details
    Browse the repository at this point in the history
  7. Workaround broken test suite

    The 'bundle exec rake' command did fail with message:
    
        $ bundle exec rake
        Feature: Execution order
    
        Killed: 9
    
    I suspect that the error was shadowed because the Gemfile.lock was missing,
    but I am not sure exactly why. (Travis seems to be using the new
    'features/support/env.rb and still doing fine.)
    
    Anyway, the error is present in my development env. since 8dc3e26
    and appeared in Travis CI when I added the Gemfile.lock.
    
    See https://travis-ci.org/gonzalo-bulnes/dredd-hooks-ruby/jobs/125324433
    
    This commit partially reverts 8dc3e26
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    815a942 View commit details
    Browse the repository at this point in the history
  8. Workaround DreddHooks::Server leftover by test suite

    The TCP Server feature starts a server but doesn't stop it.
    This breaks the next test suite run unless the server is manually
    killed, which is unpractical.
    
    I think it's best to remove the entire feature until findinf a proper
    fix to this issue and 7330c74
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    80c26f2 View commit details
    Browse the repository at this point in the history
  9. Move to semantic versioning

    Bump version number
    Minor remove excessive installation details
    
    Installing gems manually ('gem install dredd_hooks') is always possible,
    however, if you who needs it to be mentionned in the README, you are
    probably not familar with Ruby and should use a Gemfile.
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    3dbc490 View commit details
    Browse the repository at this point in the history
  10. Update CHANGELOG

    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    234f499 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'move-to-semantic-versioning'

    As a developer
    In order to be able to update my dependencies automatically
    And to be sure their maintainers care about their API
    I want their version numbers to convey meaning
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    bc9e607 View commit details
    Browse the repository at this point in the history
  12. Add License section

    Update copyright notice
    See https://opensource.org/licenses/MIT
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    6962de0 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    68422fb View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    f2a3647 View commit details
    Browse the repository at this point in the history
  15. Add Gemnasium badge

    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    e347458 View commit details
    Browse the repository at this point in the history
  16. Update Travis CI badge

    The builds on my account are up-to-date, and the README will anyway
    be edited when merging upstream.
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    17db061 View commit details
    Browse the repository at this point in the history
  17. Add Inch CI badge

    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    f1f26d0 View commit details
    Browse the repository at this point in the history
  18. Add CodeClimate badge

    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    fb88bca View commit details
    Browse the repository at this point in the history
  19. Merge branch 'minor-refactor-readme-for-readability'

    As a dredd-hooks-ruby user
    In order to know the project status
    And be able to read the documentation in a terminal
    I want its README to be formatted for source readability
    And to display build, dependencies, code climate and inline doc badges
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    19261f9 View commit details
    Browse the repository at this point in the history
  20. Add copyright notice

    Since the contribution is substantial, and following the usage
    instructions described in https://www.gnu.org/licenses/gpl-howto.html
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    13b1c0f View commit details
    Browse the repository at this point in the history
  21. Refactor simplify file lists in gemspec

    These lists of files are not modified often, and the Git versions
    are cryptic enough to allow useless files to be added to the gem.
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    c19900e View commit details
    Browse the repository at this point in the history
  22. Refactor remove unused file requirements

    The entry points for the gem are:
    - the executable, which depends on the FileLoader and Server
    - the include in the hooks files, which I suggest taking care of later
    
    I think that the executable should probably not know about the internal
    organization of the gem, but it's mostly matter of appreciation (YMMV).
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    2380e66 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    19149ed View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    2f86a87 View commit details
    Browse the repository at this point in the history
  25. Refactor make method accessibilty explicit

    The FileLoader.unique_paths is not part of its API and should not
    be used by other classes/modules.
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    7100d17 View commit details
    Browse the repository at this point in the history
  26. Minor refactor remove assertion on class

    Asserting on the objects class is not used much in Ruby, and
    in this case it was used in case 'hooks' were nil.
    Instead, 'hooks' could default to an empty array (which conveys
    more meaning that nil) and it would always responds to "#each".
    
    The solution only builds on top of the existing duplication,
    but that's a different problem.
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    b33bcf8 View commit details
    Browse the repository at this point in the history
  27. Refactor rename variables for clarity

    Minor use parens around arguments in method definitions and
    non-trivial method calls.
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    423918b View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    fade17e View commit details
    Browse the repository at this point in the history
  29. Refactor move instance variables intialization

    Minor refactor use Array#inject to group statements
    Minor use parens in multi-arguments method calls
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    40d28cb View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    6e3f703 View commit details
    Browse the repository at this point in the history
  31. Merge branch 'refactor-make-code-more-idiomatic'

    As a Ruby developer
    In order to make the gem maintenance easier
    I want its code to be as simple as possible
    And as idiomatic as possible
    gonzalo-bulnes committed Apr 24, 2016
    Configuration menu
    Copy the full SHA
    7d709ab View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2016

  1. Add RSpec

    To perform deeper refactoring a unit test suite will be useful.
    
    I like to make explicit the distinction between the specs which document
    the public API (tagged as :public) and those which are only refactoring
    guards and can be changed when necessary (tagged as :protected or
    :private depending on how stable they are intended to be).
    
    The 'spec:public' and 'spec:development' Rake tasks reflect
    that distinction.
    gonzalo-bulnes committed Apr 25, 2016
    Configuration menu
    Copy the full SHA
    bd3e847 View commit details
    Browse the repository at this point in the history
  2. Add DreddHooks::Methods specs

    Minor fix missing link in testing documentation
    gonzalo-bulnes committed Apr 25, 2016
    Configuration menu
    Copy the full SHA
    98af610 View commit details
    Browse the repository at this point in the history
  3. Refactor move from Runner module to instance

    This will allow later to store the hooks content in the runner.
    gonzalo-bulnes committed Apr 25, 2016
    Configuration menu
    Copy the full SHA
    20f4d22 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2016

  1. Refactor move hooks registration to Runner

    Minor use parens in multiple arguments method calls
    Minor use parens in non-tivial method calls
    
    The DreddHooks::Methods exposes the public DSL of DreddHooks.
    As an interface, I would like it to be as simple as possible,
    and as immutable as possible.
    
    Since the DSL and the runner were closely related already, the latter
    seems to be a good place to store the hooks that need to be runned.
    
    Also, because the DSL is an interface for the runner, I prefer the
    dependency to go from the interface to the runner, that the contrary.
    
    Finally, I made the runner a Singleton because it was already unique
    when defined as a Module, and because it make trivial its retrieval
    from the DSL.
    gonzalo-bulnes committed Apr 26, 2016
    Configuration menu
    Copy the full SHA
    3f4e1b2 View commit details
    Browse the repository at this point in the history
  2. Refactor isolate instance vars in registration methods

    Isolating them will make clearer the dynamic method generation in
    the next DRYing step.
    gonzalo-bulnes committed Apr 26, 2016
    Configuration menu
    Copy the full SHA
    f8fdff9 View commit details
    Browse the repository at this point in the history
  3. Refactor isolate instance vars in run methods

    Isolating them will make clearer the dynamic method generation in
    the next DRYing step.
    gonzalo-bulnes committed Apr 26, 2016
    Configuration menu
    Copy the full SHA
    4015d08 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fd63abd View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2016

  1. Configuration menu
    Copy the full SHA
    dfd7f9e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    126470e View commit details
    Browse the repository at this point in the history
  3. Refactor move instance variables initialization

    The default values are clodely related to their setters anyway, so
    they can be generated in place at the price of very little duplication.
    gonzalo-bulnes committed Apr 27, 2016
    Configuration menu
    Copy the full SHA
    e5f8828 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1a627db View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a980d68 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9ce2866 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0ff806a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    21931de View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    54badf8 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d427b32 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'refactor-dry-runner-and-dsl'

    As a developer
    In order to be able to extend it easily
    I want dredd-hooks-ruby not to contain too much duplicated code
    gonzalo-bulnes committed Apr 27, 2016
    Configuration menu
    Copy the full SHA
    f9ff60f View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2016

  1. Configuration menu
    Copy the full SHA
    5ea25a3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7cf22a8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    129237c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    019174f View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2016

  1. Configuration menu
    Copy the full SHA
    2c018d3 View commit details
    Browse the repository at this point in the history
  2. Minor fix 'Server#process_message' visibility

    Minor use parens in method definition
    gonzalo-bulnes committed Apr 29, 2016
    Configuration menu
    Copy the full SHA
    228885f View commit details
    Browse the repository at this point in the history
  3. Refactor separate concerns around client interaction

    The server is already interacting with the client in the run loop,
    and I see no reason iwhy the message processing method should know
    about it.
    gonzalo-bulnes committed Apr 29, 2016
    Configuration menu
    Copy the full SHA
    2b3cb77 View commit details
    Browse the repository at this point in the history
  4. Minor refactor replace message delimiter by reference

    I'm not that sure about this one, but I believe the MESSAGE_DELIMITER
    is a "full duplex" convention between the server and the client and that
    it is not a coincidence that the same message delimiter is used in the
    client requests and in the server responses.
    gonzalo-bulnes committed Apr 29, 2016
    Configuration menu
    Copy the full SHA
    e41f7be View commit details
    Browse the repository at this point in the history
  5. Merge branch 'refactor-modularize-server'

    As a developer
    In order to keep simple the code which is likely to be extended
    And keep apart the different responsibilities it assumes
    I want the 'DreddHooks::Serveri' to be modular
    gonzalo-bulnes committed Apr 29, 2016
    Configuration menu
    Copy the full SHA
    75f6df2 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2016

  1. Configuration menu
    Copy the full SHA
    640f21e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    40a61fb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4b6a914 View commit details
    Browse the repository at this point in the history
  4. Refactor move Server::EVENTS definition

    When adding support for new hooks, both the hooks definition and
    the events definition needs to be updated. It makes sense to me to
    keep them in the same file.
    
    As the events definition refers to the hooks names, in order to make
    maintenance easier, I think it also makes sense to check consistency,
    and break the test suite when required definitions are missing.
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    98e7bf2 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'refactor-dry-server-events-handler'

    As a developer
    In order to make maintenance easier
    And ensure adding support for new Dredd events is as simple as possible
    I want the DreddHooks::Server::EventsHandler to be DRY
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    9f99667 View commit details
    Browse the repository at this point in the history
  6. Update dependencies

    Remove Bundler dependency
    I might be wrong, but I think declaring bundler as a dependency is
    superfluous (e.g. its version is not locked in the Gemfile).
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    d9f1081 View commit details
    Browse the repository at this point in the history
  7. Revert "Update dependencies"

    This reverts commit ae792ba due to
    failures in the Ruby 1.9.3 build on Travis CI.
    
    I'm not sure why the Ruby 1.9.3 build fails (while the Ruy 2.3.0
    succeeds) but truth is this update can be omitted for now.
    
    See https://travis-ci.org/gonzalo-bulnes/dredd-hooks-ruby/builds/127012201
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    23e6817 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    079bc45 View commit details
    Browse the repository at this point in the history
  9. Refactor encapsulate DreddHooks::CLI

    This refactoring should allow to start using Thor to build the CLI with
    minimal disruption.
    
    Using Thor would change the API (starting the server would require to
    dredd-hooks-ruby start instead of dredd-hooks-ruby) but would allow to
    build a properly documented CLI (dredd-hooks-ruby help and so on...)
    with minimal effort.
    
    See http://whatisthor.com
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    498d8dd View commit details
    Browse the repository at this point in the history
  10. Minor refactor fix class method visibility

    Minor refactor fix useless variable assignation
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    d939e2e View commit details
    Browse the repository at this point in the history
  11. Minor refactor do not suppress exception

    ...provide default argument to 'Hash#fetch' instead.
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    6c1e13c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0480fe3 View commit details
    Browse the repository at this point in the history
  13. Refactor parametrize output and error streams

    Minor move informative output to STDOUT.
    
    Injecting the error and output steams allows to configure them
    and to write specs for their messages (eventually).
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    029d780 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    955bd26 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    d732f9a View commit details
    Browse the repository at this point in the history
  16. Merge branch 'refactor-encapsulate-cli'

    As a developer
    In order to be able to start the Ruby hooks server programatically
    I want to keep all the Ruby hooks server business logic in a single directory
    
    In order to to be able to improve its CLI independently
    I want its CLI to be a first-class citizen among the code
    gonzalo-bulnes committed May 1, 2016
    Configuration menu
    Copy the full SHA
    7297fa1 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2016

  1. Refactor extract method from CLI to Server#disable_buffering

    Ensuring that the output doesn't get buffered is particularly
    relevant once the server is started because Dredd relies on it.
    In order to be able to start programatically a server in
    the best conditions, that step should be part of the server
    starting procedure.
    
    Using a buffered output while loading the hookfiles, on the other
    hand poses no particular problem.
    gonzalo-bulnes committed May 2, 2016
    Configuration menu
    Copy the full SHA
    8938ef1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    614c65e View commit details
    Browse the repository at this point in the history
  3. Remove unused dependency

    Unless I'm wrong, declaring bundler as a dependency is superfluous
    (e.g. its version is not locked in the Gemfile).
    gonzalo-bulnes committed May 2, 2016
    Configuration menu
    Copy the full SHA
    a045782 View commit details
    Browse the repository at this point in the history