mdcat 0.1.0 → 0.3.0

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: 3bfeb6dcfb8342e66241fc48e52079917d57d0aef0cd6e5432454182aa7253c7
4
- data.tar.gz: 94dc54a5b3f85fa7afbb25d40075eb440a8c38df56d0485065a44bfc87d9bbf5
3
+ metadata.gz: 3230ada7366241572efd5432611638066224ed9c467ca9a8a136942cdc45f91d
4
+ data.tar.gz: 98fe44332942419dc31f0d28b4b3ced5e0715d7f23560846e93faa1aafd709ad
5
5
  SHA512:
6
- metadata.gz: 3d21373ca1a3b6db635db2147592d045c05b39b1296ab0f17b5b18f6ede95a6bbacbc98c99eb950fcc79a9bf0a0360cba1fbe29ae5f45fb6d8e2fe98c38a490d
7
- data.tar.gz: 77343a580db30d6239a5dff6512fbb84f1d9a6b70091b7a2560cbecb8bc85dcc59eed9325741e8d03eac9ee04bd5d3e6e9df531c6c5ca04840c57f6ac97609c1
6
+ metadata.gz: 5d9ba213e33c46205a72c6e0bec52e39f85a0410eb31772c8715c055322becab43e42e4fd676a0eaf36d945d7cd6f6df10b13cd4be1235f1c6921c4c0606e322
7
+ data.tar.gz: c9e3b9513ff985bf90cd9208c4d6d5e3fa38c1946b9556753f26fce479ac60831e584212973dd424399dac1437f357839023e47c8bdc58be3f5b1cb1e9c205ee
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in mdcat.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,82 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mdcat (0.1.0)
5
+ tty-markdown
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ diff-lcs (1.5.0)
12
+ json (2.7.0)
13
+ kramdown (2.4.0)
14
+ rexml
15
+ language_server-protocol (3.17.0.3)
16
+ parallel (1.23.0)
17
+ parser (3.2.2.4)
18
+ ast (~> 2.4.1)
19
+ racc
20
+ pastel (0.8.0)
21
+ tty-color (~> 0.5)
22
+ racc (1.7.3)
23
+ rainbow (3.1.1)
24
+ rake (13.1.0)
25
+ regexp_parser (2.8.2)
26
+ rexml (3.2.6)
27
+ rouge (4.1.3)
28
+ rspec (3.12.0)
29
+ rspec-core (~> 3.12.0)
30
+ rspec-expectations (~> 3.12.0)
31
+ rspec-mocks (~> 3.12.0)
32
+ rspec-core (3.12.2)
33
+ rspec-support (~> 3.12.0)
34
+ rspec-expectations (3.12.3)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.12.0)
37
+ rspec-mocks (3.12.6)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.12.0)
40
+ rspec-support (3.12.1)
41
+ rubocop (1.58.0)
42
+ json (~> 2.3)
43
+ language_server-protocol (>= 3.17.0)
44
+ parallel (~> 1.10)
45
+ parser (>= 3.2.2.4)
46
+ rainbow (>= 2.2.2, < 4.0)
47
+ regexp_parser (>= 1.8, < 3.0)
48
+ rexml (>= 3.2.5, < 4.0)
49
+ rubocop-ast (>= 1.30.0, < 2.0)
50
+ ruby-progressbar (~> 1.7)
51
+ unicode-display_width (>= 2.4.0, < 3.0)
52
+ rubocop-ast (1.30.0)
53
+ parser (>= 3.2.1.0)
54
+ ruby-progressbar (1.13.0)
55
+ strings (0.2.1)
56
+ strings-ansi (~> 0.2)
57
+ unicode-display_width (>= 1.5, < 3.0)
58
+ unicode_utils (~> 1.4)
59
+ strings-ansi (0.2.0)
60
+ tty-color (0.6.0)
61
+ tty-markdown (0.7.2)
62
+ kramdown (>= 1.16.2, < 3.0)
63
+ pastel (~> 0.8)
64
+ rouge (>= 3.14, < 5.0)
65
+ strings (~> 0.2.0)
66
+ tty-color (~> 0.5)
67
+ tty-screen (~> 0.8)
68
+ tty-screen (0.8.1)
69
+ unicode-display_width (2.5.0)
70
+ unicode_utils (1.4.0)
71
+
72
+ PLATFORMS
73
+ ruby
74
+
75
+ DEPENDENCIES
76
+ mdcat!
77
+ rake (~> 13.0)
78
+ rspec (~> 3.0)
79
+ rubocop (~> 1.21)
80
+
81
+ BUNDLED WITH
82
+ 2.4.22
data/bin/mdcat ADDED
@@ -0,0 +1,54 @@
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 = %q(
10
+ _ _
11
+ _ __ __| |__ __ _| |_
12
+ | ' \/ _` / _/ _` | _|
13
+ |_|_|_\__,_\__\__,_|\__|
14
+ )
15
+
16
+ def help
17
+ puts %(
18
+ #{BANNER}
19
+ version (#{Mdcat::VERSION})
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
36
+ exit(0)
37
+ end
38
+
39
+ # validations
40
+ file_path = ARGV[0]
41
+ if file_path.nil?
42
+ help
43
+ exit(1)
44
+ end
45
+
46
+ file = File.expand_path(file_path)
47
+ unless File.exist?(file)
48
+ help
49
+ puts "File not found: #{file}"
50
+ exit(1)
51
+ end
52
+
53
+ # proessing file and output
54
+ puts TTY::Markdown.parse_file(file)
data/lib/mdcat/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mdcat
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
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.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Vinciguerra
@@ -27,17 +27,22 @@ 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
+ - mdcat
31
32
  extensions: []
32
33
  extra_rdoc_files: []
33
34
  files:
34
35
  - ".rspec"
35
36
  - ".rubocop.yml"
37
+ - Gemfile
38
+ - Gemfile.lock
36
39
  - LICENSE.txt
37
40
  - README.md
38
41
  - Rakefile
42
+ - bin/mdcat
39
43
  - lib/mdcat.rb
40
44
  - lib/mdcat/version.rb
45
+ - mdcat.gemspec
41
46
  - sig/mdcat.rbs
42
47
  homepage: https://github.com/dvinciguerra/mdcat
43
48
  licenses: