cli_markdown 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: ec2eb95b5cd0c7a7295f1b31195979c9d9fad652676517a0e59166875b76e330
4
- data.tar.gz: 0cf8d886a34c22b26ffa8f8fe49f12ab68a30e36286ddfcb149646394939dac9
3
+ metadata.gz: dbea0fd699683bc2e402c1a0ec809b6a457a32eef56b8ac95b5e529c40f50170
4
+ data.tar.gz: c4c9dc36d788d020a7bfc8f8124e27bfac5fb3da4a3cc452cab63dcb5a1cafcd
5
5
  SHA512:
6
- metadata.gz: 65805b1221655539b07cfb7144f4ed86e52446f7ee8c5e1d04972b5e5615e13f3dabcecfb0face82f17f1db4433795d4edf859749304e5cf010ae40a55b9c75b
7
- data.tar.gz: a6b7bf93e2763b2e3557a0d0f8c6e57cba0081be9476267059b0c4b66a26d89da0fb84355165edfe679d74601e9ad3beb3682a3eb94403fbddbcbd06c34db6d3
6
+ metadata.gz: 3eb1acf51d748b6cc380e491cf7263509685ec72207f2cd329a9053754625b1d6155085fd8408a387d78f66c4fae3f376684861776a64067a2cfdbcb978c9570
7
+ data.tar.gz: b8066d9900fd282156475a423bdcf94a2d55c0304404db2b1b153ecf550e5746dcd097e329521ae440d25dd683e39459aae7d01fb3eb58f15ec3667cc9e933d1
data/.gitignore CHANGED
@@ -7,3 +7,7 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  /docs
10
+ Gemfile
11
+ /Gemfile.lock
12
+ /bin
13
+
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## [0.1.3] - 2022-03-03
4
+ - ensure docs/_includes folder exists
5
+
6
+ ## [0.1.2] - 2021-12-29
7
+ - dont generate docs for hidden commands
8
+
9
+ ## [0.1.1] - 2021-12-29
10
+ - fix cli markdown initialize options
11
+
3
12
  ## [0.1.0]
4
13
  - Initial release
5
14
  - Extract cli doc generation out of lono
data/Rakefile CHANGED
@@ -1,11 +1,2 @@
1
1
  require "bundler/gem_tasks"
2
2
  task :default => :spec
3
-
4
- # In a real project the require will be the project itself.
5
- # This ask is only here to pass specs.
6
- require "lono"
7
- require "./lib/cli_markdown"
8
- desc "Generates cli reference docs as markdown"
9
- task :docs do
10
- CliMarkdown::Creator.create_all(cli_class: Lono::CLI, cli_name: "lono")
11
- end
data/cli_markdown.gemspec CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler"
22
- spec.add_development_dependency "lono"
23
22
  spec.add_development_dependency "rake"
24
23
  spec.add_development_dependency "rspec"
25
24
  end
@@ -1,3 +1,4 @@
1
+ require "active_support"
1
2
  require "active_support/core_ext/object"
2
3
 
3
4
  module CliMarkdown
@@ -15,16 +16,17 @@ module CliMarkdown
15
16
  end
16
17
 
17
18
  # cli_class is top-level CLI class.
18
- def initialize(cli_class:, cli_name:, parent_command_name: nil)
19
- @cli_class = cli_class
20
- @cli_name = cli_name
21
- @parent_command_name = parent_command_name
19
+ def initialize(options={})
20
+ @cli_class = options[:cli_class]
21
+ @cli_name = options[:cli_name]
22
+ @parent_command_name = options[:parent_command_name]
22
23
  end
23
24
 
24
25
  def create_all
25
26
  create_index unless @parent_command_name
26
27
 
