runeblog 0.0.75 → 0.0.76

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4f022029eff4356a8b19be4c514270df9ef66c8
4
- data.tar.gz: 5d0de42753a94a46d2c0e39618cca82520eb205d
3
+ metadata.gz: ea20b5ece2e1160b2d6a908b9cdf4dfb84669c39
4
+ data.tar.gz: d4624f623f98991472ed1d477266c93e193ecd50
5
5
  SHA512:
6
- metadata.gz: d5b401630040d46ee91d26a5a36be07afcbf5ccf40e6efae2ceb9aaff09bbe0420b220c0c2325a7ce8e1987dfd3c95c058bedfd283d11c1079409cc3110d572c
7
- data.tar.gz: b7e4c67b79cd72d8bcd180a6b9bef1813c3b14c5c8047ea6d7f9b25f8c7aa6edba7fb122c6070d04e46b0914727713a0b643964af3a41101b82b288fabcf5527
6
+ metadata.gz: 2854f7c068e1a26b5106beed39390fa9ecf4e01183cf836f932ad205df6065a07280b98482c13cace608a0ff7687ba585bd819f812ab4f33b978711efd5dfcd3
7
+ data.tar.gz: 30682686fa0ea29edb6fb0db128b28cc5bcfddc2b746f90299743564bde6390b7ebbfb0e3d85f1b61d96402b649ce843990ddf6f092e13ea2b8b5dbb821e3e5d
data/bin/blog CHANGED
@@ -23,6 +23,16 @@ STDOUT.sync = true
23
23
 
24
24
  cmd, arg = get_argv
25
25
 
26
+ if ! RuneBlog.exist?
27
+ print "No blog found. Create new one? (y/n) "
28
+ resp = gets.chomp
29
+ if resp == "y"
30
+ RuneBlog.create_new_blog
31
+ else
32
+ exit
33
+ end
34
+ end
35
+
26
36
  @blog = RuneBlog.new
27
37
 
28
38
  print red("\n RuneBlog v #{RuneBlog::VERSION}")
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.75 2018-10-02
1
+ RuneBlog v 0.0.76 2018-10-04
@@ -0,0 +1,24 @@
1
+ <html>
2
+ <body background=speckle-texture-vector.jpg>
3
+
4
+ <title>Ruby, Elixir, and More</title>
5
+
6
+ <table>
7
+ <tr>
8
+ <td>
9
+ <img src=blog3a.jpg width=400 height=300>
10
+ </td>
11
+ <td>
12
+ <h3>Yet another blog by Hal Fulton</h3>
13
+ <br>
14
+ <br>
15
+ <b>Note</b>: I can never find a blogging engine I like! <br>
16
+ For now, this will just be a set of static pages.
17
+ <br>
18
+ <br>
19
+ If you want to comment, just <a href=mailto:rubyhacker@gmail.com>email me</a>.
20
+ </td>
21
+ </tr>
22
+ </table>
23
+
24
+ <hr>
File without changes
@@ -0,0 +1,71 @@
1
+ <html>
2
+
3
+ <body background='speckle-texture-vector.jpg'>
4
+
5
+ <script>
6
+ window.fbAsyncInit = function() {
7
+ FB.init({
8
+ appId : '1176481582378716',
9
+ xfbml : true,
10
+ version : 'v2.4'
11
+ });
12
+ };
13
+
14
+ (function(d, s, id){
15
+ var js, fjs = d.getElementsByTagName(s)[0];
16
+ if (d.getElementById(id)) {return;}
17
+ js = d.createElement(s); js.id = id;
18
+ js.src = '//connect.facebook.net/en_US/sdk.js';
19
+ fjs.parentNode.insertBefore(js, fjs);
20
+ }(document, 'script', 'facebook-jssdk'));
21
+ </script>
22
+
23
+ <!-- meta property='fb:admins' content='767352779' /> -->
24
+ <meta property='og:url' content='http://rubyhacker.com/blog2/#{@meta.slug}.html'/>
25
+ <meta property='og:type' content='article'/>
26
+ <meta property='og:title' content='#{@meta.title}'/>
27
+ <meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
28
+ <meta property='og:description' content='#{@meta.teaser}'/>
29
+
30
+ <table bgcolor=#eeeeee cellspacing=5>
31
+ <tr>
32
+ <td valign=top>
33
+ <br> <font size=+2 color=red>#{@meta.title.chomp}</font> <br> #{@meta.pubdate.chomp}
34
+ </td>
35
+
36
+ <td width=2% bgcolor=red></td>
37
+
38
+ <td valign=top>
39
+ <a href='https://twitter.com/share'
40
+ class='twitter-share-button'
41
+ data-text='#{@meta.title}'
42
+ data-url='#{'url'}'
43
+ data-via='hal_fulton'
44
+ data-related='hal_fulton'>Tweet</a>
45
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
46
+ <br>
47
+ <a href='https://twitter.com/hal_fulton' class='twitter-follow-button' data-show-count='false'>Follow @hal_fulton</a>
48
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
49
+
50
+ <br>
51
+ <div
52
+ class='fb-like'
53
+ data-share='true'
54
+ data-width='450'
55
+ data-show-faces='true'>
56
+ </div>
57
+
58
+ </td>
59
+
60
+ </tr>
61
+ </table>
62
+
63
+
64
+ <hr>
65
+
66
+ #{@meta.body}
67
+
68
+
69
+ <hr>
70
+ <a href="http://rubyhacker.com/blog2" style="text-decoration: none">Back</a>
71
+ <a href="http://rubyhacker.com" style="text-decoration: none">Home</a>
File without changes
@@ -0,0 +1 @@
1
+ Initial creation
data/data/sequence CHANGED
@@ -1 +1 @@
1
- 0
1
+ 0
data/lib/repl.rb CHANGED
@@ -192,7 +192,7 @@ module RuneBlog::REPL
192
192
  id = get_integer(arg)
