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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdf67aa4209a6fcb36db63a0b84313c539c7d2f3
4
- data.tar.gz: c180f98c6075639be2c28ab114ea2b331abaf111
3
+ metadata.gz: 468c8c7908c0a02ded8062f42e6eb6fc72bbc777
4
+ data.tar.gz: 801140b94e5d9bba9c84b1879d7d6cbe5365302e
5
5
  SHA512:
6
- metadata.gz: fa8a999f929b9bd694983ce2e4f2e6430ec1c8c21bb03b715d1fe8215e40cccc4c55df1e7d95ac968fe4099fd1ab250d078eb909d67580056980ed584207c0af
7
- data.tar.gz: 41f09163ab9109af87277c860cdd0955d1382bef320b151206882e31074af675098de80ba3139325cea8de81b5aed41f288231f07d87a5a7ee225492c52ecc78
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
@@ -1,5 +1,5 @@
1
1
  # Stores constants to use.
2
2
  module CLIUtils
3
3
  # The current version of the gem
4
- VERSION = '2.0.2'
4
+ VERSION = '2.0.3'
5
5
  end
@@ -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
- # out when passed a debug message.
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
- # delegates to STDOUT only.
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 [<True, False>] multiline Whether the message should be multiline
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
- `open #{ @parameters[:url] }`
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.2
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-16 00:00:00.000000000 Z
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: pry
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.9'
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.9'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: yard
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
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: '0'
54
+ version: 0.8.7.4
55
55
  - !ruby/object:Gem::Dependency
56
- name: yard
56
+ name: launchy
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.7.4
62
- type: :development
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: 0.8.7.4
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: