mdcat 0.2.0 → 0.4.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: 6480d38f60a8d5f68edcb7ed52cc2bfc9c390fe67b0612a0e6fdf41da37d3e2a
4
- data.tar.gz: d7d848354cc9734c44c3a19d36a04c5f6b96e5e7a973cd30019bb5fd6d4f91e9
3
+ metadata.gz: f71ba396910974ce42ac68e13ff3065d6baa4f202944272d92c81ed43e2fe59b
4
+ data.tar.gz: a8e4fa4441873103f6f0a3425d43cbcc1babb814c7cc9ac2fb872bfc4efe3b65
5
5
  SHA512:
6
- metadata.gz: e8622b856d27be9598b49ff78df74ec42a811b04f727495e7e0de58935309237e2300abffbb61d6138aeec4431de9cfd9310e9ffb96139f557b46462cf60b2e7
7
- data.tar.gz: f13ec380da0853f84d1d0b7abd4c67c18d208b1f2e751c2d7c69de035355eb75825a0f861859307d6690f247344611f28fa546603f013a008ebd7a2a1afd598b
6
+ metadata.gz: 3f33aa291a8f6c14f0fd57876e4f3830d5037bfe45d5489944a0d124816f035daac9fbfec98697a05f8a6e46c16ea5c310dfa8ed3fef4b4601979eb4ee03d79b
7
+ data.tar.gz: a11423ac7e84072bd19792ea832847275a21363cca526ba42dbdcf7710d027b2bfb2af33739f3f74ddb8d0b70acd009da6c9a27d9d0745331fbaa18839a40e0c
data/Changelog.md ADDED
@@ -0,0 +1,44 @@
1
+
2
+ # Changelog
3
+
4
+ All notable changes to this project will be documented in this file.
5
+
6
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ ## [Unreleased]
10
+
11
+ <!--
12
+ RELEASE TEMPLATE
13
+ ======================
14
+
15
+ ## [0.0.0] - 2024-01-01
16
+
17
+ ### Added
18
+
19
+ - Add support to open README or index by default
20
+
21
+ ### Fixed
22
+
23
+ - Fix missing logo
24
+
25
+ ### Changed
26
+
27
+ - Upgrade dependencie tty-markdown
28
+
29
+ ### Removed
30
+
31
+ - Identical links assigned in each translation file
32
+
33
+ -->
34
+
35
+
36
+ ## [0.4.0] - 2024-01-18
37
+
38
+ ### Added
39
+
40
+ - Add support to open README.md or index.md by default
41
+
42
+
43
+ [unreleased]: https://github.com/dvinciguerra/mdcat/compare/v0.4.0...HEAD
44
+ [0.4.0]: https://github.com/dvinciguerra/mdcat/compare/v0.3.0...v0.4.0
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/README.md CHANGED
@@ -1,35 +1,39 @@
1
- # Mdcat
1
+ # mdcat
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
3
+ [![Gem Version](https://badge.fury.io/rb/mdcat.svg)](https://badge.fury.io/rb/mdcat)
4
+ [![Build Status](https://travis-ci.org/dvinciguerra/mdcat.svg?branch=master)](https://travis-ci.org/dvinciguerra/mdcat)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/cf154e97f0e6c10614b4/maintainability)](https://codeclimate.com/github/dvinciguerra/mdcat/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/cf154e97f0e6c10614b4/test_coverage)](https://codeclimate.com/github/dvinciguerra/mdcat/test_coverage)
4
7
 
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mdcat`. To experiment with that code, run `bin/console` for an interactive prompt.
8
+ `mdcat` is a command line tool write in Ruby to display markdown files in the terminal.
6
9
 
7
10
  ## Installation
8
11
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
12
+ The recommended way to install `mdcat` is via RubyGems:
10
13
 
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
-
15
- If bundler is not being used to manage dependencies, install the gem by executing:
16
-
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
+ $ gem install mdcat
18
15
 
19
16
  ## Usage
20
17
 
21
- TODO: Write usage instructions here
18
+ ### Displaying a file
19
+
20
+ $ mdcat README.md
22
21
 
23
- ## Development
22
+ ### For help
24
23
 
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+ $ mdcat help
26
25
 
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
26
 
29
27
  ## Contributing
30
28
 
31
29
  Bug reports and pull requests are welcome on GitHub at https://github.com/dvinciguerra/mdcat.
32
30
 
31
+
33
32
  ## License
34
33
 
35
34
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
35
+
36
+
37
+ ## Author
38
+
39
+ [Daniel Vinciguerra](https://github.com/dvinciguerra)
data/bin/mdcat CHANGED
@@ -6,20 +6,22 @@ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
6
6
  require "mdcat"
7
7
  require "tty-markdown"
8
8
 
9
- BANNER = %{
9
+ DEFAULT_FILES = %w[README.md index.md].freeze
10
+
11
+ BANNER = %q(
10
12
  _ _
11
13
  _ __ __| |__ __ _| |_
12
14
  | ' \/ _` / _/ _` | _|
13
15
  |_|_|_\__,_\__\__,_|\__|
14
- version (#{Mdcat::VERSION})
15
- }
16
+ )
16
17
 
17
18
  def help
18
19
  puts %(
19
20
  #{BANNER}
21
+ version (#{Mdcat::VERSION})
20
22
 
21
23
  USAGE
22
- mdcat <file>
24
+ mdcat <file>
23
25
 
24
26
  COMMANDS
25
27
  mdcat -h, help show this help message
@@ -32,18 +34,24 @@ end
32
34
 
33
35
  # commands
34
36
  if ARGV[0] == "-h" || ARGV[0] == "help"
35
- help and exit(0)
37
+ help
38
+ exit(0)
36
39
  end
37
40
 
38
41
  # validations
39
- file_path = ARGV[0]
40
- help and exit(1) if file_path.nil?
42
+ file_path =
43
+ ARGV[0] || DEFAULT_FILES.find { |file| File.exist?(file) }
44
+
45
+ if file_path.nil?
46
+ help
47
+ exit(1)
48
+ end
41
49
 
42
50
  file = File.expand_path(file_path)
43
51
  unless File.exist?(file)
44
52
  help
45
53
  puts "File not found: #{file}"
46
- exit 1
54
+ exit(1)
47
55
  end
48
56
 
49
57
  # proessing file and output
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.2.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Vinciguerra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-04 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-markdown
@@ -28,21 +28,19 @@ description: mdcat is a command line tool to cat markdown files with syntax high
28
28
  email:
29
29
  - daniel.vinciguerra@bivee.com.br
30
30
  executables:
31
- - console
32
31
  - mdcat
33
- - setup
34
32
  extensions: []
35
33
  extra_rdoc_files: []
36
34
  files:
37
35
  - ".rspec"
38
36
  - ".rubocop.yml"
37
+ - Changelog.md
39
38
  - Gemfile
39
+ - Gemfile.lock
40
40
  - LICENSE.txt
41
41
  - README.md
42
42
  - Rakefile
43
- - bin/console
44
43
  - bin/mdcat
45
- - bin/setup
46
44
  - lib/mdcat.rb
47
45
  - lib/mdcat/version.rb
48
46
  - mdcat.gemspec
data/bin/console DELETED
@@ -1,11 +0,0 @@
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/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