soundcheck 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/bin/soundcheck +19 -4
- data/lib/soundcheck/frameworks.rb +2 -0
- data/lib/soundcheck.rb +13 -4
- data/soundcheck.gemspec +1 -1
- metadata +12 -12
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.2. | 
| 1 | 
            +
            0.2.3
         | 
    
        data/bin/soundcheck
    CHANGED
    
    | @@ -1,5 +1,6 @@ | |
| 1 1 | 
             
            #!/usr/bin/env ruby
         | 
| 2 2 | 
             
            require 'optparse'
         | 
| 3 | 
            +
            require 'pty'
         | 
| 3 4 | 
             
            require 'soundcheck'
         | 
| 4 5 |  | 
| 5 6 | 
             
            options = {}
         | 
| @@ -24,13 +25,27 @@ option_parser = OptionParser.new do |opts| | |
| 24 25 | 
             
              end
         | 
| 25 26 | 
             
            end
         | 
| 26 27 |  | 
| 28 | 
            +
            # Option Parser will eat elements of ARGV that it recognizes
         | 
| 27 29 | 
             
            option_parser.parse!(ARGV)
         | 
| 28 | 
            -
             | 
| 30 | 
            +
             | 
| 31 | 
            +
            # Assume that the rest of ARGV are filenames
         | 
| 32 | 
            +
            soundcheck = Soundcheck.new(ARGV, options)
         | 
| 29 33 |  | 
| 30 34 | 
             
            begin
         | 
| 31 | 
            -
               | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 35 | 
            +
              soundcheck.commands_to_run.each do |cmd|
         | 
| 36 | 
            +
                puts "[1mExecuting #{cmd}[0m\n\n"
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                PTY.spawn(cmd) do |read_stream, write_stream, pid|
         | 
| 39 | 
            +
                  begin
         | 
| 40 | 
            +
                    while chars = read_stream.read(1)
         | 
| 41 | 
            +
                      print chars
         | 
| 42 | 
            +
                    end
         | 
| 43 | 
            +
                  rescue Errno::EIO
         | 
| 44 | 
            +
                  end
         | 
| 45 | 
            +
                end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
                puts "\n\n\n"
         | 
| 48 | 
            +
              end
         | 
| 34 49 | 
             
            rescue Project::UnknownLanguage
         | 
| 35 50 | 
             
              puts "Error: Cannot detect the programming language for this project."
         | 
| 36 51 | 
             
              exit 1
         | 
| @@ -1,4 +1,5 @@ | |
| 1 1 | 
             
            require 'active_support/concern'
         | 
| 2 | 
            +
            require 'soundcheck/logging'
         | 
| 2 3 |  | 
| 3 4 | 
             
            module Frameworks
         | 
| 4 5 | 
             
              module Base
         | 
| @@ -16,6 +17,7 @@ module Frameworks | |
| 16 17 |  | 
| 17 18 | 
             
                module InstanceMethods
         | 
| 18 19 | 
             
                  def filter_with(args, filters)
         | 
| 20 | 
            +
                    logger.debug "Filtering #{args.inspect}"
         | 
| 19 21 | 
             
                    args.select do |arg|
         | 
| 20 22 | 
             
                      filters.any? do |key, value|
         | 
| 21 23 | 
             
                        case value
         | 
    
        data/lib/soundcheck.rb
    CHANGED
    
    | @@ -3,12 +3,12 @@ require 'soundcheck/project' | |
| 3 3 |  | 
| 4 4 | 
             
            class Soundcheck
         | 
| 5 5 | 
             
              attr_accessor :project
         | 
| 6 | 
            -
              attr_accessor : | 
| 6 | 
            +
              attr_accessor :paths
         | 
| 7 7 | 
             
              attr_accessor :options
         | 
