simpleblog 0.0.1 → 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/simpleblog.rb +9 -7
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f5eae049cc2930e851eaaf6d32a7230932f8b1044276554e856fa21cc3a1875
4
- data.tar.gz: 0a690b86338a7dd6d2f6697c619c5db835bcd4a36108ab51920be5b34d5d2a3a
3
+ metadata.gz: 23477b5821f9939f14b75793c3bb7d5566a8c02f68e77cf5557d34f57611363a
4
+ data.tar.gz: f3b27ce460b6005c4d7dd59e4a223d61f830a04ed14f66ecf237aae92b1ce66e
5
5
  SHA512:
6
- metadata.gz: c9ea4abd1efd2938941daed5efa33bf8e1d01c388e2491b8e5e426fa68d9f05a219f9e53790371a17e4af32aa1508c8c92f1835edf07734ee2be8d2dd1c4603d
7
- data.tar.gz: 4bd09d0b6b58d518c8b75372a8e5b9bbd9bc9d467ce69aebc8b288c780b3d011ea83a40645e47cdbbda3e2aba5f7c6b283905a3ba2ce51399ce4149107ba8492
6
+ metadata.gz: 315ead88d6a4bba4ebb53e706572b422a8c40f058cfd7a11b52d0c1ce74957cbb3bad2224a9cc4a6731ad4a69cb6edaa489ed2ae1a9ae0927432cd23352db7f2
7
+ data.tar.gz: 5d8227b6f0949b1c707152e6e417abdc084f72dc81c61376d29b028d02accd97cc263ada62b57bf492e2ea38c2731dfdd6bfbe6d0b63cdb7537b79219fb58ac4
data/lib/simpleblog.rb CHANGED
@@ -1,6 +1,7 @@
1
- require 'redcarpet'
2
- require 'rouge'
3
- require_dependency 'rouge/plugins/redcarpet'
1
+ require "redcarpet"
2
+ require "rouge"
3
+
4
+ require_dependency "rouge/plugins/redcarpet"
4
5
 
5
6
  class ArticleHTMLRender < Redcarpet::Render::HTML
6
7
  include Rouge::Plugins::Redcarpet
@@ -14,6 +15,7 @@ class ArticleHTMLRender < Redcarpet::Render::HTML
14
15
  end
15
16
  end
16
17
  end
18
+
17
19
  class SimpleBlog
18
20
  def self.render_article(id)
19
21
  article_content = File.open("app/articles/#{id.to_i}.md").read
@@ -22,7 +24,7 @@ class SimpleBlog
22
24
  markdown.render(article_content)
23
25
  end
24
26
 
25
- def self.list_articles(tag = "", in_progress: "true")
27
+ def self.list_articles(tag = "", in_progress = "true")
26
28
  articles_yml_result = YAML.load_file("app/articles/articles.yml")["articles"]
27
29
  articles = Article.build_list_of_articles(articles_yml_result)
28
30
 
@@ -30,10 +32,10 @@ class SimpleBlog
30
32
  articles = articles.filter { |article| article.tags.include?(tag) }
31
33
  end
32
34
 
33
- if in_progress == "true"
34
- articles = articles.filter { |article| article.in_progress }
35
+ articles = if in_progress == "true"
36
+ articles.filter { |article| article.in_progress }
35
37
  else
36
- articles = articles.filter { |article| !article.in_progress }
38
+ articles.filter { |article| !article.in_progress }
37
39
  end
38
40
 
39
41
  articles.sort_by(&:id).reverse!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpleblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caroline Salib
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-25 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create a simple blog that can be edit with markdown
14
14
  email: carolinesalibc@gmail.com
@@ -20,7 +20,8 @@ files:
20
20
  homepage: https://rubygems.org/gems/simpleblog
21
21
  licenses:
22
22
  - MIT
23
- metadata: {}
23
+ metadata:
24
+ source_code_uri: https://github.com/carolinesalib/simpleblog
24
25
  post_install_message:
25
26
  rdoc_options: []
26
27
  require_paths:
@@ -39,6 +40,5 @@ requirements: []
39
40
  rubygems_version: 3.2.32
40
41
  signing_key:
41
42
  specification_version: 4
42
- summary: Simpler than a regular Rails blog and more dynamically customizable than
43
- a Jekyll blog
43
+ summary: Helpers to generate markdown blog pages using Rails
44
44
  test_files: []