methan 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/exe/methan +3 -0
- data/lib/methan.rb +5 -0
- data/lib/methan/console.rb +59 -0
- data/lib/methan/md_renderer.rb +25 -0
- data/lib/methan/server.rb +195 -0
- data/lib/methan/server/config.ru +9 -0
- data/lib/methan/server/static/style.css +82 -0
- data/lib/methan/server/templates/index.html.erb +26 -0
- data/lib/methan/server/templates/show.html.erb +18 -0
- data/lib/methan/util.rb +9 -0
- data/lib/methan/version.rb +3 -0
- data/methan.gemspec +27 -0
- metadata +137 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3fc8f7fe210a2339258c2a4793e9355776b13ed5
|
4
|
+
data.tar.gz: 6daa65eaf567519936e986ef1c1884e149d10a8b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f4fbbe904d0537b478b19bfda828b2303a7939dacf1fdcdbd1fd7a47719a5c0f940bd0803efbd630ed39fd7e00d818ffa1d7ea6ec5e6a22eb762fa00362d4385
|
7
|
+
data.tar.gz: 53187031a69cded020adef065cca8457d34760d0c7d79331071278feb30fd8dac6d76a129813e3839a2e405df50f7af2de1d8c068171844808dbcccc35925eae
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Shinichirow KAMITO
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Methan
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/methan`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'methan'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install methan
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it ( https://github.com/[my-github-username]/methan/fork )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "methan"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/exe/methan
ADDED
data/lib/methan.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require "thor"
|
4
|
+
require "methan/version"
|
5
|
+
require "methan/server"
|
6
|
+
|
7
|
+
|
8
|
+
module Methan
|
9
|
+
|
10
|
+
|
11
|
+
class Console < Thor
|
12
|
+
|
13
|
+
|
14
|
+
desc "version", "show version"
|
15
|
+
def version
|
16
|
+
show Methan::VERSION
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "new FILENAME", "Create a new memo"
|
20
|
+
option :title, type: :string, desc: %q{Title}, aliases: "t"
|
21
|
+
def new(filename)
|
22
|
+
now = Time.now.strftime("%Y%m%d%H%M%S")
|
23
|
+
pwd = Dir::pwd
|
24
|
+
|
25
|
+
filename = "#{filename}.md" unless filename.split(".").last == "md"
|
26
|
+
filename = "#{now}_#{filename}"
|
27
|
+
filepath = File.join(pwd, filename)
|
28
|
+
|
29
|
+
src = "# #{options[:title] || ''}\n"
|
30
|
+
File.open(filepath, "w") do |io|
|
31
|
+
io.write(src)
|
32
|
+
end
|
33
|
+
show "Create memo `#{filename} at #{pwd}`", :green
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "server", "Run server"
|
37
|
+
option :host, type: :string, desc: "Bind address", aliases: "h", default: ::Methan::Server::DEFAULT_HOST
|
38
|
+
option :port, type: :numeric, desc: "Bind port", aliases: "p", default: ::Methan::Server::DEFAULT_PORT
|
39
|
+
def server
|
40
|
+
::Methan::Server.rackup(options.dup)
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def show(message, color=nil)
|
47
|
+
prefix = case color
|
48
|
+
when :red then "\033[31m"
|
49
|
+
when :green then "\033[32m"
|
50
|
+
when :yellow then "\033[33m"
|
51
|
+
when :blue then "\033[34m"
|
52
|
+
else ""
|
53
|
+
end
|
54
|
+
suffix = prefix == "" ? "" : "\033[0m"
|
55
|
+
puts "#{prefix}#{message}#{suffix}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
require "redcarpet"
|
3
|
+
|
4
|
+
module Methan
|
5
|
+
|
6
|
+
|
7
|
+
class MdRenderer < ::Redcarpet::Render::HTML
|
8
|
+
def list_item(text, list_type)
|
9
|
+
tag = "<li"
|
10
|
+
r = /^\[(\s|x)\]\s/
|
11
|
+
m = r.match(text)
|
12
|
+
if m
|
13
|
+
input_tag = "<input type=\"checkbox\""
|
14
|
+
input_tag << " checked=\"true\"" if m[1] and m[1] == 'x'
|
15
|
+
input_tag << ">"
|
16
|
+
text = text.gsub(r, '')
|
17
|
+
text = "#{input_tag} #{text}"
|
18
|
+
tag << " class=\"task-item\""
|
19
|
+
end
|
20
|
+
tag << ">#{text}</li>"
|
21
|
+
return tag
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
|
2
|
+
require "erb"
|
3
|
+
require "rack"
|
4
|
+
require "redcarpet"
|
5
|
+
require "methan/md_renderer"
|
6
|
+
require "methan/util"
|
7
|
+
|
8
|
+
|
9
|
+
module Methan
|
10
|
+
|
11
|
+
class Server
|
12
|
+
|
13
|
+
DEFAULT_HOST = "0.0.0.0"
|
14
|
+
DEFAULT_PORT = 5550
|
15
|
+
|
16
|
+
class << self
|
17
|
+
|
18
|
+
def rackup(args={})
|
19
|
+
args[:'Host'] = args.delete('host') if args['host']
|
20
|
+
args[:'Port'] = args.delete('port') if args['port']
|
21
|
+
options = {
|
22
|
+
environment: ENV['RACK_ENV'] || "development",
|
23
|
+
pid: nil,
|
24
|
+
'Port': DEFAULT_PORT,
|
25
|
+
'Host': DEFAULT_HOST,
|
26
|
+
'AccessLog': [],
|
27
|
+
config: File.join(File.dirname(__FILE__), 'server/config.ru'),
|
28
|
+
}
|
29
|
+
options.update(args.deep_symbolize_keys)
|
30
|
+
ENV["RACK_ENV"] = options[:environment]
|
31
|
+
Rack::Server.start(options)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
ROUTES = {
|
37
|
+
"GET:/style.css" => :style_css,
|
38
|
+
"GET:/" => :index,
|
39
|
+
}
|
40
|
+
|
41
|
+
def initialize(app=nil)
|
42
|
+
@app = app
|
43
|
+
end
|
44
|
+
|
45
|
+
# Rack interface method.
|
46
|
+
def call(env)
|
47
|
+
req = ::Rack::Request.new(env)
|
48
|
+
route_method = nil
|
49
|
+
ROUTES.each do |route, method|
|
50
|
+
http_method, path = route.split(":", 2)
|
51
|
+
if req.path == path and http_method.to_s.upcase == req.request_method.to_s.upcase
|
52
|
+
route_method = "#{http_method.to_s.downcase}_#{method.to_s}".to_sym
|
53
|
+
break
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
response = nil
|
58
|
+
if not route_method.nil? and self.respond_to?(route_method, true)
|
59
|
+
response = self.send(route_method, req)
|
60
|
+
else
|
61
|
+
## show
|
62
|
+
filename = req.path.dup
|
63
|
+
filename = filename.gsub(/^\//, "")
|
64
|
+
filename = "#{filename}.md" unless filename =~ /^\.md$/
|
65
|
+
showpath = File.join(Dir.pwd, filename)
|
66
|
+
puts showpath
|
67
|
+
if File.exists?(showpath)
|
68
|
+
response = get_show(req)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# 404 not found
|
73
|
+
response = gen_404_response() if response.nil?
|
74
|
+
# response finished
|
75
|
+
response.finish
|
76
|
+
end
|
77
|
+
|
78
|
+
def get_style_css(req)
|
79
|
+
filepath = File.join(File.dirname(__FILE__), "server/static/style.css")
|
80
|
+
src = File.read(filepath)
|
81
|
+
gen_response(src, 200, {'Content-Type' => 'text/css'})
|
82
|
+
end
|
83
|
+
|
84
|
+
def get_index(req)
|
85
|
+
current_dir = Dir.pwd
|
86
|
+
path = File.join(current_dir, "**/*.md")
|
87
|
+
# bindings
|
88
|
+
@files = Dir.glob(path).map do |file|
|
89
|
+
file_id = file.gsub(current_dir, "")
|
90
|
+
file_id = file_id.gsub(/\.md$/, "").gsub(/^\//, "")
|
91
|
+
dat = {
|
92
|
+
id: file_id,
|
93
|
+
name: File.basename(file),
|
94
|
+
path: file,
|
95
|
+
}
|
96
|
+
File.open(file) do |f|
|
97
|
+
title = f.gets
|
98
|
+
title = title.gsub(/^\#\s+/, "").gsub(/\s+\#$/, "").strip
|
99
|
+
dat[:title] = title
|
100
|
+
end
|
101
|
+
dat
|
102
|
+
end
|
103
|
+
@files.sort!{|a, b| a[:id] <=> b[:id] }
|
104
|
+
@files.reverse!
|
105
|
+
src = File.read(make_template_path("index.html.erb"))
|
106
|
+
erb = ERB.new(src)
|
107
|
+
body = erb.result(binding)
|
108
|
+
return gen_response(body)
|
109
|
+
end
|
110
|
+
|
111
|
+
def get_show(req)
|
112
|
+
path = req.path.dup
|
113
|
+
file_id = path.gsub(/^\//, "")
|
114
|
+
if file_id =~ /\.md$/
|
115
|
+
filename = file_id
|
116
|
+
file_id = file_id.gsub(/\.md$/, "")
|
117
|
+
else
|
118
|
+
filename = "#{file_id}.md"
|
119
|
+
end
|
120
|
+
filepath = File.join(Dir.pwd, filename)
|
121
|
+
|
122
|
+
# bindings
|
123
|
+
@file_id = file_id
|
124
|
+
@filename = filename
|
125
|
+
@src = File.read(filepath)
|
126
|
+
@html = markdown_to_html(@src)
|
127
|
+
|
128
|
+
# to html
|
129
|
+
src = File.read(make_template_path("show.html.erb"))
|
130
|
+
erb = ERB.new(src)
|
131
|
+
body = erb.result(binding)
|
132
|
+
return gen_response(body)
|
133
|
+
end
|
134
|
+
|
135
|
+
# Convert Markdown source to HTML.
|
136
|
+
# @param [String] src Markdown source.
|
137
|
+
def markdown_to_html(src)
|
138
|
+
render_options = {
|
139
|
+
prettify: true,
|
140
|
+
}
|
141
|
+
renderer = MdRenderer.new(render_options)
|
142
|
+
extensions = {
|
143
|
+
no_intra_emphasis: true,
|
144
|
+
autolink: true,
|
145
|
+
tables: true,
|
146
|
+
fenced_code_blocks: true,
|
147
|
+
strikethrough: true,
|
148
|
+
underline: true,
|
149
|
+
quote: true,
|
150
|
+
footnotes: true,
|
151
|
+
}
|
152
|
+
md = ::Redcarpet::Markdown.new(renderer, extensions)
|
153
|
+
html = md.render(src)
|
154
|
+
return html
|
155
|
+
end
|
156
|
+
|
157
|
+
# Generate Rack::Response
|
158
|
+
# @param [String] body Response body.
|
159
|
+
# @param [Fixnum] status Status code.
|
160
|
+
# @param [Hash] headers Headers.
|
161
|
+
# @return [Rack::Response]
|
162
|
+
def gen_response(body, status=200, headers={})
|
163
|
+
response = Rack::Response.new do |r|
|
164
|
+
r.status = status
|
165
|
+
r['Content-Type'] = "text/html" unless headers.key?('Content-Type')
|
166
|
+
headers.each do |key, val|
|
167
|
+
r[key] = val
|
168
|
+
end
|
169
|
+
r.write body
|
170
|
+
end
|
171
|
+
return response
|
172
|
+
end
|
173
|
+
|
174
|
+
# Generate 404 Response
|
175
|
+
# @return [Rack::Response]
|
176
|
+
def gen_404_response()
|
177
|
+
response = gen_response("<h1>404 Not Found</h1>", 404)
|
178
|
+
return response
|
179
|
+
end
|
180
|
+
|
181
|
+
# Generate ERB template file path.
|
182
|
+
# @param [String] filename template file name.
|
183
|
+
# @return [String]
|
184
|
+
def make_template_path(filename)
|
185
|
+
return File.join(templates_dir, filename)
|
186
|
+
end
|
187
|
+
|
188
|
+
# Return templates directory path.
|
189
|
+
# @return [String]
|
190
|
+
def templates_dir
|
191
|
+
return File.join(File.dirname(__FILE__), 'server/templates')
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
|
2
|
+
body {
|
3
|
+
color: #333;
|
4
|
+
font-size: 11pt;
|
5
|
+
font-family: Helvetica, arial, freesans, clean, sans-serif;
|
6
|
+
line-height: 1.7;
|
7
|
+
}
|
8
|
+
|
9
|
+
div#contents {
|
10
|
+
margin-left: 80px;
|
11
|
+
margin-right: 80px;
|
12
|
+
margin-bottom: 100px;
|
13
|
+
}
|
14
|
+
|
15
|
+
|
16
|
+
h1,h2,h3,h4,h5,h6,h7 {
|
17
|
+
font-size: 1em;
|
18
|
+
}
|
19
|
+
h1 { font-size: 2.5em; }
|
20
|
+
h2 { font-size: 2em; }
|
21
|
+
h3 { font-size: 1.5em; }
|
22
|
+
h4 { font-size: 1.2em; }
|
23
|
+
h5 { font-size: 1.1em; }
|
24
|
+
|
25
|
+
h1, h2 {
|
26
|
+
border-bottom: 1px solid #EEE;
|
27
|
+
}
|
28
|
+
|
29
|
+
ul > li {}
|
30
|
+
|
31
|
+
ul > li.task-item {
|
32
|
+
list-style-type: none;
|
33
|
+
}
|
34
|
+
|
35
|
+
ul > li > input[type="checkbox"]{
|
36
|
+
float: left;
|
37
|
+
margin-left: -20px;
|
38
|
+
}
|
39
|
+
|
40
|
+
code {
|
41
|
+
border-radius: 3px;
|
42
|
+
padding-left: 6px;
|
43
|
+
padding-right: 6px;
|
44
|
+
border: 1px solid #DDD;
|
45
|
+
background-color: #F8F8F8;
|
46
|
+
font-size: 11pt;
|
47
|
+
font-family: Consolas, 'Liberation Mono', Courier, monospace;
|
48
|
+
}
|
49
|
+
|
50
|
+
pre > code{
|
51
|
+
display: block;
|
52
|
+
padding: 6px 10px;
|
53
|
+
font-size: 10pt;
|
54
|
+
line-height: 19px;
|
55
|
+
overflow: auto;
|
56
|
+
}
|
57
|
+
|
58
|
+
table {
|
59
|
+
border-collapse: collapse;
|
60
|
+
}
|
61
|
+
table > thead > tr > th, table > tbody > tr > td {
|
62
|
+
border: 1px solid #DDDDDD;
|
63
|
+
padding: 4px 6px;
|
64
|
+
font-size: 11pt;
|
65
|
+
}
|
66
|
+
table > thead > tr > th {
|
67
|
+
text: align: center;
|
68
|
+
background-color: #F8F8F8;
|
69
|
+
}
|
70
|
+
|
71
|
+
span.file-title {}
|
72
|
+
span.file-id {
|
73
|
+
margin-left: 10px;
|
74
|
+
color: #999999;
|
75
|
+
font-size: .9em;
|
76
|
+
}
|
77
|
+
|
78
|
+
img {
|
79
|
+
max-width: 100%;
|
80
|
+
margin-top: 1em;
|
81
|
+
margin-bottom: 1em;
|
82
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4
|
+
<title>/</title>
|
5
|
+
<link rel="stylesheet" type="text/css" href="/style.css">
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<div id="contents">
|
9
|
+
<h1>/</h1>
|
10
|
+
<dl>
|
11
|
+
<% if @files %>
|
12
|
+
<% @files.each do |f| %>
|
13
|
+
<dt>
|
14
|
+
<a href="/<%= f[:id] %>">
|
15
|
+
<span class="file-title">
|
16
|
+
<%= (f[:title].nil? or f[:title].empty?) ? f[:id] : f[:title] %>
|
17
|
+
</span>
|
18
|
+
</a>
|
19
|
+
<span class="file-id">(<%= f[:id] %>)</span>
|
20
|
+
</dt>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
</dl>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
4
|
+
<title>/<%= @file_id %></title>
|
5
|
+
<link rel="stylesheet" type="text/css" href="/style.css">
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
<div id="contents">
|
9
|
+
<h1>/<%= @file_id %></h1>
|
10
|
+
<div class="navi">
|
11
|
+
<a href="/">back to index</a>
|
12
|
+
</div>
|
13
|
+
<hr>
|
14
|
+
|
15
|
+
<%= @html %>
|
16
|
+
</div>
|
17
|
+
</body>
|
18
|
+
</html>
|
data/lib/methan/util.rb
ADDED
data/methan.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'methan/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "methan"
|
8
|
+
spec.version = Methan::VERSION
|
9
|
+
spec.authors = ["Shinichirow KAMITO"]
|
10
|
+
spec.email = ["shinichirow@kamito.net"]
|
11
|
+
|
12
|
+
spec.summary = %q{Methan is a memo organizer.}
|
13
|
+
spec.description = %q{Methan is a memo organizer.}
|
14
|
+
spec.homepage = "https://github.com/kamito/methan"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "thor", "~> 0.19"
|
23
|
+
spec.add_dependency "rack", "~> 1.4"
|
24
|
+
spec.add_dependency "redcarpet", "~> 3.2"
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.8"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: methan
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Shinichirow KAMITO
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.19'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.19'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: redcarpet
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.8'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.8'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
description: Methan is a memo organizer.
|
84
|
+
email:
|
85
|
+
- shinichirow@kamito.net
|
86
|
+
executables:
|
87
|
+
- methan
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- ".travis.yml"
|
94
|
+
- CODE_OF_CONDUCT.md
|
95
|
+
- Gemfile
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- bin/console
|
100
|
+
- bin/setup
|
101
|
+
- exe/methan
|
102
|
+
- lib/methan.rb
|
103
|
+
- lib/methan/console.rb
|
104
|
+
- lib/methan/md_renderer.rb
|
105
|
+
- lib/methan/server.rb
|
106
|
+
- lib/methan/server/config.ru
|
107
|
+
- lib/methan/server/static/style.css
|
108
|
+
- lib/methan/server/templates/index.html.erb
|
109
|
+
- lib/methan/server/templates/show.html.erb
|
110
|
+
- lib/methan/util.rb
|
111
|
+
- lib/methan/version.rb
|
112
|
+
- methan.gemspec
|
113
|
+
homepage: https://github.com/kamito/methan
|
114
|
+
licenses:
|
115
|
+
- MIT
|
116
|
+
metadata: {}
|
117
|
+
post_install_message:
|
118
|
+
rdoc_options: []
|
119
|
+
require_paths:
|
120
|
+
- lib
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
requirements: []
|
132
|
+
rubyforge_project:
|
133
|
+
rubygems_version: 2.4.5
|
134
|
+
signing_key:
|
135
|
+
specification_version: 4
|
136
|
+
summary: Methan is a memo organizer.
|
137
|
+
test_files: []
|