| 8 8 |  | 
| 9 | 
            -
              def initialize( | 
| 9 | 
            +
              def initialize(paths, options = {})
         | 
| 10 10 | 
             
                self.project = Project.new(Dir.pwd)
         | 
| 11 | 
            -
                self. | 
| 11 | 
            +
                self.paths = paths
         | 
| 12 12 | 
             
                self.options = options
         | 
| 13 13 |  | 
| 14 14 | 
             
                logger.level = Logger::DEBUG if options[:verbose]
         | 
| @@ -18,8 +18,17 @@ class Soundcheck | |
| 18 18 | 
             
              def command_to_run
         | 
| 19 19 | 
             
                project.frameworks.each do |framework|
         | 
| 20 20 | 
             
                  framework.options = options
         | 
| 21 | 
            -
                  command = framework.command(* | 
| 21 | 
            +
                  command = framework.command(*paths)
         | 
| 22 22 | 
             
                  return command if command
         | 
| 23 23 | 
             
                end
         | 
| 24 24 | 
             
              end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
              def commands_to_run
         | 
| 27 | 
            +
                commands = project.frameworks.map do |framework|
         | 
| 28 | 
            +
                  framework.options = options
         | 
| 29 | 
            +
                  framework.command(*paths)
         | 
| 30 | 
            +
                end.compact
         | 
| 31 | 
            +
                logger.debug "Commands to run: #{commands.inspect}"
         | 
| 32 | 
            +
                commands
         | 
| 33 | 
            +
              end
         | 
| 25 34 | 
             
            end
         | 
    
        data/soundcheck.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: soundcheck
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.3
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -13,7 +13,7 @@ date: 2011-11-06 00:00:00.000000000 Z | |
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: activesupport
         | 
| 16 | 
            -
              requirement: & | 
| 16 | 
            +
              requirement: &21025260 !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                none: false
         | 
| 18 18 | 
             
                requirements:
         | 
| 19 19 | 
             
                - - ~>
         | 
| @@ -21,10 +21,10 @@ dependencies: | |
| 21 21 | 
             
                    version: '3.0'
         | 
| 22 22 | 
             
              type: :runtime
         | 
| 23 23 | 
             
              prerelease: false
         | 
| 24 | 
            -
              version_requirements: * | 
| 24 | 
            +
              version_requirements: *21025260
         | 
| 25 25 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 26 26 | 
             
              name: rspec
         | 
| 27 | 
            -
              requirement: & | 
| 27 | 
            +
              requirement: &21024640 !ruby/object:Gem::Requirement
         | 
| 28 28 | 
             
                none: false
         | 
| 29 29 | 
             
                requirements:
         | 
| 30 30 | 
             
                - - ! '>='
         | 
| @@ -32,10 +32,10 @@ dependencies: | |
| 32 32 | 
             
                    version: '0'
         | 
| 33 33 | 
             
              type: :development
         | 
| 34 34 | 
             
              prerelease: false
         | 
| 35 | 
            -
              version_requirements: * | 
| 35 | 
            +
              version_requirements: *21024640
         | 
| 36 36 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 37 37 | 
             
              name: jeweler
         | 
| 38 | 
            -
              requirement: & | 
| 38 | 
            +
              requirement: &21023920 !ruby/object:Gem::Requirement
         | 
| 39 39 | 
             
                none: false
         | 
| 40 40 | 
             
                requirements:
         | 
| 41 41 | 
             
                - - ~>
         | 
| @@ -43,10 +43,10 @@ dependencies: | |
| 43 43 | 
             
                    version: 1.6.4
         | 
| 44 44 | 
             
              type: :development
         | 
| 45 45 | 
             
              prerelease: false
         | 
| 46 | 
            -
              version_requirements: * | 
| 46 | 
            +
              version_requirements: *21023920
         | 
| 47 47 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 48 48 | 
             
              name: rcov
         | 
| 49 | 
            -
              requirement: & | 
| 49 | 
            +
              requirement: &21023120 !ruby/object:Gem::Requirement
         | 
| 50 50 | 
             
                none: false
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 52 | 
             
                - - ! '>='
         | 
| @@ -54,10 +54,10 @@ dependencies: | |
| 54 54 | 
             
                    version: '0'
         | 
| 55 55 | 
             
              type: :development
         | 
| 56 56 | 
             
              prerelease: false
         | 
| 57 | 
            -
              version_requirements: * | 
| 57 | 
            +
              version_requirements: *21023120
         | 
| 58 58 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 59 59 | 
             
              name: cucumber
         | 
| 60 | 
            -
              requirement: & | 
| 60 | 
            +
              requirement: &21022460 !ruby/object:Gem::Requirement
         | 
| 61 61 | 
             
                none: false
         | 
| 62 62 | 
             
                requirements:
         | 
| 63 63 | 
             
                - - ! '>='
         | 
| @@ -65,7 +65,7 @@ dependencies: | |
| 65 65 | 
             
                    version: '0'
         | 
| 66 66 | 
             
              type: :development
         | 
| 67 67 | 
             
              prerelease: false
         | 
| 68 | 
            -
              version_requirements: * | 
| 68 | 
            +
              version_requirements: *21022460
         | 
| 69 69 | 
             
            description: Soundcheck tries to figure out what kind of project you're working on,
         | 
| 70 70 | 
             
              what test file you're trying to run, and what the fastest way is to run that.
         | 
| 71 71 | 
             
            email: marten@veldthuis.com
         | 
| @@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 140 140 | 
             
                  version: '0'
         | 
| 141 141 | 
             
                  segments:
         | 
| 142 142 | 
             
                  - 0
         | 
| 143 | 
            -
                  hash: - | 
| 143 | 
            +
                  hash: -2800419404506608249
         | 
| 144 144 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 145 145 | 
             
              none: false
         | 
| 146 146 | 
             
              requirements:
         |