mdcat 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +12 -0
- data/bin/console +11 -0
- data/bin/mdcat +50 -0
- data/bin/setup +8 -0
- data/lib/mdcat/version.rb +1 -1
- data/mdcat.gemspec +35 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6480d38f60a8d5f68edcb7ed52cc2bfc9c390fe67b0612a0e6fdf41da37d3e2a
|
4
|
+
data.tar.gz: d7d848354cc9734c44c3a19d36a04c5f6b96e5e7a973cd30019bb5fd6d4f91e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8622b856d27be9598b49ff78df74ec42a811b04f727495e7e0de58935309237e2300abffbb61d6138aeec4431de9cfd9310e9ffb96139f557b46462cf60b2e7
|
7
|
+
data.tar.gz: f13ec380da0853f84d1d0b7abd4c67c18d208b1f2e751c2d7c69de035355eb75825a0f861859307d6690f247344611f28fa546603f013a008ebd7a2a1afd598b
|
data/Gemfile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "mdcat"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
require "irb"
|
11
|
+
IRB.start(__FILE__)
|
data/bin/mdcat
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
|
5
|
+
|
6
|
+
require "mdcat"
|
7
|
+
require "tty-markdown"
|
8
|
+
|
9
|
+
BANNER = %{
|
10
|
+
_ _
|
11
|
+
_ __ __| |__ __ _| |_
|
12
|
+
| ' \/ _` / _/ _` | _|
|
13
|
+
|_|_|_\__,_\__\__,_|\__|
|
14
|
+
version (#{Mdcat::VERSION})
|
15
|
+
}
|
16
|
+
|
17
|
+
def help
|
18
|
+
puts %(
|
19
|
+
#{BANNER}
|
20
|
+
|
21
|
+
USAGE
|
22
|
+
mdcat <file>
|
23
|
+
|
24
|
+
COMMANDS
|
25
|
+
mdcat -h, help show this help message
|
26
|
+
|
27
|
+
EXAMPLES
|
28
|
+
`mdcat README.md` for printing to stdout
|
29
|
+
`mdcat README.md | less` for paging long documents
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
# commands
|
34
|
+
if ARGV[0] == "-h" || ARGV[0] == "help"
|
35
|
+
help and exit(0)
|
36
|
+
end
|
37
|
+
|
38
|
+
# validations
|
39
|
+
file_path = ARGV[0]
|
40
|
+
help and exit(1) if file_path.nil?
|
41
|
+
|
42
|
+
file = File.expand_path(file_path)
|
43
|
+
unless File.exist?(file)
|
44
|
+
help
|
45
|
+
puts "File not found: #{file}"
|
46
|
+
exit 1
|
47
|
+
end
|
48
|
+
|
49
|
+
# proessing file and output
|
50
|
+
puts TTY::Markdown.parse_file(file)
|
data/bin/setup
ADDED
data/lib/mdcat/version.rb
CHANGED
data/mdcat.gemspec
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/mdcat/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "mdcat"
|
7
|
+
spec.version = Mdcat::VERSION
|
8
|
+
spec.authors = ["Daniel Vinciguerra"]
|
9
|
+
spec.email = ["daniel.vinciguerra@bivee.com.br"]
|
10
|
+
|
11
|
+
spec.summary = "mdcat is a command line tool to cat markdown files with syntax highlight"
|
12
|
+
spec.description = "mdcat is a command line tool to cat markdown files with syntax highlight"
|
13
|
+
spec.homepage = "https://github.com/dvinciguerra/mdcat"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.7.0"
|
16
|
+
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
+
spec.metadata["changelog_uri"] = spec.homepage
|
20
|
+
|
21
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
22
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
23
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
24
|
+
end
|
25
|
+
end
|
26
|
+
# spec.bindir = 'exe'
|
27
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ['lib']
|
29
|
+
|
30
|
+
# Uncomment to register a new dependency of your gem
|
31
|
+
spec.add_dependency "tty-markdown"
|
32
|
+
|
33
|
+
# For more information and examples about making a new gem, check out our
|
34
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
35
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Vinciguerra
|
@@ -27,17 +27,25 @@ dependencies:
|
|
27
27
|
description: mdcat is a command line tool to cat markdown files with syntax highlight
|
28
28
|
email:
|
29
29
|
- daniel.vinciguerra@bivee.com.br
|
30
|
-
executables:
|
30
|
+
executables:
|
31
|
+
- console
|
32
|
+
- mdcat
|
33
|
+
- setup
|
31
34
|
extensions: []
|
32
35
|
extra_rdoc_files: []
|
33
36
|
files:
|
34
37
|
- ".rspec"
|
35
38
|
- ".rubocop.yml"
|
39
|
+
- Gemfile
|
36
40
|
- LICENSE.txt
|
37
41
|
- README.md
|
38
42
|
- Rakefile
|
43
|
+
- bin/console
|
44
|
+
- bin/mdcat
|
45
|
+
- bin/setup
|
39
46
|
- lib/mdcat.rb
|
40
47
|
- lib/mdcat/version.rb
|
48
|
+
- mdcat.gemspec
|
41
49
|
- sig/mdcat.rbs
|
42
50
|
homepage: https://github.com/dvinciguerra/mdcat
|
43
51
|
licenses:
|