Sha256: 3451db3a0007299be1fd9e463ab6fb7a1358166a84ebfcc5787f3667034af6f2

Contents?: true

Size: 1.45 KB

Versions: 4

Compression:

Stored size: 1.45 KB

Contents

module SafePusher
  class CLI < Thor
    desc 'prontorun', 'launch pronto with a return message'
    def prontorun
      puts '#######################'.yellow
      puts '## Running pronto... ##'.yellow
      puts '#######################'.yellow

      results = SafePusher::ProntoRunner.new.call

      exit results unless results == 0
    end

    desc 'test', 'launch the test suite with a return message'
    def test
      puts '##########################'.yellow
      puts '## Testing new files... ##'.yellow
      puts '##########################'.yellow

      results = SafePusher::RspecRunner.new.call

      exit results unless results == 0
    end

    desc 'pushandpr', 'push your code on github,'\
         ' and open a PR if it is the first time'
    def pushandpr
      puts '##########################'.yellow
      puts '## Pushing to Github... ##'.yellow
      puts '##########################'.yellow

      results = SafePusher::GithubRunner.new.call

      exit results unless results == 0
    end

    desc 'ptest', 'launch the test suite, then pronto if it is successful'
    def ptest
      invoke :test
      invoke :prontorun
    end

    desc 'ppush', 'run your favorite linter, then push on github'
    def ppush
      invoke :prontorun
      invoke :pushandpr
    end

    desc 'ppushtest', 'run your favorite linters and tests, then push on github'
    def ppushtest
      invoke :test
      invoke :prontorun
      invoke :pushandpr
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
safe_pusher-0.1.3 lib/safe_pusher/cli.rb
safe_pusher-0.1.2 lib/safe_pusher/cli.rb
safe_pusher-0.1.1 lib/safe_pusher/cli.rb
safe_pusher-0.1.0 lib/safe_pusher/cli.rb