gfm 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MjllOWYxNWIwNGQ1MDkxMzY1MWZlYWVhMTBiN2UzOGU4ZWNjNzRhZQ==
5
- data.tar.gz: !binary |-
6
- OTc3MDUxNmRjNGE3YmFjNWY5ZTFiNDNjYWE0ZTA1ZmNmZTlhYjhkNg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- YjM1NGUxNmM4M2JlOGY4MGE0NWNhMmJlZDc1OWZlYmI1NGFiYmRhYzlkZTM1
10
- YjA3NjRkMmYxOTNjOGI4ZDg5YWFhZmFlZWQ3ZDM3NmMzMjVmZjczODYwYTA4
11
- ZTVjMDc3ODRjMGY5ZWQzOWI4MzAxNzY3ZDhmZWNjMTA4NTdmZDI=
12
- data.tar.gz: !binary |-
13
- NmEwM2Y4ZDEyZjcyNDZjYzFiOTc0ZjI0YjQzNjY5NjBjMWY5YjY1Zjc0YTQz
14
- N2ZlMTU0YmJlMGUzMTlhYTk0ZjFmZjhiNjIyMzc2NDk4ZjQyNmI0YjA1ZjNi
15
- ZDMwNzMyZGUwNWRiYTkzNTQ3OGZlNmI4NTgxMjM2Y2ZmNGNhMGE=
2
+ SHA1:
3
+ metadata.gz: 88d4243f5cf4285c05445034180bf97c95c2ed60
4
+ data.tar.gz: 4efd2318044b624bf5538b98bd1220f262e651eb
5
+ SHA512:
6
+ metadata.gz: b4a3aff28acd8c6de5069028681831c2722d89c90d999e9d312e96a9396a17830413ab20ca858fbb33718bcf7d0dd1884a46bbf706e0f5d3c45c148dc03b1b6d
7
+ data.tar.gz: 032cd369c32d576c070f7517974af5605d038f113ce411ac952d822c350140da38cec248d1aadec9bfcb6634c9dcecb097cc27a304978c0e6fb927fdc3652826
data/bin/gfm CHANGED
@@ -2,11 +2,17 @@
2
2
 
3
3
  require 'gfm'
4
4
 
5
+ class Array
6
+ def has_switch?(long_form, short_form = long_form[1..2])
7
+ self.include?(long_form) || self.include?(short_form)
8
+ end
9
+ end
10
+
5
11
  input_file, output_file = ARGV
6
12
 
7
- if input_file.nil? || ARGV.include?('--help') || ARGV.include?('-h')
13
+ if input_file.nil? || ARGV.has_switch?('--help')
8
14
  puts GFM::HELP_TEXT
9
- elsif ARGV.include?('--version') || ARGV.include?('-v')
15
+ elsif ARGV.has_switch?('--version')
10
16
  puts "Version #{GFM::VERSION}"
11
17
  elsif input_file.end_with?(".md") && File.exists?(input_file)
12
18
  converter = GFM::Converter.new(input_file)
data/lib/gfm.rb CHANGED
@@ -1,7 +1,8 @@
1
+ require 'html/pipeline'
2
+ require 'httpclient'
3
+ require 'linguist'
4
+
1
5
  module GFM
2
- require 'html/pipeline'
3
- require 'httpclient'
4
- require 'linguist'
5
6
  require 'gfm/converter'
6
7
  require 'gfm/version'
7
8
 
@@ -26,8 +27,12 @@ HELP
26
27
  HTML::Pipeline::ImageMaxWidthFilter,
27
28
  HTML::Pipeline::HttpsFilter,
28
29
  HTML::Pipeline::MentionFilter,
29
- HTML::Pipeline::SyntaxHighlightFilter
30
- ]
30
+ HTML::Pipeline::SyntaxHighlightFilter,
31
+ HTML::Pipeline::EmojiFilter
32
+ ],
33
+ http_url: 'http://github.com',
34
+ asset_root: 'https://assets-cdn.github.com/images/icons'
35
+
31
36
  end
32
37
 
33
38
  def self.stylesheet_tags
@@ -4,6 +4,8 @@ module GFM
4
4
  attr_reader :output_file_name
5
5
 
6
6
  def initialize(filename)
7
+ raise "invalid markdown file #{filename}" unless filename.end_with?('.md')
8
+ raise "no such file #{filename}" unless File.exist?(filename)
7
9
  @input_file_name = filename
8
10
  end
9
11
 
@@ -1,3 +1,3 @@
1
1
  module GFM
2
- VERSION = '0.1.5'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gfm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Rose
@@ -14,58 +14,100 @@ dependencies:
14
14
  name: html-pipeline
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: github-linguist
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 4.5.15
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 4.5.15
41
+ - !ruby/object:Gem::Dependency
42
+ name: github-markdown
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.6.9
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.6.9
55
+ - !ruby/object:Gem::Dependency
56
+ name: sanitize
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 4.0.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 4.0.0
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: httpclient
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
- - - ! '>='
73
+ - - "~>"
46
74
  - !ruby/object:Gem::Version
47
- version: '0'
75
+ version: 2.6.0
48
76
  type: :runtime
49
77
  prerelease: false
50
78
  version_requirements: !ruby/object:Gem::Requirement
51
79
  requirements:
52
- - - ! '>='
80
+ - - "~>"
53
81
  - !ruby/object:Gem::Version
54
- version: '0'
82
+ version: 2.6.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: gemoji
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.1.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.1.0
55
97
  - !ruby/object:Gem::Dependency
56
98
  name: rspec
57
99
  requirement: !ruby/object:Gem::Requirement
58
100
  requirements:
59
- - - ! '>='
101
+ - - "~>"
60
102
  - !ruby/object:Gem::Version
61
- version: '0'
103
+ version: 3.3.0
62
104
  type: :development
63
105
  prerelease: false
64
106
  version_requirements: !ruby/object:Gem::Requirement
65
107
  requirements:
66
- - - ! '>='
108
+ - - "~>"
67
109
  - !ruby/object:Gem::Version
68
- version: '0'
110
+ version: 3.3.0
69
111
  description: Generates an HTML file from a GitHub Flavored Markdown file. Useful for
70
112
  previewing README files.
71
113
  email: ekimsc1094@sympatico.ca
@@ -74,10 +116,10 @@ executables:
74
116
  extensions: []
75
117
  extra_rdoc_files: []
76
118
  files:
119
+ - bin/gfm
77
120
  - lib/gfm.rb
78
- - lib/gfm/version.rb
79
121
  - lib/gfm/converter.rb
80
- - bin/gfm
122
+ - lib/gfm/version.rb
81
123
  homepage: https://github.com/msrose/gfm
82
124
  licenses:
83
125
  - MIT
@@ -88,17 +130,17 @@ require_paths:
88
130
  - lib
89
131
  required_ruby_version: !ruby/object:Gem::Requirement
90
132
  requirements:
91
- - - ! '>='
133
+ - - ">="
92
134
  - !ruby/object:Gem::Version
93
135
  version: '0'
94
136
  required_rubygems_version: !ruby/object:Gem::Requirement
95
137
  requirements:
96
- - - ! '>='
138
+ - - ">="
97
139
  - !ruby/object:Gem::Version
98
140
  version: '0'
99
141
  requirements: []
100
142
  rubyforge_project:
101
- rubygems_version: 2.0.7
143
+ rubygems_version: 2.4.8
102
144
  signing_key:
103
145
  specification_version: 4
104
146
  summary: GitHub Flavoured Markdown Previewer