mdopen 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -14
  3. data/bin/mdopen +5 -3
  4. data/lib/mdopen/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b95a6428eeb74c1e8a403a26dec356d4a4e58be
4
- data.tar.gz: ac20c8c579f7c5b1a99baaad5996fadd1115f26d
3
+ metadata.gz: fe31f6538f5062454273616edebfca14329c198f
4
+ data.tar.gz: 5a33622275559fb7f1d6a8515d86606c46df541b
5
5
  SHA512:
6
- metadata.gz: '074088d5c841838628ab6234f587fa0823b922c14bc3fb66266fbeb8d3a882ed2cdfef24ac54498cd991aa75a48f09ac4f96a00a0df5151f280301fa6e88ece2'
7
- data.tar.gz: 276690d0a559df4658dca7f9440058cc1c8c11009049d9e0c564b816051d1f9cf79f6256b9582273fd8743d9244e03ad72a12f336e46576196cc9fe549619370
6
+ metadata.gz: 4f12de3ffefc3cb0b411e60befd543a38b04b7a1aa4feb2fdd2a586d7ed42ef1a8cf5f390fac7e5cf3144f1949e835677bfecbbc2ba25db30771410db7451e29
7
+ data.tar.gz: a273ea8d31884d91017fb29a1a332b3c7ed181ee1b4ffb08d986647512c123329ae2c4c6dd1526e92057941803fa006cf96f1f40a3842be5bd42f655c54a5362
data/README.md CHANGED
@@ -1,28 +1,24 @@
1
1
  # Mdopen
2
2
 
3
- 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/mdopen`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ `mdopen` is a command tool to preview your Markdown file.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ I ever want to write such a tool to preview `README` file in some git repository in terminal. And then I find [mdopen](https://github.com/romanyx/mdopen) witten in Golang before I start. Then I migrate it to Ruby.
6
6
 
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'mdopen'
13
- ```
7
+ Hope it helpful~
14
8
 
15
- And then execute:
16
-
17
- $ bundle
9
+ ## Installation
18
10
 
19
- Or install it yourself as:
11
+ `mdopen` is a command tool, so you'd better install it as:
20
12
 
21
13
  $ gem install mdopen
22
14
 
23
15
  ## Usage
24
16
 
25
- TODO: Write usage instructions here
17
+ ```bash
18
+ mdopen <markdown_file>
19
+ ```
20
+
21
+ "README" or "README.md" will be used as input filename if the <markdown_file> is omitted or not exists.
26
22
 
27
23
  ## Development
28
24
 
data/bin/mdopen CHANGED
@@ -5,9 +5,9 @@ def help
5
5
  puts <<USAGE
6
6
  mdopen is a command tool to preview your Markdown file.
7
7
 
8
- Usage: mdopen <markdown_file_path>
8
+ Usage: mdopen <markdown_file>
9
9
 
10
- "README" or "README.md" will be used as input filename if the <markdown_file_path> is omitted.
10
+ "README" or "README.md" will be used as input filename if the <markdown_file> is omitted or not exists.
11
11
 
12
12
  USAGE
13
13
  end
@@ -17,11 +17,13 @@ if !ARGV[0].nil? && ARGV[0] =~ /^-{,2}help$/
17
17
  exit(1)
18
18
  end
19
19
 
20
- md_file = if File.exist?(ARGV[0] || "")
20
+ md_file = if !ARGV[0].nil? && File.exist?(ARGV[0])
21
21
  ARGV[0]
22
22
  elsif File.exist?("./README")
23
+ puts "file #{ARGV[0]} not exists, open README instead." unless ARGV[0].nil?
23
24
  "./README"
24
25
  elsif File.exist?("./README.md")
26
+ puts "file #{ARGV[0]} not exists, open README.md instead." unless ARGV[0].nil?
25
27
  "./README.md"
26
28
  end
27
29
 
@@ -1,3 +1,3 @@
1
1
  module Mdopen
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdopen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - B1nj0y