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 +4 -4
- data/lib/bashly/commands/add.rb +1 -1
- data/lib/bashly/commands/generate.rb +2 -0
- data/lib/bashly/commands/validate.rb +1 -3
- data/lib/bashly/libraries/render/mandoc/render.rb +8 -4
- data/lib/bashly/library_source.rb +9 -7
- data/lib/bashly/version.rb +1 -1
- data/lib/bashly/views/command/parse_requirements_while.gtx +10 -0
- metadata +2 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2b62acae70a34336bc58d4e08f0986c1a0d97e3b389da1afdcf6a055b27b7d25
|
|
4
|
+
data.tar.gz: 45026b4152f2513db32bcc6faf97df9ae7e64018512177e43857ac333415ed04
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21297a4abec515de26a3df6f2e5461d6af45a3c62530f9b497b4562b33a7576e02cff564f9197ec1b6d9b36ba930ad7619b448f9f6d98d56bd2a1dffb4b14367
|
|
7
|
+
data.tar.gz: 565ae83aa6ddc3971cc6d9fbcab5bebecbafc3ea5013c286c51faa3f977cfa4aacf7adaecaff84130627c8539fa378bb5a59de53b4fc4e97b5171c1a25b26895
|
data/lib/bashly/commands/add.rb
CHANGED
|
@@ -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
|
-
|
|
16
|
-
success = system
|
|
17
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
52
|
-
safe_run
|
|
53
|
-
safe_run
|
|
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
|
-
"#{
|
|
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(
|
|
74
|
-
raise "Failed running command:\nm`#{
|
|
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
|
data/lib/bashly/version.rb
CHANGED
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
|
|
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.
|
|
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: []
|