Permalink
Commits on Aug 9, 2016
  1. @jcredding

    Hotfix: Add comment to Gemfile explaining how to release new versions

    This updates the Gemfile to add a comment explaining how to release
    scmd. Since we use `ggem` to release new gem versions and scmd is
    a dependency of `ggem` the normal process doesn't work. This is
    because `ggem` will load the installed version of scmd instead of
    loading the scmd files. To fix this, we need to run:
    `bundle exec ggem` so bundler will make it require the scmd files
    instead of the installed version. To do this, `ggem` has to be
    added to the gemfile. Also since adding ggem to the gemfile will
    mean there is an uncommited file, the `-f` flag has to be used to
    force releasing the gem. So this adds a commented out `ggem` to the
    gemfile and adds a comment explaining to do a forced release.
    jcredding committed Aug 9, 2016
  2. @jcredding

    version to 3.0.3

    * `CommandSpy`, don't add to `Scmd.calls` not in test mode (3cb1ac0)
    jcredding committed Aug 9, 2016
  3. @jcredding

    Hotfix: `CommandSpy`, don't add calls to `Scmd.calls` if not in test …

    …mode
    
    This updates the `CommandSpy` to not add calls to `Scmd.calls` if
    its not in test mode. This allows the `CommandSpy` to be used even
    if scmd is not in test mode. This is specifically needed for dk
    because it wants to use the `CommandSpy` directly without putting
    all of scmd in test mode.
    
    The `CommandSpy` now checks if the test mode env var is set before
    it tries pushing a call onto `Scmd.calls`. This avoids `Scmd.calls`
    raising a `NoMethodError` whenever a `CommandSpy` is run.
    jcredding committed Aug 9, 2016
Commits on Jun 1, 2016
  1. @kellyredding

    version to 3.0.2

    * hotfix: update to our latest gem conventions 51fddff
    * (hotfix) switch to `sample` instead of `choice`, backfill for 1.8.7 ccb83c2
    kellyredding committed Jun 1, 2016
  2. @kellyredding

    (hotfix) switch to `sample` instead of `choice`, backfill for 1.8.7

    This switches to using `sample` instead of `choice` but backfills
    `sample` so it works in ruby 1.8.7. This is part of making sure the
    gem works for newer versions of ruby. This allows the test suite to
    be run on newer versions of ruby which can be used to tell if the
    gem is compatible with the version or not.
    
    Note: this also updates to the latest Assert which is fully compatible
    with the newer ruby versions.
    kellyredding committed Jun 1, 2016
Commits on Mar 30, 2016
  1. @kellyredding

    hotfix: update to our latest gem conventions

    With ggem v1.8.0, we no longer need rake/bundler to release gem
    versions, therefore we can:
    
    * remove Rakefile and gem dependencies
    * update the gemspec to match GGem's latest conventions
    * update the LICENSE file name to match GGem's latest conventions
    
    This also updates all dependencies to our new "vanity versioning"
    system.
    kellyredding committed Mar 30, 2016
Commits on Dec 22, 2015
  1. @kellyredding

    version to 3.0.1

    * add a command spy for testing use #30
    * add "test mode" for Scmd #31
    
    Note: This switches our versioning scheme. We are now using the
    first number for vanity/marketing releases, the middle number for
    major (backwards-incompatible) changes and the last number for all
    other changes (minor and patch).
    kellyredding committed Dec 22, 2015
  2. @kellyredding

    Merge pull request #31 from redding/kr-test-mode

    add "test mode" for Scmd
    kellyredding committed Dec 22, 2015
  3. @kellyredding

    add "test mode" for Scmd

    Test mode turns on a bunch testing utilities for Scmd.  This means
    that command spies will be used in place of "live" commands, each
    time a command is run or started will be logged in a collection and
    option-specific spies can be added and used to "stub" spies with
    specific attributes in specific contexts.
    
    In non-test-mode, everything behaves as before: `.new` returns
    "live" commands and the test mode API all raises `NoMethodError`s.
    To turn on test mode, set and env var: `ENV['SCMD_TEST_MODE'] = '1'`.
    
    Note: this also updates the command spy to have non-nil default
    values for exit status and pid.  The goal here is to default with
    realistic values that can be overridden and also so that commands
    are successful by default.  The original defaults were a big
    nuisance when used in application testing.
    kellyredding committed Dec 21, 2015
