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.
- checksums.yaml +4 -4
- data/README.md +10 -14
- data/bin/mdopen +5 -3
- data/lib/mdopen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe31f6538f5062454273616edebfca14329c198f
|
4
|
+
data.tar.gz: 5a33622275559fb7f1d6a8515d86606c46df541b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f12de3ffefc3cb0b411e60befd543a38b04b7a1aa4feb2fdd2a586d7ed42ef1a8cf5f390fac7e5cf3144f1949e835677bfecbbc2ba25db30771410db7451e29
|
7
|
+
data.tar.gz: a273ea8d31884d91017fb29a1a332b3c7ed181ee1b4ffb08d986647512c123329ae2c4c6dd1526e92057941803fa006cf96f1f40a3842be5bd42f655c54a5362
|
data/README.md
CHANGED
@@ -1,28 +1,24 @@
|
|
1
1
|
# Mdopen
|
2
2
|
|
3
|
-
|
3
|
+
`mdopen` is a command tool to preview your Markdown file.
|
4
4
|
|
5
|
-
|
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
|
-
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'mdopen'
|
13
|
-
```
|
7
|
+
Hope it helpful~
|
14
8
|
|
15
|
-
|
16
|
-
|
17
|
-
$ bundle
|
9
|
+
## Installation
|
18
10
|
|
19
|
-
|
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
|
-
|
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 <
|
8
|
+
Usage: mdopen <markdown_file>
|
9
9
|
|
10
|
-
"README" or "README.md" will be used as input filename if the <
|
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
|
|
data/lib/mdopen/version.rb
CHANGED