power-rake 0.0.10 → 0.0.11
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 +4 -4
- data/lib/power-rake.rb +23 -7
- data/lib/power-rake/version.rb +1 -1
- metadata +3 -7
- data/lib/power-rake/common.rb +0 -28
- data/lib/power-rake/helpers/config_helper.rb +0 -29
- data/lib/power-rake/models/config.rb +0 -14
- data/lib/tasks/power-rake/release.rake +0 -13
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 0ada05d4d8c2a66371c43b27c58a69a23da20294
         | 
| 4 | 
            +
              data.tar.gz: 4ef9c9da3c5b619f338fc315c0c73bc98229b341
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 8a69d9a8fa8228e576b45b661713abd7cadbcc1e8a50d2f8d97445ec7aa9c1b68496e0ebcd58b007b8b7094a1b50188c92b6ec061722642ea01279568f455cb7
         | 
| 7 | 
            +
              data.tar.gz: 476f77d763f92e62c1f85ff5105d1aadce3f81d1e4ff28aaec1e1359fd9d0aff63ab8c904e79bce69b67af76f09526be4f756274137a0aa8c2d40194eb01c638
         | 
    
        data/lib/power-rake.rb
    CHANGED
    
    | @@ -1,12 +1,28 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            # Prompt with control flow
         | 
| 4 | 
            +
            # @param [String]
         | 
| 5 | 
            +
            def continue?(message = 'Continue? (y|n)')
         | 
| 6 | 
            +
              abort 'Aborted!' unless prompt(message).downcase == 'y'
         | 
| 7 | 
            +
            end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            # Inline message prompt
         | 
| 10 | 
            +
            # @param [String]
         | 
| 11 | 
            +
            def prompt(message)
         | 
| 12 | 
            +
              print message
         | 
| 13 | 
            +
              STDIN.gets.strip
         | 
| 14 | 
            +
            end
         | 
| 4 15 |  | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 16 | 
            +
            # Try a system command
         | 
| 17 | 
            +
            # @param [string]
         | 
| 18 | 
            +
            def try(command)
         | 
| 19 | 
            +
              system(command) || abort("Aborted! `#{command}`")
         | 
| 20 | 
            +
            end
         | 
| 8 21 |  | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 22 | 
            +
            # Prompt before trying a system command
         | 
| 23 | 
            +
            # @param [string]
         | 
| 24 | 
            +
            def try?(command)
         | 
| 25 | 
            +
              puts command
         | 
| 26 | 
            +
              continue?
         | 
| 27 | 
            +
              try(command)
         | 
| 12 28 | 
             
            end
         | 
    
        data/lib/power-rake/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: power-rake
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.11
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ryan Tulino
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020-04- | 
| 11 | 
            +
            date: 2020-04-06 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rake
         | 
| @@ -24,18 +24,14 @@ dependencies: | |
| 24 24 | 
             
                - - ">="
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 26 | 
             
                    version: '0'
         | 
| 27 | 
            -
            description:  | 
| 27 | 
            +
            description: Enhance your rake tasks!
         | 
| 28 28 | 
             
            email: rtulino@gmail.com
         | 
| 29 29 | 
             
            executables: []
         | 
| 30 30 | 
             
            extensions: []
         | 
| 31 31 | 
             
            extra_rdoc_files: []
         | 
| 32 32 | 
             
            files:
         | 
| 33 33 | 
             
            - lib/power-rake.rb
         | 
| 34 | 
            -
            - lib/power-rake/common.rb
         | 
| 35 | 
            -
            - lib/power-rake/helpers/config_helper.rb
         | 
| 36 | 
            -
            - lib/power-rake/models/config.rb
         | 
| 37 34 | 
             
            - lib/power-rake/version.rb
         | 
| 38 | 
            -
            - lib/tasks/power-rake/release.rake
         | 
| 39 35 | 
             
            homepage: http://rubygems.org/gems/power-rake
         | 
| 40 36 | 
             
            licenses:
         | 
| 41 37 | 
             
            - MIT
         | 
    
        data/lib/power-rake/common.rb
    DELETED
    
    | @@ -1,28 +0,0 @@ | |
| 1 | 
            -
            # frozen_string_literal: true
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            # Prompt with control flow
         | 
| 4 | 
            -
            # @param [String]
         | 
| 5 | 
            -
            def continue?(message = 'Continue? (y|n)')
         | 