193
193
  result = @blog.remove_post(id)
194
194
  if result.nil?
195
- output! "No such post found (#{id})"
195
+ output! "Post #{id} not found"
196
196
  return @out
197
197
  end
198
198
  @out
@@ -218,7 +218,7 @@ module RuneBlog::REPL
218
218
  files = files.grep(/#{tag}-/)
219
219
  files = files.map {|f| File.basename(f) }
220
220
  return red("Multiple files: #{files}") if files.size > 1
221
- return red("\n No such post found (#{id})") if files.empty?
221
+ return red("\n Can't edit post #{id}") if files.empty?
222
222
 
223
223
  file = files.first
224
224
  result = system("vi #{@blog.root}/src/#{file}")
data/lib/runeblog.rb CHANGED
@@ -31,7 +31,7 @@ class RuneBlog
31
31
  def self.create_new_blog(dir = "data")
32
32
  File.write(".blog", "#{dir}\nno_default\n")
33
33
  # .blog lives above the entire subtree
34
- Dir.mkdir(dir) #-- what if dir already exists?
34
+ create_dir(dir)
35
35
  Dir.chdir(dir) do
36
36
  create_dir("views")
37
37
  create_dir("assets")
@@ -156,7 +156,6 @@ class RuneBlog
156
156
  post.publish
157
157
  post.num
158
158
  rescue => err
159
- p :ERROR
160
159
  puts err # error(err)
161
160
  end
162
161
 
@@ -180,6 +179,7 @@ p :ERROR
180
179
  end
181
180
 
182
181
  def change_view(view)
182
+ File.write(".blog", "#@root\n#{view}\n")
183
183
  self.view = view # error checking?
184
184
  end
185
185
 
@@ -274,6 +274,7 @@ p :ERROR
274
274
  result = system("rm -rf #{list.join(' ')}")
275
275
  error_cant_delete(files) unless result
276
276
  # FIXME - update index/etc
277
+ true
277
278
  end
278
279
 
279
280
  def post_exists?(num)
@@ -306,6 +307,7 @@ p :ERROR
306
307
  end
307
308
 
308
309
  def create_dir(dir)
310
+ return if File.exist?(dir) && File.directory?(dir)
309
311
  cmd = "mkdir -p #{dir} >/dev/null 2>&1"
310
312
  result = system(cmd)
311
313
  raise "Can't create #{dir}" unless result
data/lib/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.0.75"
3
+ VERSION = "0.0.76"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
@@ -7,12 +7,6 @@ require 'lib/repl'
7
7
  class TestREPL < Minitest::Test
8
8
  include RuneBlog::REPL
9
9
 
10
- def make_post(x, title)
11
- meta = OpenStruct.new
12
- meta.title = title
13
- num = x.create_new_post(meta, true)
14
- end
15
-
16
10
  def show_lines(text)
17
11
  lines = text.split("\n")
18
12
  str = "#{lines.size} lines\n"
@@ -21,32 +15,9 @@ class TestREPL < Minitest::Test
21
15
  end
22
16
 
23
17
  def setup
24
- system("rm -rf data_test")
25
- # system("tar xvf data_test.tar 2>/dev/null")
26
- RuneBlog.create_new_blog(Dir.pwd + "/data_test")
27
- x = RuneBlog.new
28
- x.create_view("alpha_view")
29
- x.create_view("beta_view")
30
- x.create_view("gamma_view")
31
-
32
- x.change_view("alpha_view") # 1 2 7 8 9
33
- make_post(x, "Post number 1")
34
- make_post(x, "Post number 2")
35
- x.change_view("beta_view") # 3 5 6
36
- make_post(x, "Post number 3")
37
- x.change_view("gamma_view") # 4 10
38
- make_post(x, "Post number 4")
39
- x.change_view("beta_view")
40
- make_post(x, "Post number 5")
41
- make_post(x, "Post number 6")
42
- x.change_view("alpha_view")
43
- make_post(x, "Post number 7")
44
- make_post(x, "Post number 8")
45
- make_post(x, "Post number 9")
46
- x.change_view("gamma_view")
47
- make_post(x, "Post number 10")
48
- x.change_view("alpha_view")
49
- @blog = x
18
+ # To be strictly correct in testing (though slower),
19
+ # run make_blog here.
20
+ @blog = RuneBlog.new
50
21
  end
51
22
 
52
23
  # Note: "Bang" methods depend on the data_test subtree
@@ -178,6 +149,7 @@ class TestREPL < Minitest::Test
178
149
  end
179
150
 
180
151
  def test_013_kill_posts!
152
+ # Must think about this.
181
153
  end
182
154
  end
183
155
 
data/test/make_blog.rb ADDED
@@ -0,0 +1,41 @@
1
+ $LOAD_PATH << "."
2
+
3
+ require 'lib/repl'
4
+
5
+ def make_post(x, title)
6
+ meta = OpenStruct.new
7
+ meta.title = title
8
+ num = x.create_new_post(meta, true)
9
+ end
10
+
11
+ def show_lines(text)
12
+ lines = text.split("\n")
13
+ str = "#{lines.size} lines\n"
14
+ lines.each {|line| str << " #{line.inspect}\n" }
15
+ str
16
+ end
17
+
18
+ system("rm -rf data_test")
19
+ RuneBlog.create_new_blog(Dir.pwd + "/data_test")
20
+ x = RuneBlog.new
21
+ x.create_view("alpha_view")
22
+ x.create_view("beta_view")
23
+ x.create_view("gamma_view")
24
+
25
+ x.change_view("alpha_view") # 1 2 7 8 9
26
+ make_post(x, "Post number 1")
27
+ make_post(x, "Post number 2")
28
+ x.change_view("beta_view") # 3 5 6
29
+ make_post(x, "Post number 3")
30
+ x.change_view("gamma_view") # 4 10
31
+ make_post(x, "Post number 4")
32
+ x.change_view("beta_view")
33
+ make_post(x, "Post number 5")
34
+ make_post(x, "Post number 6")
35
+ x.change_view("alpha_view")
36
+ make_post(x, "Post number 7")
37
+ make_post(x, "Post number 8")
38
+ make_post(x, "Post number 9")
39
+ x.change_view("gamma_view")
40
+ make_post(x, "Post number 10")
41
+ x.change_view("alpha_view")
data/test/test ADDED
@@ -0,0 +1,2 @@
1
+ ruby test/make_blog.rb
2
+ ruby test/general.rb
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.75
4
+ version: 0.0.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-02 00:00:00.000000000 Z
11
+ date: 2018-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -41,6 +41,11 @@ files:
41
41
  - "./README.md"
42
42
  - bin/blog
43
43
  - data/VERSION
44
+ - data/_default/custom/blog_header.html
45
+ - data/_default/custom/blog_trailer.html
46
+ - data/_default/custom/post_template.html
47
+ - data/_default/deploy
48
+ - data/_default/last_deployed
44
49
  - data/sequence
45
50
  - data/views/_default/custom/blog_header.html
46
51
  - data/views/_default/custom/blog_trailer.html
@@ -57,7 +62,9 @@ files:
57
62
  - lib/version.rb
58
63
  - lib/view.rb
59
64
  - runeblog.gemspec
60
- - test/repl.rb
65
+ - test/general.rb
66
+ - test/make_blog.rb
67
+ - test/test
61
68
  homepage: https://github.com/Hal9000/runeblog
62
69
  licenses:
63
70
  - Ruby License
@@ -78,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
85
  version: '0'
79
86
  requirements: []
80
87
  rubyforge_project:
81
- rubygems_version: 2.6.13
88
+ rubygems_version: 2.2.2
82
89
  signing_key:
83
90
  specification_version: 4
84
91
  summary: A command-line blogging system