rscons 1.2.0 → 1.3.0
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.
- checksums.yaml +8 -8
- data/README.md +7 -0
- data/lib/rscons/environment.rb +6 -2
- data/lib/rscons/version.rb +1 -1
- data/spec/rscons/environment_spec.rb +4 -4
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                OWUzMDNlZjIxODVkZjhkNzg4MjQyZWZkMmQ2YWFiNjNmZmQyOWQ2OA==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                MWRhYzY1YTNlMjIyMDkyYzE4ZjZjMTU4YjVlZmFiMDk2MjBjYWRiNg==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                ODQwNTE4YjI5MmRiMjljNTMzMjRkYzU2OGZkMGUwNTgzMThlZmQzYWZhN2U0
         | 
| 10 | 
            +
                NjUyNDgyZDUzZGQwZDMwYmJmZTYzNjA2MGQxMjcxYzIyNmQxNzcyM2RhODU5
         | 
| 11 | 
            +
                ODMyMjMyODk5MTI5MWEwMTFlYWRlMjJiZTkwMDJhN2EyMGY1N2I=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 13 | 
            +
                ZjBkZDAzNjk3ZDkyMWFmMGEzZTg1ZTZiZTIzNmNjMmM4OGFmYzczOGQ0NTIw
         | 
| 14 | 
            +
                NTMxNjUyNThjNzQ4MmMxYWY5YjNhYTY3NzZkZjQ0MjNmOTY5NzkxN2U5ZjY4
         | 
| 15 | 
            +
                YzQ2NTIyNDMwZGU1OGNiMmIzZTM0ZWM3ODQwY2IzN2E1NGJlNTM=
         | 
    
        data/README.md
    CHANGED
    
    | @@ -243,7 +243,14 @@ http://rubydoc.info/github/holtrop/rscons/frames. | |
| 243 243 |  | 
| 244 244 | 
             
            ## Release Notes
         | 
| 245 245 |  | 
| 246 | 
            +
            ### v1.3.0
         | 
| 247 | 
            +
             | 
| 248 | 
            +
            - change Environment#execute() options parameter to accept the following options keys:
         | 
| 249 | 
            +
              - :env to pass an environment Hash to Kernel#system
         | 
| 250 | 
            +
              - :options to pass an options Hash to Kernel#system
         | 
| 251 | 
            +
             | 
| 246 252 | 
             
            ### v1.2.0
         | 
| 253 | 
            +
             | 
| 247 254 | 
             
            - add :clone option to Environment#clone to control exactly which Environment attributes are cloned
         | 
| 248 255 | 
             
            - allow nil to be passed in to Environment#build_root=
         | 
| 249 256 |  | 
    
        data/lib/rscons/environment.rb
    CHANGED
    
    | @@ -224,7 +224,9 @@ module Rscons | |
| 224 224 | 
             
                # @param short_desc [String] Message to print if the Environment's echo
         | 
| 225 225 | 
             
                #   mode is set to :short
         | 
| 226 226 | 
             
                # @param command [Array] The command to execute.
         | 
| 227 | 
            -
                # @param options [Hash] Optional options  | 
| 227 | 
            +
                # @param options [Hash] Optional options, possible keys:
         | 
| 228 | 
            +
                #   - :env - environment Hash to pass to Kernel#system.
         | 
| 229 | 
            +
                #   - :options - options Hash to pass to Kernel#system.
         | 
| 228 230 | 
             
                def execute(short_desc, command, options = {})
         | 
| 229 231 | 
             
                  print_command = proc do
         | 
| 230 232 | 
             
                    puts command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ')
         | 
| @@ -234,7 +236,9 @@ module Rscons | |
| 234 236 | 
             
                  elsif @echo == :short
         | 
| 235 237 | 
             
                    puts short_desc
         | 
| 236 238 | 
             
                  end
         | 
| 237 | 
            -
                   | 
| 239 | 
            +
                  env_args = options[:env] ? [options[:env]] : []
         | 
| 240 | 
            +
                  options_args = options[:options] ? [options[:options]] : []
         | 
| 241 | 
            +
                  system(*env_args, *command, *options_args).tap do |result|
         | 
| 238 242 | 
             
                    unless result or @echo == :command
         | 
| 239 243 | 
             
                      $stdout.write "Failed command was: "
         | 
| 240 244 | 
             
                      print_command.call
         | 
    
        data/lib/rscons/version.rb
    CHANGED
    
    
| @@ -219,7 +219,7 @@ module Rscons | |
| 219 219 | 
             
                      it "prints the short description and executes the command" do
         | 
| 220 220 | 
             
                        env = Environment.new(echo: :short)
         | 
| 221 221 | 
             
                        env.should_receive(:puts).with("short desc")
         | 
| 222 | 
            -
                        env.should_receive(:system).with("a", "command" | 
| 222 | 
            +
                        env.should_receive(:system).with("a", "command").and_return(true)
         | 
| 223 223 | 
             
                        env.execute("short desc", ["a", "command"])
         | 
| 224 224 | 
             
                      end
         | 
| 225 225 | 
             
                    end
         | 
| @@ -228,7 +228,7 @@ module Rscons | |
| 228 228 | 
             
                      it "prints the short description, executes the command, and prints the failed command line" do
         | 
| 229 229 | 
             
                        env = Environment.new(echo: :short)
         | 
| 230 230 | 
             
                        env.should_receive(:puts).with("short desc")
         | 
| 231 | 
            -
                        env.should_receive(:system).with("a", "command" | 
| 231 | 
            +
                        env.should_receive(:system).with("a", "command").and_return(false)
         | 
| 232 232 | 
             
                        $stdout.should_receive(:write).with("Failed command was: ")
         | 
| 233 233 | 
             
                        env.should_receive(:puts).with("a command")
         | 
| 234 234 | 
             
                        env.execute("short desc", ["a", "command"])
         | 
| @@ -240,8 +240,8 @@ module Rscons | |
| 240 240 | 
             
                    it "prints the command executed and executes the command" do
         | 
| 241 241 | 
             
                      env = Environment.new(echo: :command)
         | 
| 242 242 | 
             
                      env.should_receive(:puts).with("a command '--arg=val with spaces'")
         | 
| 243 | 
            -
                      env.should_receive(:system).with("a", "command", "--arg=val with spaces", opt: :val).and_return(false)
         | 
| 244 | 
            -
                      env.execute("short desc", ["a", "command", "--arg=val with spaces"], opt: :val)
         | 
| 243 | 
            +
                      env.should_receive(:system).with({modified: :environment}, "a", "command", "--arg=val with spaces", {opt: :val}).and_return(false)
         | 
| 244 | 
            +
                      env.execute("short desc", ["a", "command", "--arg=val with spaces"], env: {modified: :environment}, options: {opt: :val})
         | 
| 245 245 | 
             
                    end
         | 
| 246 246 | 
             
                  end
         | 
| 247 247 | 
             
                end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rscons
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.3.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Josh Holtrop
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-02- | 
| 11 | 
            +
            date: 2014-02-25 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rspec-core
         |