toottown 0.2.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b52297c595a4a4bded83dc3361ab8157991eaaca4018bd338a4b9f993fc355e4
4
- data.tar.gz: cb72b3b0050c2874fa18bfc85e0d83e95f6aaf3f9e4298ab4717a55dc3024d0d
3
+ metadata.gz: c757499a2c00599e918180f088bad022e41644ada670d9e4d26390f170927cfe
4
+ data.tar.gz: bd5fd1d17094fba8ea8a1ff230474e5354f6b2fc711bc9e2cffb7483e359afba
5
5
  SHA512:
6
- metadata.gz: 2a3660b34c646c8e4ba0e319cd67217b7fef39da93d09ed272cf9ec3fa24b0a17fbd236b4b37aa9e50d415fee405ebcefa634522e130758bd1549e1ad2490bc7
7
- data.tar.gz: 3170775c36ecb9a7d4c1b07d44709847fdb4673524727b83d00079a065df6a3ed1d1090b1ba6ed7609ff1e20f69b015faeb825247e2a26155c09c9020a65d14d
6
+ metadata.gz: 15dbbe8108dbfd706911eec240d870a063c0d9544f7f5becb1a4ae39ccc4c4490bd8691bff92105c51eea54e18b59b47a17fbcaba904a5452bc9067651d0fea0
7
+ data.tar.gz: 383214d00ca9ebf05cbe7ae616be21bcfa36e4cbefb7d0ddc15ace590d09c0e1986025721d9b4eb0b3f8e35a462eddb77a2668178184b2306e6dfe8335efb90d
data/CHANGELOG.md CHANGED
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  - ...
11
11
 
12
+ ## [0.2.2] - 2026-10-14
13
+
14
+ - Clean up messy files, fix syntax bug
15
+
16
+ ## [0.2.1] - 2025-11-15
17
+
18
+ - Remove lazy `blank?` usage…Active Support free!
19
+
12
20
  ## [0.2.0] - 2025-10-07
13
21
 
14
22
  - Migrate project to Codeberg
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- toottown (0.2.0)
4
+ toottown (0.2.2)
5
5
  bridgetown (>= 2.0)
6
6
  phlex (~> 1.3)
7
7
  redis (~> 5.0)
data/bin/rake ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("rake", "rake")
@@ -2,6 +2,7 @@ require "phlex"
2
2
 
3
3
  module Toottown
4
4
  module Models
5
+ # TODO: replace with Streamlined
5
6
  class Comment < Phlex::HTML
6
7
  register_element :toottown_comment
7
8
  register_element :hgroup # FIXME in Phlex! See: https://github.com/joeldrapper/phlex/pull/477
@@ -8,6 +8,7 @@ module Toottown
8
8
  def initialize(instance_url:, access_token:)
9
9
  @instance_url, @access_token = instance_url, access_token
10
10
 