Commits on Dec 21, 2015
  1. @kellyredding

    Merge pull request #30 from redding/kr-cmd-spy

    add a command spy for testing use
    kellyredding committed Dec 21, 2015
  2. @kellyredding

    add a command spy for testing use

    This adds a spy object to use in place of actual command objects
    in tests.  Stub this in so no commands will actually run and so that
    you can test your are calling Scmd's API appropriately.
    
    This also does a few other cleanups:
    
    * some style cleanups
    * added a factory class/api for use in the tests
    
    These cleanups were noticed while adding the spy (they probably
    should have been done in other efforts as these are our conventions).
    kellyredding committed Dec 21, 2015
Commits on Oct 12, 2015
  1. @jcredding

    version to 3.0.0

    * Update posix-spawn dependency (#28)
    * Allow passing options to posix-spawn (#29)
    
    /cc @kellyredding
    jcredding committed Oct 12, 2015
  2. @jcredding

    Merge pull request #29 from redding/jcr-pass-spawn-options

    Allow passing options to posix-spawn
    jcredding committed Oct 12, 2015
  3. @jcredding

    Allow passing options to posix-spawn

    This allows passing options to posix-spawn which allows extra
    behavior for the child process that is spawned.
    
    This changes the command interface to take a command string and
    opts hash instead of an env hash. The env hash can now be specified
    using the `:env` key in the opts hash. This allows passing an
    `:options` key in the opts hash for specifying the posix spawn
    options.
    
    This is needed for ruby 1.9+. It closes file descriptors when a
    child process is spawned. This specifically caused Qs benchmark
    script to not work anymore because it used an IO pipe to
    communicate between the parent and child process. With this change
    the Qs benchmark script can specify the file descriptors it wants
    to redirect and the script works as it previously did.
    
    This also updates the README documentation for using the new
    options. This includes a section showing how environment variables
    can be used which should have been added when environment variable
    support was added.
    jcredding committed Oct 12, 2015
  4. @jcredding

    Merge pull request #28 from redding/jcr-update-posix-spawn-dep

    Update posix-spawn dependency
    jcredding committed Oct 12, 2015
  5. @jcredding

    Update posix-spawn dependency

    This updates the posix-spawn dependency to the latest version and
    also switches back to allowing any patch level version updates.
    
    This was originally locked down in c3206e6 because the latest
    version of posix-spawn was not compatible with ruby 1.8.7. They
    fixed the 1.8.7 errors in v0.3.10.
    
    As an aside, this also fixes an issue with ruby 2.2 we were
    experiencing in other gems. In Qs, its benchmark script relies on
    creating a unix pipe, spinning up a child process that runs jobs
    and passing the writer file descriptor to that child process. In
    ruby 1.9 they added `Process.spawn` and by default it closes all
    file descriptors to avoid "leaking" file descriptors which can
    apparently keep files from being closed properly. posix-spawn tries
    to be compatible with ruby so it does the same thing. So in ruby
    2.2, qs benchmark script won't work unless it redirects file
    descriptors. There was a bug with redirecting the file descriptors
    with posix-spawn in v0.3.8 though. By updating the posix-spawn
    version, the Qs benchmark script can work as expected in ruby 2.2.
    jcredding committed Oct 12, 2015
Commits on Aug 1, 2014
  1. @jcredding

    version to 2.3.1

    * Lock down posix-spawn version to 0.3.8 (c3206e6)
    
    /cc @kellyredding
    jcredding committed Aug 1, 2014
  2. @jcredding

    Lock down posix-spawn version to 0.3.8

    This locks down posix-spawn to version 0.3.8. The latest version
    (0.3.9) isn't compatible with ruby 1.8.7.
    
    /cc @kellyredding
    jcredding committed Aug 1, 2014
Commits on Jul 31, 2014
  1. @kellyredding

    version to 2.3.0

    * reorg tests to breakout proper system tests #25
    * send stop/kill signals to *all* child processes #26
    * send specific signals to `kill` #27
    
    /cc @jcredding
    kellyredding committed Jul 31, 2014
  2. @kellyredding

    Merge pull request #27 from redding/kr-kill-sig

    send specific signals to `kill`
    kellyredding committed Jul 31, 2014
  3. @kellyredding

    send specific signals to `kill`

    This updates the `kill` method to task an optional signal name.  By
    default it sends the `'KILL'` signal.  This allows you to send a
    non-default signal to the command's pid and any child pids.
    kellyredding committed Jul 31, 2014
  4. @kellyredding

    Merge pull request #26 from redding/kr-child-ips

    send stop/kill signals to *all* child processes
    kellyredding committed Jul 31, 2014
  5. @kellyredding

    send stop/kill signals to *all* child processes

    This updates the stop/kill send signal logic to send the signal
    first to any child processes (recursively), then to the main command
    process.  This allows you to properly stop commands that spawn
    child processes.
    
    This came up when using Scmd to programmatically run `rackup`.  I
    found that stopping the command would indeed stop the main command
    but the spawned rackup process would not stop and my script would
    hang.
    
    Note, this uses `which pgrep` and the `pgrep` sys command to lookup
    the child processes.  If those don't return success with sane output,
    the command will act like it has no child processes and behave as
    before.  Note also that the those sys commands are run using scmd
    itself (so meta).  However, the way those commands are called will
    prevent any kind of infinite recursion problems (executed w/ `run`).
    kellyredding committed Jul 31, 2014
  6. @kellyredding

    Merge pull request #25 from redding/kr-systests

    reorg tests to breakout proper system tests
    kellyredding committed Jul 31, 2014
  7. @kellyredding

    reorg tests to breakout proper system tests

    There is not behavior changes here - just test reorgs.  This breaks
    out the command tests that are actually running commands into system
    tests.  This allows the unit tests to truly be unit tests.
    kellyredding committed Jul 31, 2014
Commits on Jul 30, 2014
  1. @kellyredding

    update big data capture test to allow more time

    This test was randomly failing b/c it would timeout.  This ups
    the allowed time to minimize the chance of a timeout happening.
    
    In this case it is ok b/c the timeout isn't being tested.  The
    streaming of a large amount of output is being tested.  We want
    to ensure there is enough time given to stream all that data.
    
    /cc @jcredding
    kellyredding committed Jul 30, 2014
Commits on Jun 13, 2014
  1. @jcredding

    version to 2.2.0

    * Allow passing an env var hash to commands (#24)
    
    /cc @kellyredding
    jcredding committed Jun 13, 2014
  2. @jcredding

    Merge pull request #24 from redding/jcr-allow-passing-env-hash

    Allow passing an env var hash to commands
    jcredding committed Jun 13, 2014
Commits on Jun 12, 2014
  1. @jcredding

    Allow passing an env var hash to commands

    This updates the `Command` class to take a hash for passing env
    variables. These are passed to the `popen4` call and are set as
    environment variables for the child process. This allows passing
    sensitive env vars like passwords without putting them in the
    command string.
    jcredding committed Jun 12, 2014
Commits on Mar 3, 2014
  1. @kellyredding

    Merge pull request #23 from redding/kr-rbx

    update to support Rubinius
    kellyredding committed Mar 3, 2014
Commits on Mar 2, 2014
  1. @kellyredding

    update to support Rubinius

    This adds the `rubysl` gem to the rbx platform.  It is needed to run
    the test suite on Rubinius.
    kellyredding committed Mar 2, 2014
Commits on Nov 11, 2013
  1. @kellyredding

    version to 2.1.2

    * some minor cleanups to the gem meta (4451e18)
    * some general cleanups and modernizations (#16)
    * have `RunError` *optionally* take a custom backtrace (#17)
    * read output from stdout and stderr while cmd is running (#18)
    * Add a bench mark script to help measure performance impact of changes (#20)
    * use a "self-pipe" to handle cmd timeouts (#21)
    * Some minor tweaks to the setup (#22)
    
    /cc @jcredding
    kellyredding committed Nov 11, 2013
  2. @kellyredding

    Merge pull request #22 from redding/kr-setup-tweaks

    Some minor tweaks to the setup
    kellyredding committed Nov 11, 2013
Commits on Nov 9, 2013
  1. @kellyredding

    Some minor tweaks to the setup

    This breaks resetting the attributes into its own method and makes
    the setup/teardown more about setting up or tearing down cmd runs.
    
    This is a slight improvement in code organization with no behavior
    changes.
    kellyredding committed Nov 9, 2013
Commits on Nov 8, 2013
  1. @kellyredding

    Merge pull request #21 from redding/kr-self-pipe-timeout

    use a "self-pipe" to handle cmd timeouts
    kellyredding committed Nov 8, 2013