blogdoor 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ $(function () {
2
+ var socket = new WebSocket("ws://localhost:5678/websocket");
3
+ socket.onmessage = function (event) {
4
+ window.location.reload();
5
+ };
6
+ socket.onerror = function (error) {
7
+ console.log("Error: " + error.type);
8
+ };
9
+ });
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+ require "pathname"
3
+
4
+ describe Blogdoor::Builder do
5
+ let(:root_path) { Pathname.new("../fixtures").expand_path(File.dirname(__FILE__)) }
6
+ let(:layout_path) { root_path.join("layout.erb") }
7
+ let(:builds_path) { root_path.join("builds") }
8
+ let(:builder) { described_class.new({ root_path: root_path, layout_path: layout_path }) }
9
+
10
+ after(:each) do
11
+ builds_path.rmtree
12
+ end
13
+
14
+ describe "#build_all" do
15
+ it "makes './builds' directory" do
16
+ builder.build_all
17
+ expect(builds_path).to exist
18
+ end
19
+
20
+ it "builds HTML file under './builds' directory" do
21
+ builder.build_all
22
+ expect(builds_path.entries).to have_at_least(3).items
23
+ end
24
+ end
25
+
26
+ describe "#build" do
27
+ it "inserts script tags for livereload" do
28
+ builds_path.mkdir
29
+ builder.build(root_path.join("sample.md"))
30
+ html = builds_path.join("sample.html").read
31
+ expect(html).to include "jquery.js"
32
+ expect(html).to include "livereload.js"
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title><%= @title %></title>
6
+ </head>
7
+ <body>
8
+ <article>
9
+ <p class="when"><%= @created_at %></p>
10
+ <h1><%= @title %>
11
+ <div class="article-body">
12
+ <%= @content %>
13
+ </div>
14
+ </article>
15
+ </body>
16
+ </html>
@@ -0,0 +1,16 @@
1
+ # 春はあけぼの
2
+
3
+ 春はあけぼの。やうやう白くなり行く、山ぎは少しあかりて、紫だちたる雲の細くたなびきたる。
4
+
5
+ # 夏は夜
6
+
7
+ 夏は夜。月のころはさらなり。やみもなほ、ほたるの多く飛びちがひたる。また、ただ一つ二つなど、ほのかにうち光りて行くもをかし。雨など降るもをかし。
8
+
9
+ # 秋は夕暮
10
+
11
+ 秋は夕暮。夕日のさして山の端(は)いと近うなりたるに、烏(からす)の寝どころへ行くとて、三つ四つ、二つ三つなど飛びいそぐさへあはれなり。まいて雁(かり)などのつらねたるが、いと小さく見ゆるはいとをかし。日入りはてて、風の音、虫の音など、はたいふべきにあらず。
12
+
13
+ # 冬はつとめて
14
+
15
+ 冬はつとめて。雪の降りたるはいふべきにもあらず。霜のいと白きも、またさらでも、いと寒きに、火などいそぎおこして、炭もてわたるもいとつきづきし。昼になりて、ぬるくゆるびもて行けば、火桶の火も白き灰がちになりてわろし。
16
+
@@ -0,0 +1,8 @@
1
+ lib = File.expand_path("../lib", File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require "blogdoor"
5
+
6
+ RSpec.configure do |config|
7
+ config.treat_symbols_as_metadata_keys_with_true_values = true
8
+ end
metadata ADDED
@@ -0,0 +1,181 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blogdoor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Naoto Kaneko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-03 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'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: redcarpet
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: listen
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
+ - !ruby/object:Gem::Dependency
56
+ name: sinatra
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sinatra-websocket
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description:
126
+ email:
127
+ - naoty.k@gmail.com
128
+ executables:
129
+ - blogdoor
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - .gitignore
134
+ - Gemfile
135
+ - LICENSE.txt
136
+ - README.md
137
+ - Rakefile
138
+ - bin/blogdoor
139
+ - blogdoor.gemspec
140
+ - lib/blogdoor.rb
141
+ - lib/blogdoor/builder.rb
142
+ - lib/blogdoor/client.rb
143
+ - lib/blogdoor/command.rb
144
+ - lib/blogdoor/server.rb
145
+ - lib/blogdoor/version.rb
146
+ - lib/blogdoor/watcher.rb
147
+ - lib/javascripts/jquery.js
148
+ - lib/javascripts/livereload.js
149
+ - spec/blogdoor/builder_spec.rb
150
+ - spec/fixtures/layout.erb
151
+ - spec/fixtures/sample.md
152
+ - spec/spec_helper.rb
153
+ homepage: https://github.com/naoty/blogdoor
154
+ licenses:
155
+ - MIT
156
+ metadata: {}
157
+ post_install_message:
158
+ rdoc_options: []
159
+ require_paths:
160
+ - lib
161
+ required_ruby_version: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ required_rubygems_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - '>='
169
+ - !ruby/object:Gem::Version
170
+ version: '0'
171
+ requirements: []
172
+ rubyforge_project:
173
+ rubygems_version: 2.0.14
174
+ signing_key:
175
+ specification_version: 4
176
+ summary: Blogdoor is a toolkit for easily publishing posts from local to your blog.
177
+ test_files:
178
+ - spec/blogdoor/builder_spec.rb
179
+ - spec/fixtures/layout.erb
180
+ - spec/fixtures/sample.md
181
+ - spec/spec_helper.rb