| 6 | 
            -
              abort 'Aborted!' unless prompt(message).downcase == 'y'
         | 
| 7 | 
            -
            end
         | 
| 8 | 
            -
             | 
| 9 | 
            -
            # Inline message prompt
         | 
| 10 | 
            -
            # @param [String]
         | 
| 11 | 
            -
            def prompt(message)
         | 
| 12 | 
            -
              print message
         | 
| 13 | 
            -
              STDIN.gets.strip
         | 
| 14 | 
            -
            end
         | 
| 15 | 
            -
             | 
| 16 | 
            -
            # Try a system command
         | 
| 17 | 
            -
            # @param [string]
         | 
| 18 | 
            -
            def try(command)
         | 
| 19 | 
            -
              system(command) || abort("Aborted! `#{command}`")
         | 
| 20 | 
            -
            end
         | 
| 21 | 
            -
             | 
| 22 | 
            -
            # Prompt before trying a system command
         | 
| 23 | 
            -
            # @param [string]
         | 
| 24 | 
            -
            def try?(command)
         | 
| 25 | 
            -
              puts command
         | 
| 26 | 
            -
              continue?
         | 
| 27 | 
            -
              try(command)
         | 
| 28 | 
            -
            end
         | 
| @@ -1,29 +0,0 @@ | |
| 1 | 
            -
            # frozen_string_literal: true
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            module PowerRake
         | 
| 4 | 
            -
              module ConfigHelper
         | 
| 5 | 
            -
                def config
         | 
| 6 | 
            -
                  @config ||= Config.new(data)
         | 
| 7 | 
            -
                end
         | 
| 8 | 
            -
             | 
| 9 | 
            -
                def configure
         | 
| 10 | 
            -
                  yield(config)
         | 
| 11 | 
            -
                end
         | 
| 12 | 
            -
             | 
| 13 | 
            -
                def current_env
         | 
| 14 | 
            -
                  ENV['RAKE_ENV'] || :development
         | 
| 15 | 
            -
                end
         | 
| 16 | 
            -
             | 
| 17 | 
            -
                def config_file
         | 
| 18 | 
            -
                  ENV['RAKE_CONFIG'] || 'power-rake.yml'
         | 
| 19 | 
            -
                end
         | 
| 20 | 
            -
             | 
| 21 | 
            -
                private
         | 
| 22 | 
            -
             | 
| 23 | 
            -
                def data
         | 
| 24 | 
            -
                  return {} unless File.exists? config_file
         | 
| 25 | 
            -
             | 
| 26 | 
            -
                  Config.read(config_file, current_env)
         | 
| 27 | 
            -
                end
         | 
| 28 | 
            -
              end
         | 
| 29 | 
            -
            end
         | 
| @@ -1,14 +0,0 @@ | |
| 1 | 
            -
            # frozen_string_literal: true
         | 
| 2 | 
            -
            require 'erb'
         | 
| 3 | 
            -
            require 'ostruct'
         | 
| 4 | 
            -
            require 'yaml'
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            module PowerRake
         | 
| 7 | 
            -
              class Config < OpenStruct
         | 
| 8 | 
            -
                def self.read(path, env)
         | 
| 9 | 
            -
                  contents = IO.read(path)
         | 
| 10 | 
            -
                  processed = ERB.new(contents).result
         | 
| 11 | 
            -
                  YAML.load(processed)[env.to_s]
         | 
| 12 | 
            -
                end
         | 
| 13 | 
            -
              end
         | 
| 14 | 
            -
            end
         | 
| @@ -1,13 +0,0 @@ | |
| 1 | 
            -
            require 'power-rake/version'
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            desc "Release version #{PowerRake::VERSION} of the gem"
         | 
| 4 | 
            -
            task :release do
         | 
| 5 | 
            -
              continue? "Release version #{PowerRake::VERSION} of the gem?"
         | 
| 6 | 
            -
             | 
| 7 | 
            -
              try "git tag -a v#{PowerRake::VERSION} -m 'Tagging #{PowerRake::VERSION}'"
         | 
| 8 | 
            -
              try 'git push --tags'
         | 
| 9 | 
            -
             | 
| 10 | 
            -
              try 'gem build power-rake.gemspec'
         | 
| 11 | 
            -
              try "gem push power-rake-#{PowerRake::VERSION}.gem"
         | 
| 12 | 
            -
              try "rm power-rake-#{PowerRake::VERSION}.gem"
         | 
| 13 | 
            -
            end
         |