power-rake 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84ddd5e49d2d8eb0a3bc233c43f4e7d315276fb2
4
- data.tar.gz: d7f8299859b44f7b23993eb3942ab1b331e49745
3
+ metadata.gz: 0ada05d4d8c2a66371c43b27c58a69a23da20294
4
+ data.tar.gz: 4ef9c9da3c5b619f338fc315c0c73bc98229b341
5
5
  SHA512:
6
- metadata.gz: 0d3c4e551c3ab57157fe85cefd389e35f60b516229ca17e4d2c45be86d5671be41e3ef7cfe60a69ab90302c40f74dff426b438da1b97f212a5a89a21b325b4ab
7
- data.tar.gz: 73726148200e33ddb103d5777c5c1dea6c40c33c5a74bded0485f67a9052d37109433c0167a5ec18e320abc3e685c5fd6fc88d8c0db4682a14fe5cacfeee0bf3
6
+ metadata.gz: 8a69d9a8fa8228e576b45b661713abd7cadbcc1e8a50d2f8d97445ec7aa9c1b68496e0ebcd58b007b8b7094a1b50188c92b6ec061722642ea01279568f455cb7
7
+ data.tar.gz: 476f77d763f92e62c1f85ff5105d1aadce3f81d1e4ff28aaec1e1359fd9d0aff63ab8c904e79bce69b67af76f09526be4f756274137a0aa8c2d40194eb01c638
@@ -1,12 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'power-rake/common'
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
- module PowerRake
6
- autoload :Config, 'power-rake/models/config'
7
- autoload :ConfigHelper, 'power-rake/helpers/config_helper'
16
+ # Try a system command
17
+ # @param [string]
18
+ def try(command)
19
+ system(command) || abort("Aborted! `#{command}`")
20
+ end
8
21
 
9
- class << self
10
- include ConfigHelper
11
- end
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
@@ -1,3 +1,3 @@
1
1
  module PowerRake
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  end
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.10
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-05 00:00:00.000000000 Z
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: Power Rake
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
@@ -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