bashly 2.0.0.rc2 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65ab4d9e6acb0f638497f14958c9bebc78219cbb1c677d75b5f9f98506301e4c
4
- data.tar.gz: fadcbfe0d4dcc48d6081d50f2a76bc57730ebd6e44b7c9a232350e7d072f2d3c
3
+ metadata.gz: 2b62acae70a34336bc58d4e08f0986c1a0d97e3b389da1afdcf6a055b27b7d25
4
+ data.tar.gz: 45026b4152f2513db32bcc6faf97df9ae7e64018512177e43857ac333415ed04
5
5
  SHA512:
6
- metadata.gz: a775101849773351872c8f84ce312ec9d5ebc7a460bfed5858de9edf41d524c319e3dd48c424d3be30379ef79ee3e1d1e4bc4efd4b2b5164f641a3c3e47ee03e
7
- data.tar.gz: 58ebb9d697a27856f7383d0ad69a5de4c06b21766347c769f241c1dcd947f2703bb932abf0733624e9a3fc7f475891076136d0038734cbe0b346a90b89d6192c
6
+ metadata.gz: 21297a4abec515de26a3df6f2e5461d6af45a3c62530f9b497b4562b33a7576e02cff564f9197ec1b6d9b36ba930ad7619b448f9f6d98d56bd2a1dffb4b14367
7
+ data.tar.gz: 565ae83aa6ddc3971cc6d9fbcab5bebecbafc3ea5013c286c51faa3f977cfa4aacf7adaecaff84130627c8539fa378bb5a59de53b4fc4e97b5171c1a25b26895
@@ -29,7 +29,7 @@ module Bashly
29
29
  else
30
30
  add_lib args['LIBRARY']
31
31
  end
32
-
32
+ ensure
33
33
  lib_source.cleanup if lib_source.git?
34
34
  end
35
35
 
@@ -107,6 +107,8 @@ module Bashly
107
107
  quiet_say "r`warning` not upgrading c`#{existing_file}`, " \
108
108
  "unknown library '#{library_name}'"
109
109
  end
110
+ ensure
111
+ source.cleanup if source&.git?
110
112
  end
111
113
 
112
114
  def upgrade!(existing_file, library)
@@ -1,5 +1,3 @@
1
- require 'lp'
2
-
3
1
  module Bashly
4
2
  module Commands
5
3
  class Validate < Base
@@ -13,7 +11,7 @@ module Bashly
13
11
 
14
12
  def run
15
13
  if args['--verbose']
16
- lp config
14
+ puts config.to_yaml
17
15
  puts '---'
18
16
  end
19
17
  validate_config
@@ -1,5 +1,6 @@
1
1
  # render script - mandoc
2
2
  require 'gtx'
3
+ require 'shellwords'
3
4
 
4
5
  # Load the GTX template
5
6
  template = "#{source}/mandoc.gtx"
@@ -12,9 +13,12 @@ save_manpage = lambda { |command|
12
13
  save mdfile, gtx.parse(command)
13
14
 
14
15
  # The pandoc command that creates a manpage from markdown
15
- cmd = %[pandoc -f markdown-smart -s --to man "#{mdfile}" > "#{manfile}"]
16
- success = system cmd
17
- raise "Failed running pandoc\nMake sure the following command succeeds and try again:\n\n #{cmd}" unless success
16
+ command = ['pandoc', '-f', 'markdown-smart', '-s', '--to', 'man', mdfile, '-o', manfile]
17
+ success = system(*command)
18
+ unless success
19
+ command_string = Shellwords.join command
20
+ raise "Failed running pandoc\nMake sure the following command succeeds and try again:\n\n #{command_string}"
21
+ end
18
22
 
19
23
  say "g`saved` #{manfile}"
20
24
  }
@@ -30,5 +34,5 @@ end
30
34
  # Show one of the files if requested
31
35
  if show
32
36
  file = "#{target}/#{show}"
33
- system "man #{file}" if File.exist?(file)
37
+ system 'man', file if File.exist?(file)
34
38
  end
@@ -1,4 +1,5 @@
1
1
  require 'fileutils'
2
+ require 'shellwords'
2
3
  require 'tmpdir'
3
4
 
4
5
  module Bashly
@@ -34,7 +35,8 @@ module Bashly
34
35
  end
35
36
 
36
37
  def cleanup
37
- FileUtils.rm_rf(File.join(Dir.tmpdir, 'bashly-libs-*'))
38
+ FileUtils.rm_rf @tmpdir if @tmpdir
39
+ @tmpdir = nil
38
40
  end
39
41
 
40
42
  private
@@ -48,11 +50,11 @@ module Bashly
48
50
  end
49
51
 
50
52
  def git_clone
51
- dir = Dir.mktmpdir 'bashly-libs-'
52
- safe_run "git clone --quiet #{git_specs[:url]} #{dir}"
53
- safe_run %[git -C "#{dir}" checkout --quiet #{git_specs[:ref]}] if git_specs[:ref]
53
+ @tmpdir = Dir.mktmpdir 'bashly-libs-'
54
+ safe_run 'git', 'clone', '--quiet', git_specs[:url], @tmpdir
55
+ safe_run 'git', '-C', @tmpdir, 'checkout', '--quiet', git_specs[:ref] if git_specs[:ref]
54
56
 
55
- "#{dir}#{git_specs[:path]}"
57
+ "#{@tmpdir}#{git_specs[:path]}"
56
58
  end
57
59
 
58
60
  def git_specs
@@ -70,8 +72,8 @@ module Bashly
70
72
  end
71
73
  end
72
74
 
73
- def safe_run(cmd)
74
- raise "Failed running command:\nm`#{cmd}`" unless system cmd
75
+ def safe_run(*command)
76
+ raise "Failed running command:\nm`#{Shellwords.join command}`" unless system(*command)
75
77
  end
76
78
 
77
79
  def transform_github_uri
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = '2.0.0.rc2'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -18,6 +18,16 @@ if catch_all.enabled?
18
18
  > break
19
19
  > ;;
20
20
  >
21
+ else
22
+ > --)
23
+ > shift
24
+ > while [[ $# -gt 0 ]]; do
25
+ > key="$1"
26
+ = render(:parse_requirements_case).indent(8)
27
+ > done
28
+ > break
29
+ > ;;
30
+ >
21
31
  end
22
32
 
23
33
  > -?*)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
@@ -37,20 +37,6 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: 0.1.1
40
- - !ruby/object:Gem::Dependency
41
- name: lp
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: 0.2.0
47
- type: :runtime
48
- prerelease: false
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: 0.2.0
54
40
  - !ruby/object:Gem::Dependency
55
41
  name: mister_bin
56
42
  requirement: !ruby/object:Gem::Requirement
@@ -323,7 +309,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
309
  - !ruby/object:Gem::Version
324
310
  version: '0'
325
311
  requirements: []
326
- rubygems_version: 4.0.17
312
+ rubygems_version: 4.0.19
327
313
  specification_version: 4
328
314
  summary: Bash command-line framework and CLI generator
329
315
  test_files: []