cliutils 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +5 -1
- data/Rakefile +1 -7
- data/cliutils.gemspec +1 -1
- data/lib/cliutils/constants.rb +1 -1
- data/lib/cliutils/messaging.rb +5 -24
- data/lib/cliutils/prefs/pref_actions/open_url_action.rb +6 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 468c8c7908c0a02ded8062f42e6eb6fc72bbc777
|
4
|
+
data.tar.gz: 801140b94e5d9bba9c84b1879d7d6cbe5365302e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e51ac6b27096e299b6f77f9e7557e395a9f492d167584f13697d4c8218c12cb34535d746652abf087ffb588d581275801315edde489a88fd7319d449fa90ec48
|
7
|
+
data.tar.gz: 1a008ce2af7b5900ff3420ff3c741f44eb57e65b2fffa3c2747f741f54ba102ee7e1b12c6c1fafdd507c792b9baed16d29625188431439b6ec6a28fb3d5677c1
|
data/HISTORY.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 2.0.3 (2014-04-20)
|
2
|
+
|
3
|
+
* Removed section_block from Messaging (because it was totally not useful)
|
4
|
+
|
1
5
|
# 2.0.2 (2014-04-16)
|
2
6
|
|
3
7
|
* Created backup method in Configurator
|
@@ -119,4 +123,4 @@
|
|
119
123
|
|
120
124
|
# 1.0.3 (2014-03-29)
|
121
125
|
|
122
|
-
* Initial release of CLIUtils
|
126
|
+
* Initial release of CLIUtils
|
data/Rakefile
CHANGED
@@ -20,19 +20,13 @@ Rake::TestTask.new do |t|
|
|
20
20
|
t.test_files = FileList['test/*_test.rb']
|
21
21
|
end
|
22
22
|
|
23
|
-
require 'pry'
|
24
|
-
desc 'Open up a PRY session with this gem loaded'
|
25
|
-
task :pry do
|
26
|
-
puts version
|
27
|
-
end
|
28
|
-
|
29
23
|
desc "Release CLIUtils version #{version}"
|
30
24
|
task :release => :build do
|
31
25
|
unless `git branch` =~ /^\* master$/
|
32
26
|
puts "You must be on the master branch to release!"
|
33
27
|
exit!
|
34
28
|
end
|
35
|
-
|
29
|
+
|
36
30
|
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
37
31
|
sh "git tag v#{version}"
|
38
32
|
sh "git push origin master"
|
data/cliutils.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency('bundler', '~> 1.5')
|
22
|
-
spec.add_development_dependency('pry', '~> 0.9')
|
23
22
|
spec.add_development_dependency('rake', '~> 0')
|
24
23
|
spec.add_development_dependency('yard', '0.8.7.4')
|
24
|
+
spec.add_runtime_dependency('launchy', '2.4.2')
|
25
25
|
end
|
data/lib/cliutils/constants.rb
CHANGED
data/lib/cliutils/messaging.rb
CHANGED
@@ -13,13 +13,13 @@ module CLIUtils
|
|
13
13
|
k.extend(self)
|
14
14
|
end
|
15
15
|
|
16
|
-
# Empty method so that Messaging doesn't freak
|
17
|
-
#
|
16
|
+
# Empty method so that Messaging doesn't freak out when passed a debug
|
17
|
+
# message.
|
18
18
|
# @return [void]
|
19
19
|
def debug(m); end
|
20
20
|
|
21
|
-
# Returns a default instance of LoggerDelegator that
|
22
|
-
#
|
21
|
+
# Returns a default instance of LoggerDelegator that delegates to STDOUT
|
22
|
+
# only.
|
23
23
|
# @return [LoggerDelegator]
|
24
24
|
def default_instance
|
25
25
|
stdout_logger = Logger.new(STDOUT)
|
@@ -47,7 +47,7 @@ module CLIUtils
|
|
47
47
|
# Wraps a block in an opening and closing info message.
|
48
48
|
# @param [String] m1 The opening message to output
|
49
49
|
# @param [String] m2 The closing message to output
|
50
|
-
# @param [
|
50
|
+
# @param [Boolean] multiline Whether the message should be multiline
|
51
51
|
# @yield
|
52
52
|
# @return [void]
|
53
53
|
def info_block(m1, m2 = 'Done.', multiline = false)
|
@@ -111,25 +111,6 @@ module CLIUtils
|
|
111
111
|
puts _word_wrap(m, '---> ').purple
|
112
112
|
end
|
113
113
|
|
114
|
-
# Wraps a block in an opening and closing section message.
|
115
|
-
# @param [String] m The opening message to output
|
116
|
-
# @param [<True, False>] multiline Whether the message should be multiline
|
117
|
-
# @yield
|
118
|
-
# @return [void]
|
119
|
-
def section_block(m, multiline = true)
|
120
|
-
if block_given?
|
121
|
-
if multiline
|
122
|
-
section(m)
|
123
|
-
else
|
124
|
-
print _word_wrap(m, '---> ').purple
|
125
|
-
end
|
126
|
-
|
127
|
-
yield
|
128
|
-
else
|
129
|
-
fail 'Did not specify a valid block'
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
114
|
# Outputs a formatted-green success message.
|
134
115
|
# @param [String] m The message to output
|
135
116
|
# @return [void]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'launchy'
|
2
|
+
|
1
3
|
module CLIUtils
|
2
4
|
# Pref Action to open a URL in the default
|
3
5
|
# browser.
|
@@ -5,7 +7,10 @@ module CLIUtils
|
|
5
7
|
# Runs the action.
|
6
8
|
# @return [void]
|
7
9
|
def run
|
8
|
-
|
10
|
+
url = @parameters[:url]
|
11
|
+
Launchy.open(url) do |exception|
|
12
|
+
puts "Failed to open #{ url }: #{ exception }"
|
13
|
+
end
|
9
14
|
end
|
10
15
|
end
|
11
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cliutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Bach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -25,47 +25,47 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: yard
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.8.7.4
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.8.7.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: launchy
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
type: :
|
61
|
+
version: 2.4.2
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.4.2
|
69
69
|
description: A library of functionality designed to alleviate common tasks and headaches
|
70
70
|
when developing command-line (CLI) apps in Ruby.
|
71
71
|
email:
|