markview 0.2.4 → 0.3.0
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.
- data/README.md +30 -10
- data/bin/markview +1 -1
- data/lib/markview.rb +40 -22
- data/lib/markview/public/app.js +47 -0
- data/lib/markview/public/jquery.notifyBar.css +37 -0
- data/lib/markview/public/jquery.notifyBar.js +109 -0
- data/lib/markview/public/style.css +25 -6
- data/lib/markview/views/base.erb +3 -16
- data/lib/markview/views/layout.erb +29 -0
- data/test/render_test.rb +9 -9
- data/test/test_helper.rb +7 -7
- metadata +39 -16
data/README.md
CHANGED
@@ -1,25 +1,45 @@
|
|
1
1
|
# Markview
|
2
2
|
|
3
|
-
Markview allows you to view nearly any and all markup formatted files in a slick way. Markview is inspired by the python library [restview](http://mg.pov.lt/restview/).
|
3
|
+
Markview allows you to view nearly any and all markup formatted files in a slick way. Markview is inspired by the python library [restview](http://mg.pov.lt/restview/). Markview has the ability to render virtually any and all markup formatted files using the [github-markup](http://www.github.com/defunkt/github-markup) library.
|
4
4
|
|
5
5
|
## Install
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
$ [sudo] gem install markview
|
7
|
+
$ sudo gem install markview
|
10
8
|
|
11
9
|
## Usage
|
12
10
|
|
13
11
|
Markview is very simple to use. Run the gem from the command line and specify
|
14
|
-
a README or other markdown file. Markview defaults to finding a README if you choose not to
|
12
|
+
a README or other markdown file. Markview defaults to finding a file with the base name README if you choose not to
|
15
13
|
specify the file.
|
16
14
|
|
17
|
-
|
18
|
-
|
15
|
+
$ markview README.md
|
16
|
+
|
19
17
|
## Preview
|
20
18
|
|
21
|
-

|
20
|
+
|
23
21
|
## Author
|
24
22
|
|
25
|
-
[Mark Sands](http://github.com/marksands) :: marksands07@gmail.com
|
23
|
+
[Mark Sands](http://github.com/marksands) :: marksands07@gmail.com
|
24
|
+
|
25
|
+
## License
|
26
|
+
|
27
|
+
Copyright (c) 2010, 2011 Mark Sands
|
28
|
+
|
29
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
30
|
+
of this software and associated documentation files (the "Software"), to deal
|
31
|
+
in the Software without restriction, including without limitation the rights
|
32
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
33
|
+
copies of the Software, and to permit persons to whom the Software is
|
34
|
+
furnished to do so, subject to the following conditions:
|
35
|
+
|
36
|
+
The above copyright notice and this permission notice shall be included in
|
37
|
+
all copies or substantial portions of the Software.
|
38
|
+
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
40
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
41
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
42
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
43
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
44
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
45
|
+
THE SOFTWARE.
|
data/bin/markview
CHANGED
data/lib/markview.rb
CHANGED
@@ -1,29 +1,47 @@
|
|
1
1
|
$:.unshift File.expand_path(File.dirname(__FILE__) + '/lib')
|
2
2
|
require 'sinatra'
|
3
|
+
require 'json'
|
3
4
|
require 'github/markup'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
set :static, true
|
12
|
-
|
13
|
-
# Renders the html using GitHub::Markup
|
14
|
-
def self.markview_me
|
15
|
-
ARGV[0] ||= Dir.glob("README*")[0]
|
16
|
-
begin
|
17
|
-
GitHub::Markup.render(ARGV[0], File.read(ARGV[0]))
|
18
|
-
rescue Errno::ENOENT
|
19
|
-
raise LoadError, "Failed to open document. Please specify a file."; exit
|
20
|
-
end
|
21
|
-
end
|
6
|
+
class Markview < Sinatra::Base
|
7
|
+
dir = File.dirname(File.expand_path(__FILE__))
|
8
|
+
|
9
|
+
set :views, "#{dir}/markview/views"
|
10
|
+
set :public, "#{dir}/markview/public"
|
11
|
+
set :static, true
|
22
12
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
13
|
+
configure do
|
14
|
+
@@markup = ARGV[0] ||= Dir.glob("README*")[0]
|
15
|
+
unless File.file?(@@markup)
|
16
|
+
raise LoadError, "Failed to open document. Please specify a file."; exit!
|
27
17
|
end
|
28
|
-
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# Renders the html using GitHub::Markup
|
21
|
+
def self.render
|
22
|
+
GitHub::Markup.render(@@markup, File.read(@@markup))
|
23
|
+
end
|
24
|
+
|
25
|
+
get '/' do
|
26
|
+
@markdown = Markview.render
|
27
|
+
@title = File.basename(@@markup)
|
28
|
+
erb :base
|
29
|
+
end
|
30
|
+
|
31
|
+
get '/preview' do
|
32
|
+
@markdown = Markview.render
|
33
|
+
({:error => false, :data => @markdown}).to_json
|
34
|
+
end
|
35
|
+
|
36
|
+
get '/edit' do
|
37
|
+
@markdown = File.read(@@markup)
|
38
|
+
({:error => false, :data => "<textarea id='editbox'>#{@markdown}</textarea>"}).to_json
|
39
|
+
end
|
40
|
+
|
41
|
+
post '/save' do
|
42
|
+
return ({:error => true, :message => "Failed to save file!"}).to_json unless request['markup']
|
43
|
+
File.open(@@markup, 'w') { |f| f.write(request['markup']) }
|
44
|
+
({:error => false, :message => "File succesfully saved!"}).to_json
|
45
|
+
end
|
46
|
+
|
29
47
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
|
3
|
+
$('.last').hide();
|
4
|
+
|
5
|
+
$('#save').click(function(e){
|
6
|
+
e.preventDefault();
|
7
|
+
$.post("/save", { markup: $('#editbox').val() }, function(response) {
|
8
|
+
if ( response.error == true ) {
|
9
|
+
$(function () {
|
10
|
+
$.notifyBar({
|
11
|
+
cls: 'error',
|
12
|
+
html: response.message,
|
13
|
+
delay: 2000,
|
14
|
+
animationSpeed: "normal"
|
15
|
+
});
|
16
|
+
});
|
17
|
+
}
|
18
|
+
else {
|
19
|
+
$(function () {
|
20
|
+
$.notifyBar({
|
21
|
+
cls: 'success',
|
22
|
+
html: response.message,
|
23
|
+
delay: 2000,
|
24
|
+
animationSpeed: "normal"
|
25
|
+
});
|
26
|
+
});
|
27
|
+
}
|
28
|
+
}, 'json');
|
29
|
+
});
|
30
|
+
|
31
|
+
$('#edit').click(function(e){
|
32
|
+
e.preventDefault();
|
33
|
+
$.get('/edit', function(response) {
|
34
|
+
$('#markview-output').html(response.data);
|
35
|
+
$('.last').show();
|
36
|
+
}, 'json');
|
37
|
+
});
|
38
|
+
|
39
|
+
$('#preview').click(function(e){
|
40
|
+
e.preventDefault();
|
41
|
+
$.get('/preview', function(response) {
|
42
|
+
$('#markview-output').html(response.data);
|
43
|
+
$('.last').hide();
|
44
|
+
}, 'json');
|
45
|
+
});
|
46
|
+
|
47
|
+
});
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/*
|
2
|
+
* Notify Bar - jQuery plugin
|
3
|
+
*
|
4
|
+
* Copyright (c) 2009-2010 Dmitri Smirnov
|
5
|
+
*
|
6
|
+
* Licensed under the MIT license:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
*
|
9
|
+
* Version: 1.2
|
10
|
+
*
|
11
|
+
* Project home:
|
12
|
+
* http://www.dmitri.me/blog/notify-bar
|
13
|
+
*/
|
14
|
+
|
15
|
+
.jquery-notify-bar {
|
16
|
+
width:100%;
|
17
|
+
position:fixed;
|
18
|
+
top:0;
|
19
|
+
left:0;
|
20
|
+
z-index:32768;
|
21
|
+
background-color:#efefef;
|
22
|
+
font-size:18px;
|
23
|
+
color:#000;
|
24
|
+
text-align:center;
|
25
|
+
font-family: Arial, Verdana, sans-serif;
|
26
|
+
padding:20px 0px;
|
27
|
+
border-bottom:1px solid #bbb;
|
28
|
+
cursor: pointer;
|
29
|
+
}
|
30
|
+
.jquery-notify-bar.error {
|
31
|
+
color:#f00;
|
32
|
+
background-color:#fdd;
|
33
|
+
}
|
34
|
+
.jquery-notify-bar.success {
|
35
|
+
color:#060;
|
36
|
+
background-color:#BBFFB6;
|
37
|
+
}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
/*
|
2
|
+
* Notify Bar - jQuery plugin
|
3
|
+
*
|
4
|
+
* Copyright (c) 2009-2010 Dmitri Smirnov
|
5
|
+
*
|
6
|
+
* Licensed under the MIT license:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
*
|
9
|
+
* Version: 1.2.2
|
10
|
+
*
|
11
|
+
* Project home:
|
12
|
+
* http://www.dmitri.me/blog/notify-bar
|
13
|
+
*/
|
14
|
+
|
15
|
+
/**
|
16
|
+
* param Object
|
17
|
+
*/
|
18
|
+
jQuery.notifyBar = function(settings) {
|
19
|
+
|
20
|
+
(function($) {
|
21
|
+
|
22
|
+
var bar = notifyBarNS = {};
|
23
|
+
notifyBarNS.shown = false;
|
24
|
+
|
25
|
+
if( !settings) {
|
26
|
+
settings = {};
|
27
|
+
}
|
28
|
+
// HTML inside bar
|
29
|
+
notifyBarNS.html = settings.html || "Your message here";
|
30
|
+
|
31
|
+
//How long bar will be delayed, doesn't count animation time.
|
32
|
+
notifyBarNS.delay = settings.delay || 2000;
|
33
|
+
|
34
|
+
//How long notifyBarNS bar will be slided up and down
|
35
|
+
notifyBarNS.animationSpeed = settings.animationSpeed || 200;
|
36
|
+
|
37
|
+
//Use own jquery object usually DIV, or use default
|
38
|
+
notifyBarNS.jqObject = settings.jqObject;
|
39
|
+
|
40
|
+
//Set up own class
|
41
|
+
notifyBarNS.cls = settings.cls || "";
|
42
|
+
|
43
|
+
//close button
|
44
|
+
notifyBarNS.close = settings.close || false;
|
45
|
+
|
46
|
+
if( notifyBarNS.jqObject) {
|
47
|
+
bar = notifyBarNS.jqObject;
|
48
|
+
notifyBarNS.html = bar.html();
|
49
|
+
} else {
|
50
|
+
bar = jQuery("<div></div>")
|
51
|
+
.addClass("jquery-notify-bar")
|
52
|
+
.addClass(notifyBarNS.cls)
|
53
|
+
.attr("id", "__notifyBar");
|
54
|
+
}
|
55
|
+
|
56
|
+
bar.html(notifyBarNS.html).hide();
|
57
|
+
var id = bar.attr("id");
|
58
|
+
switch (notifyBarNS.animationSpeed) {
|
59
|
+
case "slow":
|
60
|
+
asTime = 600;
|
61
|
+
break;
|
62
|
+
case "normal":
|
63
|
+
asTime = 400;
|
64
|
+
break;
|
65
|
+
case "fast":
|
66
|
+
asTime = 200;
|
67
|
+
break;
|
68
|
+
default:
|
69
|
+
asTime = notifyBarNS.animationSpeed;
|
70
|
+
}
|
71
|
+
if( bar != 'object'); {
|
72
|
+
jQuery("body").prepend(bar);
|
73
|
+
}
|
74
|
+
|
75
|
+
// Style close button in CSS file
|
76
|
+
if( notifyBarNS.close) {
|
77
|
+
bar.append(jQuery("<a href='#' class='notify-bar-close'>Close [X]</a>"));
|
78
|
+
jQuery(".notify-bar-close").click(function() {
|
79
|
+
if( bar.attr("id") == "__notifyBar") {
|
80
|
+
jQuery("#" + id).slideUp(asTime, function() { jQuery("#" + id).remove() });
|
81
|
+
} else {
|
82
|
+
jQuery("#" + id).slideUp(asTime);
|
83
|
+
}
|
84
|
+
return false;
|
85
|
+
});
|
86
|
+
}
|
87
|
+
|
88
|
+
// Check if we've got any visible bars and if we have, slide them up before showing the new one
|
89
|
+
if($('.jquery-notify-bar:visible').length > 0) {
|
90
|
+
$('.jquery-notify-bar:visible').stop().slideUp(asTime, function() {
|
91
|
+
bar.stop().slideDown(asTime);
|
92
|
+
});
|
93
|
+
} else {
|
94
|
+
bar.slideDown(asTime);
|
95
|
+
}
|
96
|
+
|
97
|
+
// Allow the user to click on the bar to close it
|
98
|
+
bar.click(function() {
|
99
|
+
$(this).slideUp(asTime);
|
100
|
+
})
|
101
|
+
|
102
|
+
// If taken from DOM dot not remove just hide
|
103
|
+
if( bar.attr("id") == "__notifyBar") {
|
104
|
+
setTimeout("jQuery('#" + id + "').stop().slideUp(" + asTime +", function() {jQuery('#" + id + "').remove()});", notifyBarNS.delay + asTime);
|
105
|
+
} else {
|
106
|
+
setTimeout("jQuery('#" + id + "').stop().slideUp(" + asTime +", function() {jQuery('#" + id + "')});", notifyBarNS.delay + asTime);
|
107
|
+
}
|
108
|
+
|
109
|
+
})(jQuery) };
|
@@ -9,7 +9,7 @@ body { line-height:1; color:black; background: white; }
|
|
9
9
|
ol,ul { list-style:none; }
|
10
10
|
table { border-collapse:separate; border-spacing:0; }
|
11
11
|
caption,th,td { text-align:left; font-weight:normal; }
|
12
|
-
blockquote:before,blockquote:after,q:before,q:after {
|
12
|
+
blockquote:before,blockquote:after,q:before,q:after { content:""; }
|
13
13
|
blockquote,q { quotes:"" ""; }
|
14
14
|
|
15
15
|
.clear:after { clear:both; content:""; display:block; height:0; zoom:1; }
|
@@ -24,6 +24,25 @@ div#content {margin:2% auto; position:relative; width:920px; }
|
|
24
24
|
div#content > div { float:left; }
|
25
25
|
div#content div#markview-output { border: 1px solid #E9E9E9; background:#F8F8F8; padding:10px; overflow-y:auto; min-width:900px;}
|
26
26
|
|
27
|
+
.meta { min-width:910px;}
|
28
|
+
.meta { background: #eee url(http://assets1.github.com/images/modules/commit/file_head.gif) repeat-x 0px 0px;
|
29
|
+
border:1px solid #e9e9e9;border-bottom:1px solid #ccc;color:#333;height:33px;line-height:33px;font-size:12px;padding:0px 5px; }
|
30
|
+
.meta ul { float:right;height:33px;line-height:33px;padding:0;margin:0; }
|
31
|
+
.meta ul li { float:left; list-style-type:none; margin: 8px 0 0 10px; }
|
32
|
+
.meta ul li.last { background: url(http://assets1.github.com/images/modules/commit/action_separator.png) no-repeat 0px 50%; margin: 8px 4px 0 10px; }
|
33
|
+
.meta ul li a { color:#4183C4;font-weight:bold; text-decoration:none;outline:none;line-height:1.4em;margin:0 0 0 10px;}
|
34
|
+
|
35
|
+
textarea {
|
36
|
+
width: 99%;
|
37
|
+
height: 600px!important;
|
38
|
+
padding:0!important;
|
39
|
+
margin:0!important;
|
40
|
+
resize: none;
|
41
|
+
font-size: 1.1em;
|
42
|
+
background-color: rgb(253, 253, 253);
|
43
|
+
border: 2px solid rgb(215, 214, 213);
|
44
|
+
}
|
45
|
+
|
27
46
|
.markview * {line-height:1.4em;}
|
28
47
|
.markview a {color:#2e80d3; text-decoration:none;}
|
29
48
|
.markview a:hover { text-decoration:underline;}
|
@@ -35,7 +54,7 @@ div#content div#markview-output { border: 1px solid #E9E9E9; background:#F8F8F8;
|
|
35
54
|
|
36
55
|
.markview h1,.markview h2,.markview h3,.markview h4,.markview h5,.markview h6{margin-bottom:0.5em; color:black;}
|
37
56
|
.markview h1{font-size:170% !important; padding-top:0.5em!important;margin-top:1.5em!important;
|
38
|
-
|
57
|
+
line-height:1.4em; font-weight:bold; border-top: 4px solid #AAA !important; }
|
39
58
|
.markview h1:first-child { margin-top:0!important;padding-top:0.25em!important;border-top:none!important;}
|
40
59
|
.markview h2{ border-top: 4px solid #ddd; padding-top: 12px; margin-top:30px; margin-bottom:0.75em;}
|
41
60
|
.markview h2{font-size:150% !important; font-weight:bold}
|
@@ -61,12 +80,12 @@ div#content div#markview-output { border: 1px solid #E9E9E9; background:#F8F8F8;
|
|
61
80
|
.markview table td{border-bottom:1px solid #ddd;padding:0.2em 1em}
|
62
81
|
|
63
82
|
.markview pre{font-family: Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
64
|
-
|
65
|
-
|
83
|
+
background-color:#f8f8ff !important;border:1px solid #dedede !important;color:#444 !important; font-size:90% !important;
|
84
|
+
line-height:1.5em !important; padding: 0.5em !important; margin:1em 0 !important; overflow:auto !important;}
|
66
85
|
.markview pre code{background-color:#f8f8ff !important;border:none !important;font-size:100% !important;padding:0 !important}
|
67
86
|
.markview code{font-family: Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
68
|
-
|
69
|
-
|
87
|
+
background-color:ghostWhite !important;border:1px solid #dedede !important;color:#444 !important; font-size:90%!important;
|
88
|
+
padding:0 0.2em !important}
|
70
89
|
|
71
90
|
.markview pre.console{background-color:#000;color:white;font-size:90%;line-height:1.5em;margin:0 0 1em;padding:0.5em}
|
72
91
|
.markview pre.console code{background-color:#000;border:medium none;color:#fff;font-size:100%;padding:0}
|
data/lib/markview/views/base.erb
CHANGED
@@ -1,16 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
5
|
-
<title>Markview</title>
|
6
|
-
<link rel="stylesheet" href="/style.css" type="text/css" media="screen" charset="utf-8">
|
7
|
-
</head>
|
8
|
-
<body>
|
9
|
-
<div id="content" class="clear">
|
10
|
-
<p id="file"><%= @title %></p>
|
11
|
-
<div id="markview-output" class="markview">
|
12
|
-
<%= @markdown %>
|
13
|
-
</div>
|
14
|
-
</div>
|
15
|
-
</body>
|
16
|
-
</html>
|
1
|
+
<div id="markview-output" class="markview">
|
2
|
+
<%= @markdown %>
|
3
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
5
|
+
<title>Markview</title>
|
6
|
+
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
|
7
|
+
<script src="/jquery.notifyBar.js"></script>
|
8
|
+
<script src="/app.js" type="text/javascript" charset="utf-8"></script>
|
9
|
+
<link rel="stylesheet" href="/style.css" type="text/css" media="screen" charset="utf-8">
|
10
|
+
<link rel="stylesheet" href="/jquery.notifyBar.css" type="text/css" media="screen" />
|
11
|
+
</script>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<div id="content" class="clear">
|
15
|
+
<p id="file"><%= @title %></p>
|
16
|
+
|
17
|
+
<div class="meta">
|
18
|
+
<ul>
|
19
|
+
<li><a id="edit" href="#">edit</a></li>
|
20
|
+
<li class="last"><a id="save" href="#">save</a></li>
|
21
|
+
<li class="last"><a id="preview" href="#">preview</a></li>
|
22
|
+
</ul>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<%= yield %>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
</body>
|
29
|
+
</html>
|
data/test/render_test.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
require 'test/test_helper'
|
2
2
|
|
3
3
|
class RenderTest
|
4
|
-
|
4
|
+
|
5
5
|
test "renders given file" do
|
6
|
-
assert_equal GitHub::Markup.render(@argv, File.read(@argv)),
|
7
|
-
Markview::Application.markview_me
|
6
|
+
assert_equal GitHub::Markup.render(@argv, File.read(@argv)), Markview.render
|
8
7
|
end
|
9
8
|
|
10
9
|
test "renders discovered file" do
|
11
10
|
discover_file
|
12
|
-
assert_equal GitHub::Markup.render(@argv, File.read(@argv)),
|
13
|
-
Markview::Application.markview_me
|
11
|
+
assert_equal GitHub::Markup.render(@argv, File.read(@argv)), Markview.render
|
14
12
|
end
|
15
13
|
|
16
14
|
test "no markdown file given or found raises error" do
|
17
15
|
bad_file
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
Proc.new {
|
17
|
+
assert_raise LoadError do
|
18
|
+
require 'markview.rb'
|
19
|
+
end
|
20
|
+
}
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
test "on GET to root" do
|
24
24
|
get "/"
|
25
25
|
should_respond_with_success
|
data/test/test_helper.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
$LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__)) + '/../lib'
|
2
2
|
require File.dirname(File.expand_path(__FILE__)) + '/../lib/markview.rb'
|
3
|
-
require 'contest'
|
4
3
|
require 'rack/test'
|
4
|
+
require 'contest'
|
5
5
|
|
6
6
|
class RenderTest < Test::Unit::TestCase
|
7
7
|
include Rack::Test::Methods
|
8
|
-
|
8
|
+
|
9
9
|
def app
|
10
|
-
Markview
|
10
|
+
Markview.new
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def should_respond_with_success
|
14
14
|
assert last_response.ok?
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def setup
|
18
18
|
@argv = ARGV[0] = 'README.md'
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def discover_file
|
22
22
|
@argv = ARGV[0] = Dir.glob("README*")[0]
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def bad_file
|
26
26
|
@argv = ARGV[0] = "bad_file_name"
|
27
27
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Mark Sands
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
+
date: 2011-01-06 00:00:00 -06:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: vegas
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 19
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
- 1
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: sinatra
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 51
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
- 9
|
@@ -49,9 +54,11 @@ dependencies:
|
|
49
54
|
name: github-markup
|
50
55
|
prerelease: false
|
51
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
52
58
|
requirements:
|
53
59
|
- - ">="
|
54
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 19
|
55
62
|
segments:
|
56
63
|
- 0
|
57
64
|
- 2
|
@@ -63,9 +70,11 @@ dependencies:
|
|
63
70
|
name: rdiscount
|
64
71
|
prerelease: false
|
65
72
|
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
66
74
|
requirements:
|
67
75
|
- - ">="
|
68
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 9
|
69
78
|
segments:
|
70
79
|
- 1
|
71
80
|
- 6
|
@@ -74,40 +83,46 @@ dependencies:
|
|
74
83
|
type: :runtime
|
75
84
|
version_requirements: *id004
|
76
85
|
- !ruby/object:Gem::Dependency
|
77
|
-
name:
|
86
|
+
name: json
|
78
87
|
prerelease: false
|
79
88
|
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
80
90
|
requirements:
|
81
91
|
- - ">="
|
82
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 11
|
83
94
|
segments:
|
84
|
-
- 0
|
85
95
|
- 1
|
86
|
-
-
|
87
|
-
|
88
|
-
|
96
|
+
- 4
|
97
|
+
- 6
|
98
|
+
version: 1.4.6
|
99
|
+
type: :runtime
|
89
100
|
version_requirements: *id005
|
90
101
|
- !ruby/object:Gem::Dependency
|
91
|
-
name:
|
102
|
+
name: contest
|
92
103
|
prerelease: false
|
93
104
|
requirement: &id006 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
94
106
|
requirements:
|
95
107
|
- - ">="
|
96
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 31
|
97
110
|
segments:
|
98
111
|
- 0
|
99
|
-
-
|
100
|
-
-
|
101
|
-
version: 0.
|
112
|
+
- 1
|
113
|
+
- 2
|
114
|
+
version: 0.1.2
|
102
115
|
type: :development
|
103
116
|
version_requirements: *id006
|
104
117
|
- !ruby/object:Gem::Dependency
|
105
118
|
name: rack-test
|
106
119
|
prerelease: false
|
107
120
|
requirement: &id007 !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
108
122
|
requirements:
|
109
123
|
- - ">="
|
110
124
|
- !ruby/object:Gem::Version
|
125
|
+
hash: 13
|
111
126
|
segments:
|
112
127
|
- 0
|
113
128
|
- 5
|
@@ -115,7 +130,7 @@ dependencies:
|
|
115
130
|
version: 0.5.3
|
116
131
|
type: :development
|
117
132
|
version_requirements: *id007
|
118
|
-
description:
|
133
|
+
description: Coneveniently renders and launches any markup formatted file within your browser.
|
119
134
|
email: marksands07@gmail.com
|
120
135
|
executables:
|
121
136
|
- markview
|
@@ -127,7 +142,11 @@ files:
|
|
127
142
|
- bin/markview
|
128
143
|
- lib/markview.rb
|
129
144
|
- lib/markview/public/style.css
|
145
|
+
- lib/markview/public/jquery.notifyBar.css
|
146
|
+
- lib/markview/public/app.js
|
147
|
+
- lib/markview/public/jquery.notifyBar.js
|
130
148
|
- lib/markview/views/base.erb
|
149
|
+
- lib/markview/views/layout.erb
|
131
150
|
- README.md
|
132
151
|
- test/test_helper.rb
|
133
152
|
- test/render_test.rb
|
@@ -141,26 +160,30 @@ rdoc_options: []
|
|
141
160
|
require_paths:
|
142
161
|
- lib
|
143
162
|
required_ruby_version: !ruby/object:Gem::Requirement
|
163
|
+
none: false
|
144
164
|
requirements:
|
145
165
|
- - ">="
|
146
166
|
- !ruby/object:Gem::Version
|
167
|
+
hash: 3
|
147
168
|
segments:
|
148
169
|
- 0
|
149
170
|
version: "0"
|
150
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
|
+
none: false
|
151
173
|
requirements:
|
152
174
|
- - ">="
|
153
175
|
- !ruby/object:Gem::Version
|
176
|
+
hash: 3
|
154
177
|
segments:
|
155
178
|
- 0
|
156
179
|
version: "0"
|
157
180
|
requirements: []
|
158
181
|
|
159
182
|
rubyforge_project: markview
|
160
|
-
rubygems_version: 1.3.
|
183
|
+
rubygems_version: 1.3.7
|
161
184
|
signing_key:
|
162
185
|
specification_version: 3
|
163
|
-
summary: A markup viewer that renders on the fly.
|
186
|
+
summary: A markup viewer that renders on the fly in your browser.
|
164
187
|
test_files:
|
165
188
|
- test/test_helper.rb
|
166
189
|
- test/render_test.rb
|