27
- @cli_class.commands.keys.each do |command_name|
28
+ commands = @cli_class.commands.reject { |command_name, command| command.hidden? }
29
+ commands.keys.each do |command_name|
28
30
  page = Page.new(
29
31
  cli_class: @cli_class,
30
32
  cli_name: @cli_name,
@@ -63,6 +65,7 @@ module CliMarkdown
63
65
 
64
66
  def create_include_reference
65
67
  path = "docs/_includes/reference.md"
68
+ FileUtils.mkdir_p(File.dirname(path))
66
69
  IO.write(path, "Generic tool description. Please edit #{path} with a description.") unless File.exist?(path)
67
70
  end
68
71
 
@@ -10,7 +10,8 @@ module CliMarkdown
10
10
  end
11
11
 
12
12
  def command_list
13
- @cli_class.commands.keys.sort.map.each do |command_name|
13
+ commands = @cli_class.commands.reject { |command_name, command| command.hidden? }
14
+ commands.keys.sort.map.each do |command_name|
14
15
  page = Page.new(
15
16
  cli_class: @cli_class,
16
17
  cli_name: @cli_name,
@@ -2,7 +2,7 @@ module CliMarkdown
2
2
  class Page
3
3
  attr_reader :cli_name
4
4
  def initialize(cli_class:, cli_name:, command_name:, parent_command_name: nil)
5
- @cli_class = cli_class # IE: Lono::CLI
5
+ @cli_class = cli_class # IE: Jets::Commands::Main
6
6
  @cli_name = cli_name # IE: lono
7
7
  @command_name = command_name # IE: generate
8
8
  @parent_command_name = parent_command_name # IE: cfn
@@ -1,3 +1,3 @@
1
1
  module CliMarkdown
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cli_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-26 00:00:00.000000000 Z
11
+ date: 2022-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: lono
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rake
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -77,11 +63,8 @@ files:
77
63
  - ".rspec"
78
64
  - CHANGELOG.md
79
65
  - Gemfile
80
- - Gemfile.lock
81
66
  - README.md
82
67
  - Rakefile
83
- - bin/console
84
- - bin/setup
85
68
  - cli_markdown.gemspec
86
69
  - lib/cli_markdown.rb
87
70
  - lib/cli_markdown/creator.rb
@@ -107,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
90
  - !ruby/object:Gem::Version
108
91
  version: '0'
109
92
  requirements: []
110
- rubyforge_project:
111
- rubygems_version: 2.7.3
93
+ rubygems_version: 3.2.32
112
94
  signing_key:
113
95
  specification_version: 4
114
96
  summary: Generate markdown docs from cli docs
data/Gemfile.lock DELETED
@@ -1,129 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- cli_markdown (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- activesupport (5.1.5)
10
- concurrent-ruby (~> 1.0, >= 1.0.2)
11
- i18n (~> 0.7)
12
- minitest (~> 5.1)
13
- tzinfo (~> 1.1)
14
- aws-partitions (1.67.0)
15
- aws-sdk-cloudformation (1.3.0)
16
- aws-sdk-core (~> 3)
17
- aws-sigv4 (~> 1.0)
18
- aws-sdk-core (3.16.0)
19
- aws-partitions (~> 1.0)
20
- aws-sigv4 (~> 1.0)
21
- jmespath (~> 1.0)
22
- aws-sdk-kms (1.5.0)
23
- aws-sdk-core (~> 3)
24
- aws-sigv4 (~> 1.0)
25
- aws-sdk-s3 (1.8.2)
26
- aws-sdk-core (~> 3)
27
- aws-sdk-kms (~> 1)
28
- aws-sigv4 (~> 1.0)
29
- aws-sigv4 (1.0.2)
30
- coderay (1.1.2)
31
- colorize (0.8.1)
32
- concurrent-ruby (1.0.5)
33
- diff-lcs (1.3)
34
- ffi (1.9.23)
35
- filesize (0.1.1)
36
- formatador (0.2.5)
37
- graph (2.8.2)
38
- guard (2.14.2)
39
- formatador (>= 0.2.4)
40
- listen (>= 2.7, < 4.0)
41
- lumberjack (>= 1.0.12, < 2.0)
42
- nenv (~> 0.1)
43
- notiffany (~> 0.0)
44
- pry (>= 0.9.12)
45
- shellany (~> 0.0)
46
- thor (>= 0.18.1)
47
- guard-cloudformation (0.0.3)
48
- colorize
49
- guard
50
- guard-compat (1.2.1)
51
- guard-lono (1.0.1)
52
- colorize
53
- guard
54
- guard-compat
55
- hashie (3.5.7)
56
- i18n (0.9.5)
57
- concurrent-ruby (~> 1.0)
58
- jmespath (1.3.1)
59
- json (2.1.0)
60
- listen (3.1.5)
61
- rb-fsevent (~> 0.9, >= 0.9.4)
62
- rb-inotify (~> 0.9, >= 0.9.7)
63
- ruby_dep (~> 1.2)
64
- lono (4.0.6)
65
- activesupport
66
- aws-sdk-cloudformation
67
- aws-sdk-s3
68
- colorize
69
- filesize
70
- graph
71
- guard
72
- guard-cloudformation
73
- guard-lono
74
- hashie
75
- json
76
- rb-fsevent
77
- render_me_pretty
78
- thor
79
- lumberjack (1.0.12)
80
- method_source (0.9.0)
81
- minitest (5.11.3)
82
- nenv (0.3.0)
83
- notiffany (0.1.1)
84
- nenv (~> 0.1)
85
- shellany (~> 0.0)
86
- pry (0.11.3)
87
- coderay (~> 1.1.0)
88
- method_source (~> 0.9.0)
89
- rake (12.3.0)
90
- rb-fsevent (0.10.2)
91
- rb-inotify (0.9.10)
92
- ffi (>= 0.5.0, < 2)
93
- render_me_pretty (0.7.1)
94
- activesupport
95
- colorize
96
- tilt
97
- rspec (3.7.0)
98
- rspec-core (~> 3.7.0)
99
- rspec-expectations (~> 3.7.0)
100
- rspec-mocks (~> 3.7.0)
101
- rspec-core (3.7.1)
102
- rspec-support (~> 3.7.0)
103
- rspec-expectations (3.7.0)
104
- diff-lcs (>= 1.2.0, < 2.0)
105
- rspec-support (~> 3.7.0)
106
- rspec-mocks (3.7.0)
107
- diff-lcs (>= 1.2.0, < 2.0)
108
- rspec-support (~> 3.7.0)
109
- rspec-support (3.7.1)
110
- ruby_dep (1.5.0)
111
- shellany (0.0.1)
112
- thor (0.20.0)
113
- thread_safe (0.3.6)
114
- tilt (2.0.8)
115
- tzinfo (1.2.5)
116
- thread_safe (~> 0.1)
117
-
118
- PLATFORMS
119
- ruby
120
-
121
- DEPENDENCIES
122
- bundler
123
- cli_markdown!
124
- lono
125
- rake
126
- rspec
127
-
128
- BUNDLED WITH
129
- 1.16.1
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "cli_markdown"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here