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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bfeb6dcfb8342e66241fc48e52079917d57d0aef0cd6e5432454182aa7253c7
4
- data.tar.gz: 94dc54a5b3f85fa7afbb25d40075eb440a8c38df56d0485065a44bfc87d9bbf5
3
+ metadata.gz: 6480d38f60a8d5f68edcb7ed52cc2bfc9c390fe67b0612a0e6fdf41da37d3e2a
4
+ data.tar.gz: d7d848354cc9734c44c3a19d36a04c5f6b96e5e7a973cd30019bb5fd6d4f91e9
5
5
  SHA512:
6
- metadata.gz: 3d21373ca1a3b6db635db2147592d045c05b39b1296ab0f17b5b18f6ede95a6bbacbc98c99eb950fcc79a9bf0a0360cba1fbe29ae5f45fb6d8e2fe98c38a490d
7
- data.tar.gz: 77343a580db30d6239a5dff6512fbb84f1d9a6b70091b7a2560cbecb8bc85dcc59eed9325741e8d03eac9ee04bd5d3e6e9df531c6c5ca04840c57f6ac97609c1
6
+ metadata.gz: e8622b856d27be9598b49ff78df74ec42a811b04f727495e7e0de58935309237e2300abffbb61d6138aeec4431de9cfd9310e9ffb96139f557b46462cf60b2e7
7
+ data.tar.gz: f13ec380da0853f84d1d0b7abd4c67c18d208b1f2e751c2d7c69de035355eb75825a0f861859307d6690f247344611f28fa546603f013a008ebd7a2a1afd598b
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/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
@@ -0,0 +1,8 @@
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
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.2.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.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: