notorious 0.1.0 → 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.
@@ -27,6 +27,11 @@ def parse
27
27
  options[:stylesheet] = s
28
28
  end
29
29
 
30
+ opts.on("-t", "--title [name]", String,
31
+ "Specify a title") do |t|
32
+ options[:title] = t
33
+ end
34
+
30
35
  opts.on("-v", "--verbose", "Run verbosely") do |v|
31
36
  options[:verbose] = v
32
37
  end
@@ -1,5 +1,4 @@
1
1
  require "notorious/version"
2
- require "optparse"
3
2
  require "redcarpet"
4
3
 
5
4
 
@@ -9,6 +8,7 @@ module Notorious
9
8
  def self.build(opts)
10
9
  file_name = opts[:file_name]
11
10
  stylesheet = opts[:stylesheet]
11
+ title = opts[:title]
12
12
  output = opts[:output]
13
13
  verbose = opts[:verbose]
14
14
 
@@ -53,10 +53,10 @@ module Notorious
53
53
  body = md.render(md_contents)
54
54
  md_file.close
55
55
 
56
- self.html(styles, body)
56
+ self.html(styles, title, body)
57
57
  end
58
58
 
59
- def self.html(styles, body)
59
+ def self.html(styles, title, body)
60
60
 
61
61
  <<HEREDOC
62
62
  <!DOCTYPE html>
@@ -65,7 +65,7 @@ module Notorious
65
65
  <style type='text/css'>
66
66
  #{styles}
67
67
  </style>
68
- <title>Tech Notes</title>
68
+ <title>#{title}</title>
69
69
  </head>
70
70
  <body>
71
71
  #{body}
@@ -75,37 +75,6 @@ HEREDOC
75
75
 
76
76
  end
77
77
 
78
- def self.parse
79
-
80
- options = {}
81
-
82
- opts = OptionParser.new do |opts|
83
- opts.banner = "Usage: notorious command file [options]"
84
- opts.separator ""
85
- opts.separator "Specific options:"
86
-
87
- opts.on("-o", "--output [file_name]", String,
88
- "Specify output file name (defaults to input_file_name.html") do |o|
89
- o = self.ensure_extension(o, "html")
90
- options[:output] = o
91
- end
92
-
93
- opts.on("-s", "--stylesheet [file_name]", String,
94
- "Specify a custom stylesheet") do |s|
95
- s = self.ensure_extension(s, "css")
96
- options[:stylesheet] = s
97
- end
98
-
99
- opts.on("-v", "--verbose", "Run verbosely") do |v|
100
- options[:verbose] = v
101
- end
102
-
103
- end
104
- opts.parse!
105
-
106
- options
107
- end
108
-
109
78
  def self.ensure_extension(file, ext)
110
79
  split = file.split('.')
111
80
  unless split.length > 1 && split[-1] == ext
@@ -1,3 +1,3 @@
1
1
  module Notorious
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ["z.reneau.wedeen@gmail.com"]
7
7
  gem.description = %q{Notorious allows you to take notes in pure Markdown and review them in your browser.}
8
8
  gem.summary = %q{Notorious, the Markdown note taker}
9
- gem.homepage = ""
9
+ gem.homepage = "http://github.com/zackrw/notorious"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = ["notorious"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notorious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 Z
12
+ date: 2012-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redcarpet
@@ -67,7 +67,7 @@ files:
67
67
  - spec/examples/notorious_spec.rb
68
68
  - spec/examples/spec_helper.rb
69
69
  - stylesheets/default.css
70
- homepage: ''
70
+ homepage: http://github.com/zackrw/notorious
71
71
  licenses: []
72
72
  post_install_message:
73
73
  rdoc_options: []