11
+ # TODO: switch to httpx
11
12
  @connection = Faraday.new(
12
13
  instance_url,
13
14
  request: { timeout: 5 },
@@ -26,7 +26,7 @@ module Toottown
26
26
  conn = Toottown::Models::MastodonConnection.new(instance_url: bridgetown_site.config.toottown.instance_url, access_token: bridgetown_site.config.toottown.access_token)
27
27
 
28
28
  r.on "comments" do
29
- next (response.status = 400; "Missing URL Parameter") if params[:url].blank?
29
+ next (response.status = 400; "Missing URL Parameter") unless params.key?(:url)
30
30
 
31
31
  url = limit_url.(params[:url])
32
32
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Toottown
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
data/lib/toottown.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bridgetown"
4
- require "toottown/builder"
5
4
 
6
5
  # @param config [Bridgetown::Configuration::ConfigurationDSL]
7
6
  Bridgetown.initializer :toottown do |
@@ -18,7 +17,7 @@ Bridgetown.initializer :toottown do |
18
17
  config.toottown.minutes_to_cache ||= minutes_to_cache
19
18
  config.toottown.comments_hashtag ||= comments_hashtag
20
19
 
21
- if instance_url.blank? || access_token.blank?
20
+ if instance_url.nil? || access_token.nil?
22
21
  Bridgetown.logger.warn "Toottown", "No instance URL or access token provided"
23
22
  else
24
23
  config.only :server do
@@ -32,7 +31,4 @@ Bridgetown.initializer :toottown do |
32
31
  require "toottown/routes"
33
32
  end
34
33
  end
35
-
36
- # Register your builder:
37
- config.builder Toottown::Builder
38
34
  end
data/package-lock.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "toottown",
3
+ "version": "0.2.2",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "toottown",
9
+ "version": "0.2.2",
10
+ "license": "MIT"
11
+ }
12
+ }
13
+ }
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toottown",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "main": "frontend/javascript/index.js",
5
5
  "repository": {
6
6
  "type": "git",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toottown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared White
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-07 00:00:00.000000000 Z
10
+ date: 2026-10-15 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bridgetown
@@ -121,26 +121,21 @@ files:
121
121
  - LICENSE.txt
122
122
  - README.md
123
123
  - Rakefile
124
- - bridgetown.automation.rb
125
- - components/toottown/layout_help.liquid
126
- - components/toottown/plugin_component.rb
127
- - content/toottown/example_page.md
128
- - content/toottown/train-on-rails.jpeg
129
- - layouts/toottown/layout.html
124
+ - bin/rake
130
125
  - lib/toottown.rb
131
- - lib/toottown/builder.rb
132
126
  - lib/toottown/models/comment.css
133
127
  - lib/toottown/models/comment.rb
134
128
  - lib/toottown/models/mastodon_connection.rb
135
129
  - lib/toottown/routes.rb
136
130
  - lib/toottown/version.rb
131
+ - package-lock.json
137
132
  - package.json
138
133
  - toottown.gemspec
139
134
  homepage: https://codeberg.org/jaredwhite/toottown
140
135
  licenses:
141
136
  - MIT
142
137
  metadata:
143
- npm_add: toottown@0.2.0
138
+ npm_add: toottown@0.2.2
144
139
  rdoc_options: []
145
140
  require_paths:
146
141
  - lib
@@ -1,51 +0,0 @@
1
- # If your plugin requires a lot of steps to get set up, consider writing an automation to help guide users.
2
- # You could set up and configure all sorts of things, for example:
3
- #
4
- # add_gem("my_plugin")
5
- #
6
- # add_yarn_for_gem("my_plugin")
7
- #
8
- # add_initializer :"my_plugin" do
9
- # <<~RUBY
10
- # do
11
- # some_config_key 12345
12
- # end
13
- # RUBY
14
- # end
15
- #
16
- # create_builder "my_nifty_builder.rb" do
17
- # <<~RUBY
18
- # class MyNeatBuilder < SiteBuilder
19
- # def build
20
- # puts MyPlugin.hello
21
- # end
22
- # end
23
- # RUBY
24
- # end
25
- #
26
- # javascript_import do
27
- # <<~JS
28
- # import { MyPlugin } from "my_plugin"
29
- # JS
30
- # end
31
- #
32
- # javascript_import 'import "my_plugin/frontend/styles/index.css"'
33
- #
34
- # create_file "src/_data/plugin_data.yml" do
35
- # <<~YAML
36
- # data:
37
- # goes: here
38
- # YAML
39
- # end
40
- #
41
- # color = ask("What's your favorite color?")
42
- #
43
- # append_to_file "bridgetown.config.yml" do
44
- # <<~YAML
45
- #
46
- # my_plugin:
47
- # favorite_color: #{color}
48
- # YAML
49
- # end
50
- #
51
- # Read the Automations documentation: https://www.bridgetownrb.com/docs/automations
@@ -1 +0,0 @@
1
- <p>Just use <code>layout: toottown/layout</code> in your page's front matter.</p>
@@ -1,17 +0,0 @@
1
- # rubocop:disable all
2
- module Toottown
3
- class PluginComponent < Bridgetown::Component
4
- def initialize(hi:)
5
- @hi = hi
6
- end
7
-
8
- # You can remove this and add an ERB, Serbea, etc. template file…or you can
9
- # use something like Phlex if you're feeling adventurous!
10
- def template
11
- <<~HTML
12
- Well hello there #{hi}!
13
- HTML
14
- end
15
- end
16
- end
17
- # rubocop:enable all
@@ -1,8 +0,0 @@
1
- ---
2
- layout: default
3
- title: Example Page
4
- ---
5
-
6
- If all goes well, this page will be accessible as [`{{ resource.data.relative_url }}`]({{ resource.data.relative_url }}), and you will see a photo of a train:
7
-
8
- ![Train on Rails]({{ "/toottown/train-on-rails.jpeg" | relative_url }})
Binary file
@@ -1,9 +0,0 @@
1
- ---
2
- layout: default
3
- ---
4
-
5
- <p>You can include this layout in your site! 🥳</p>
6
-
7
- {% render "toottown/layout_help" %}
8
-
9
- {{ content }}
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Toottown
4
- class Builder < Bridgetown::Builder
5
- def build
6
- liquid_tag "toottown" do
7
- "This plugin works!"
8
- end
9
- end
10
- end
11
- end