hubdown 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/hubdown ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+ require 'github/markdown'
3
+
4
+ file_name = ARGV[0]
5
+ #output_file_name = ARGV[1] ||"#{file_name.split('.')[0]}.html"
6
+ output_file_name = ARGV[1]
7
+
8
+ css_links = [];
9
+ css_links << "https://a248.e.akamai.net/assets.github.com/assets/github-8dd5c1a834790ecb6b900ff7b2d9a1377fd5aef1.css"
10
+ css_links << "https://a248.e.akamai.net/assets.github.com/assets/github2-4591451faf42b997173d752065f048736e6f9872.css"
11
+
12
+ opening = <<EOF
13
+ <!DOCTYPE html>
14
+ <html>
15
+ <head>
16
+ <title>#{output_file_name}</title>
17
+ <link href="https://a248.e.akamai.net/assets.github.com/assets/github-8dd5c1a834790ecb6b900ff7b2d9a1377fd5aef1.css" media="screen" rel="stylesheet" type="text/css" />
18
+ <link href="https://a248.e.akamai.net/assets.github.com/assets/github2-4591451faf42b997173d752065f048736e6f9872.css" media="screen" rel="stylesheet" type="text/css" />
19
+ <style>
20
+ #wrapper {
21
+ width: 920px;
22
+ margin: 20px auto;
23
+ }
24
+ </style>
25
+ </head>
26
+
27
+ <body>
28
+ <div id="wrapper">
29
+ <div id="slider">
30
+ <div class="frames">
31
+ <div class="frame">
32
+ <div id="readme" class="clearfix announce instapaper_body md">
33
+ <span class="name">#{file_name}</span>
34
+ <article class="markdown-body entry-content">
35
+ EOF
36
+
37
+ closing = <<EOF
38
+ </article>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </body>
45
+ </html>
46
+ EOF
47
+
48
+ readme = GitHub::Markdown.render_gfm File.read(file_name)
49
+ file_contents = "#{opening}#{readme}#{closing}"
50
+
51
+ if (output_file_name)
52
+ File.open( output_file_name, "w") { |f| f.write file_contents }
53
+ puts "... created: #{output_file_name}"
54
+ else
55
+ puts file_contents
56
+ end
@@ -1,3 +1,3 @@
1
1
  module Hubdown
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/hubdown.rb CHANGED
@@ -1,60 +1,6 @@
1
1
  require 'hubdown/version'
2
- require 'github/markdown'
3
2
 
4
3
  module Hubdown
5
4
  # Your code goes here...
6
5
  end
7
6
 
8
- file_name = ARGV[0]
9
- #output_file_name = ARGV[1] ||"#{file_name.split('.')[0]}.html"
10
- output_file_name = ARGV[1]
11
-
12
- css_links = [];
13
- css_links << "https://a248.e.akamai.net/assets.github.com/assets/github-8dd5c1a834790ecb6b900ff7b2d9a1377fd5aef1.css"
14
- css_links << "https://a248.e.akamai.net/assets.github.com/assets/github2-4591451faf42b997173d752065f048736e6f9872.css"
15
-
16
- opening = <<EOF
17
- <!DOCTYPE html>
18
- <html>
19
- <head>
20
- <title>#{output_file_name}</title>
21
- <link href="https://a248.e.akamai.net/assets.github.com/assets/github-8dd5c1a834790ecb6b900ff7b2d9a1377fd5aef1.css" media="screen" rel="stylesheet" type="text/css" />
22
- <link href="https://a248.e.akamai.net/assets.github.com/assets/github2-4591451faf42b997173d752065f048736e6f9872.css" media="screen" rel="stylesheet" type="text/css" />
23
- <style>
24
- #wrapper {
25
- width: 920px;
26
- margin: 20px auto;
27
- }
28
- </style>
29
- </head>
30
-
31
- <body>
32
- <div id="wrapper">
33
- <div id="slider">
34
- <div class="frames">
35
- <div class="frame">
36
- <div id="readme" class="clearfix announce instapaper_body md">
37
- <span class="name">#{file_name}</span>
38
- <article class="markdown-body entry-content">
39
- EOF
40
-
41
- closing = <<EOF
42
- </article>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
47
- </div>
48
- </body>
49
- </html>
50
- EOF
51
-
52
- readme = GitHub::Markdown.render_gfm File.read(file_name)
53
- file_contents = "#{opening}#{readme}#{closing}"
54
-
55
- if (output_file_name)
56
- File.open( output_file_name, "w") { |f| f.write file_contents }
57
- puts "... created: #{output_file_name}"
58
- else
59
- puts file_contents
60
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -62,7 +62,8 @@ dependencies:
62
62
  description: CLI for GitHub Flavored markdown to html convervsion
63
63
  email:
64
64
  - knomedia@gmail.com
65
- executables: []
65
+ executables:
66
+ - hubdown
66
67
  extensions: []
67
68
  extra_rdoc_files: []
68
69
  files:
@@ -71,6 +72,7 @@ files:
71
72
  - LICENSE.txt
72
73
  - README.md
73
74
  - Rakefile
75
+ - bin/hubdown
74
76
  - hubdown.gemspec
75
77
  - lib/hubdown.rb
76
78
  - lib/hubdown/version.rb