gfm 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +8 -8
  2. data/bin/gfm +3 -1
  3. data/lib/gfm.rb +1 -1
  4. data/lib/gfm/converter.rb +7 -3
  5. metadata +16 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTE3NDBjOGQyYTU0MWE3NjI1YTdmMTA4MWYzZjQ5YmY3YTJlMTUyNg==
4
+ NjZmZGNkYjM1OWIzNWUzOWQ4MjkzZTg4Nzk5NDczZWE2OGY5YTE4YQ==
5
5
  data.tar.gz: !binary |-
6
- ZTJkMzBmMTRlZmVlMWIyNjBkNzcyMGIxMTNlYjExMDA2NWUwNTQyYQ==
6
+ ZDM2MTU3MTk4NzE4ZDY2M2EzOTUzMWM5ZGE3OTNjOTZjZDQ0YzA0Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTNmNTY5OWNhMGUyZWQzOGFiZWI1ZGY5MGE3NWJmNzM2ZTE1OTc0ZTgxZGIx
10
- Yzk1ZjI3MjQ4NTk4NzQzY2ExYzFkNjE4OGNmNTIzMzVjMzhmZjc0MjRkOWYw
11
- ZGYzNWU1ZjBkODgzOTU0MGFkYzZkYjMzOTIzNTE5ZWUyMDc5ZGQ=
9
+ YWMxY2M2NTIzMWFmYjg2Y2U2ZTgwZTM0YjM1NDlkZjZmNjVmYWVkMzU2N2Jk
10
+ MzU1ZDUwM2FiNmZjZWZiNWQwNTYzMTRlMDc1ZTk0YjJjMjVlOWIxMGFmMTA4
11
+ MzVkNWYyMzcxZjIxN2M5ZWVhZjNiZDI4MDgzNjRkZjc3MjE0ZTc=
12
12
  data.tar.gz: !binary |-
13
- MTg3NDBkNjgyNTBjNmQ5MjAzNWYzMTE2ZDBlZjhhNTY0NzI3MzZjZDZhMzgx
14
- YTFiZGVjZWYyZTE3NWIwMGI3OGVlYWFiZGE0MzJiNDAyZjRlNjkzYTMzN2Yz
15
- ZDFjZjdjMjU1Yjc4ZTczZmNiNjg4NTU0NGQ2NzBlZTgwNzc5ODg=
13
+ YWNkOWUyMGU2MDUyY2YwNDdlZmNhMzAyYTMwMjFmZWEzZjEzOGMzMDM2ZjQ0
14
+ N2I3MWUxMWJjZmM1OGUwODI4MTJkMDhhYTQ1OGFmNGFlYTgzNGVkMzA1NDBj
15
+ OTg3YzMzNGU4MTRmM2Y1MTY2ZTAxNDgwYjAzM2YwNGVlNWRmNjQ=
data/bin/gfm CHANGED
@@ -8,7 +8,9 @@ input_file, output_file = ARGV
8
8
  if input_file.nil? || ARGV.include?('--help') || ARGV.include?('-h')
9
9
  puts GFM::HELP_TEXT
10
10
  elsif input_file.end_with?(".md") && File.exists?(input_file)
11
- GFM::Converter.new(input_file).write_output_file(output_file)
11
+ converter = GFM::Converter.new(input_file)
12
+ converter.write_output_file(output_file)
13
+ puts "Markdown from #{converter.input_file_name} written to #{converter.output_file_name}."
12
14
  else
13
15
  puts "Invalid markdown file #{input_file}"
14
16
  end
data/lib/gfm.rb CHANGED
@@ -29,7 +29,7 @@ HELP
29
29
 
30
30
  def self.stylesheet_tags
31
31
  HTTPClient.new.get("https://github.com").body.split("\n").select do |line|
32
- line=~/https:.*github.*\.css/
32
+ line =~ /https:.*github.*\.css/
33
33
  end.join
34
34
  end
35
35
  end
@@ -1,11 +1,15 @@
1
1
  module GFM
2
2
  class Converter
3
- def initialize(input_file_name)
4
- @input_file_name = input_file_name
3
+ attr_reader :input_file_name
4
+ attr_reader :output_file_name
5
+
6
+ def initialize(filename)
7
+ @input_file_name = filename
5
8
  end
6
9
 
7
10
  def write_output_file(filename = nil)
8
- File.open(sanitized_output_file_name(filename), 'w').write(html_content)
11
+ @output_file_name = sanitized_output_file_name(filename)
12
+ File.open(@output_file_name, 'w').write(html_content)
9
13
  end
10
14
 
11
15
  private
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.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Rose
@@ -38,7 +38,21 @@ dependencies:
38
38
  - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Generates an HTML file from a GitHub Flavored Markdown File. Useful for
41
+ - !ruby/object:Gem::Dependency
42
+ name: httpclient
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Generates an HTML file from a GitHub Flavored Markdown file. Useful for
42
56
  previewing README files.
43
57
  email: ekimsc1094@sympatico.ca
44
58
  executables: