station 0.5.2 → 0.5.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af0708ea932264e4e40c67922dccd47150b604c2ed23588002119e3d39030e8b
4
- data.tar.gz: ff8a72d3015e4bedbcc1e1d09d17a714fff76f9cd41f203a542cc01dbc6933e2
3
+ metadata.gz: e935ef6d7f3978dfe86c75fa656e430e48a58c7b0a09e4038bc196783e22c2d5
4
+ data.tar.gz: 7aac126490bb8ca421dc5f61798f366b6c52072c6311a7883f6bb90d8a3ae981
5
5
  SHA512:
6
- metadata.gz: 1e2c32518e7350d17257038c70641ea98fd433f64df907a748041d431c80a938410d8e759c80b1509b1e004c3cd8533713fbd75f87c6786b2e48976732bd446f
7
- data.tar.gz: 8696a0052c045c72a6ebebd79773691269cff4f618f35374a455dc3f27526a1d126b9ac0c7f50c486d22ea7df03a78fc03988a836483bb87e9ba455aaea36fcd
6
+ metadata.gz: 6632ae0d3c78f6ad8bd316b0724bee3383ae86f98b5e759a06ec624982b1bb2625944b3cd833e00d740b380ad843cd7f957485a9908ca53040c8cf7aa954830f
7
+ data.tar.gz: a46c55a0a091804d82ebd19454321935629b139033deb57540519aad485580e8a649fec962f3c87540a00747ecf559add1ee721b915ece757337cb22ccdd713a
@@ -1,6 +1,6 @@
1
1
  class Blog::AuthorsController < Blog::MainController
2
2
  def show
3
- data = BlogpostParser.fetch_all.select { |b| b['published'] && !b['outdated'] }
3
+ data = BlogpostParser.fetch_all_published
4
4
  attributes = AuthorParser.fetch_author(params[:name]) || {}
5
5
 
6
6
  @author = Blog::Author.new(attributes).build_all_blogposts_from_author(data)
@@ -5,8 +5,7 @@ class Blog::BlogpostController < Blog::MainController
5
5
 
6
6
  def index
7
7
  # Fetch data as Json
8
- data = BlogpostParser.fetch_all
9
- .select { |b| b['published'] && !b['outdated'] }
8
+ data = BlogpostParser.fetch_all_published
10
9
 
11
10
  categories = CategoryParser.fetch_all_categories
12
11
 
@@ -21,9 +20,13 @@ class Blog::BlogpostController < Blog::MainController
21
20
  end
22
21
 
23
22
  def show
24
- data = BlogpostParser.fetch_all
25
23
  @blogpost = Blog::Blogpost.build_blogpost_from_path(params[:blog_path], 'en')
26
- @related_blogposts = data.select { |b| b['category']['slug'] == @blogpost.category.slug && b['title'] != @blogpost.title && b['published'] && !b['outdated'] }
24
+
25
+ redirect_to blog_path unless @blogpost.published
26
+
27
+ data = BlogpostParser.fetch_all_published
28
+
29
+ @related_blogposts = data.select { |b| b['category']['slug'] == @blogpost.category.slug && b['title'] != @blogpost.title }
27
30
  .first(RELATED_FOR_PREVIEW)
28
31
  .sort_by { |b| b['updated_at'] }.reverse
29
32
  .map { |attributes| Blog::Blogpost.new attributes }
@@ -1,6 +1,6 @@
1
1
  class Blog::CategoriesController < Blog::MainController
2
2
  def show
3
- data = BlogpostParser.fetch_all.select { |b| b['published'] && !b['outdated'] }
3
+ data = BlogpostParser.fetch_all_published
4
4
  attributes = CategoryParser.fetch_category(params[:slug])
5
5
 
6
6
  @category_with_all_blogposts = Blog::Category.new(attributes).build_n_blogposts_by_category(data)
@@ -1,7 +1,7 @@
1
1
  require 'json'
2
2
 
3
3
  class BlogpostParser
4
- PATH_TO_INDEX = "#{Rails.configuration.blog_path}/blogposts/blogposts_info.json".freeze
4
+ PATH_TO_INDEX = "#{ENV['BLOG_PATH']}/blogposts/blogposts_info.json".freeze
5
5
 
6
6
  def self.fetch_all
7
7
  # Add Rescue from error
@@ -10,6 +10,10 @@ class BlogpostParser
10
10
  JSON.parse(file)
11
11
  end
12
12
 
13
+ def self.fetch_all_published
14
+ fetch_all.select { |b| b['published'] && !b['outdated'] }
15
+ end
16
+
13
17
  def self.build
14
18
  all_blogposts = []
15
19
 
@@ -1 +1 @@
1
- {"files":{"manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js":{"logical_path":"manifest.js","mtime":"2022-08-08T13:31:12+00:00","size":2,"digest":"75a11da44c802486bc6f65640aa48a730f0f684c5c07a42ba3cd1735eb3fb070","integrity":"sha256-daEdpEyAJIa8b2VkCqSKcw8PaExcB6Qro80XNes/sHA="},"application-aa88b3c7bd34ec529f43849541752fda7c9c202aa9fff905be578ef88d103b46.js":{"logical_path":"application.js","mtime":"2022-08-08T13:31:12+00:00","size":3172,"digest":"67f1fd16f949c2794341a44cf839e5436bbef74436e043ead39890d1c3b2e583","integrity":"sha256-Z/H9FvlJwnlDQaRM+DnlQ2u+90Q24EPq05iQ0cOy5YM="},"application-087234db38816cd2bb2011c7f65f124e8dd2fbe5249064e4050cc32d06e396e0.css":{"logical_path":"application.css","mtime":"2022-08-08T13:31:12+00:00","size":17676,"digest":"b239d3b45545221415ff288efd8398a101263eba4fac7f869a12578f39be602f","integrity":"sha256-sjnTtFVFIhQV/yiO/YOYoQEmPrpPrH+GmhJXjzm+YC8="}},"assets":{"manifest.js":"manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js","application.js":"application-aa88b3c7bd34ec529f43849541752fda7c9c202aa9fff905be578ef88d103b46.js","application.css":"application-087234db38816cd2bb2011c7f65f124e8dd2fbe5249064e4050cc32d06e396e0.css"}}
1
+ {"files":{"manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js":{"logical_path":"manifest.js","mtime":"2022-08-11T09:08:56+00:00","size":2,"digest":"75a11da44c802486bc6f65640aa48a730f0f684c5c07a42ba3cd1735eb3fb070","integrity":"sha256-daEdpEyAJIa8b2VkCqSKcw8PaExcB6Qro80XNes/sHA="},"application-aa88b3c7bd34ec529f43849541752fda7c9c202aa9fff905be578ef88d103b46.js":{"logical_path":"application.js","mtime":"2022-08-11T09:08:56+00:00","size":3172,"digest":"67f1fd16f949c2794341a44cf839e5436bbef74436e043ead39890d1c3b2e583","integrity":"sha256-Z/H9FvlJwnlDQaRM+DnlQ2u+90Q24EPq05iQ0cOy5YM="},"application-087234db38816cd2bb2011c7f65f124e8dd2fbe5249064e4050cc32d06e396e0.css":{"logical_path":"application.css","mtime":"2022-08-11T09:08:56+00:00","size":17676,"digest":"b239d3b45545221415ff288efd8398a101263eba4fac7f869a12578f39be602f","integrity":"sha256-sjnTtFVFIhQV/yiO/YOYoQEmPrpPrH+GmhJXjzm+YC8="}},"assets":{"manifest.js":"manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js","application.js":"application-aa88b3c7bd34ec529f43849541752fda7c9c202aa9fff905be578ef88d103b46.js","application.css":"application-087234db38816cd2bb2011c7f65f124e8dd2fbe5249064e4050cc32d06e396e0.css"}}
@@ -1,3 +1,3 @@
1
1
  module NexmoDeveloper
2
- VERSION = '0.5.2'.freeze
2
+ VERSION = '0.5.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: station
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vonage DevRel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-08 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -731,7 +731,7 @@ files:
731
731
  - "./lib/nexmo_developer/public/android-chrome-512x512.png"
732
732
  - "./lib/nexmo_developer/public/apple-touch-icon-precomposed.png"
733
733
  - "./lib/nexmo_developer/public/apple-touch-icon.png"
734
- - "./lib/nexmo_developer/public/assets/.sprockets-manifest-5d3f7a9ff18fd3ee1e8a4029a376a371.json"
734
+ - "./lib/nexmo_developer/public/assets/.sprockets-manifest-49bd2246ba6a0f2c7f7789cc53eff3b5.json"
735
735
  - "./lib/nexmo_developer/public/assets/application-087234db38816cd2bb2011c7f65f124e8dd2fbe5249064e4050cc32d06e396e0.css"
736
736
  - "./lib/nexmo_developer/public/assets/application-087234db38816cd2bb2011c7f65f124e8dd2fbe5249064e4050cc32d06e396e0.css.gz"
737
737
  - "./lib/nexmo_developer/public/assets/application-aa88b3c7bd34ec529f43849541752fda7c9c202aa9fff905be578ef88d103b46.js"