webring-rails 1.6.0 → 1.7.0

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: 82bc3c0e725233f97c81c7f5d93300155cf4a926618b9f0cfc0b34728411ce90
4
- data.tar.gz: 81704a8acd70cf5f060f6208eed0512ace47504e28ddf4071caee9d04e7f4589
3
+ metadata.gz: 85a5b42e96746928c014435c11237eace0ad0219f0dda1ef94c682d4659ff821
4
+ data.tar.gz: 5cae67399d29d43add826956e4f061bf646364c25bfa02c94ea2c4b82ac74d16
5
5
  SHA512:
6
- metadata.gz: b83576e412c50d3e060bdfc056d2695da79f576aae7c398d85e4a0a8efe77c68d3dd57bdcef5cdbb5c1654dc7e7331f4894817cf05b0c6c853060bd36fcab269
7
- data.tar.gz: 1a717972d57d3361d51d6f250b1ada90ea38d7d5142dba6bbf573ab6fd57a39d9f5431dd835f2ede7be9969f166805f1fd8d1541620254e2e4eaffa6c2cb96ba
6
+ metadata.gz: a83df3a9470ec0612cdf66b649fb500e3167a191b709455792fa98c88b68711233f906263dc6e345cd86d042219b79b90a24cd4be96a061887d0f2a8d210a2e2
7
+ data.tar.gz: 563281f534ced604e59d885771c9ca828a42c416b23b6aa4809ff1bdba1b3a40a7bb329808a7bbe707834923785b078ce85696922581ac9ec6aed42fd83aac6c
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Webring for Rails
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/webring-rails.svg)](https://badge.fury.io/rb/webring-rails)
6
+
5
7
  [Webring for Rails (webring-rails)](https://github.com/cybergizer-hq/webring-rails) is a flexible engine for creating and managing a webring system in your Ruby on Rails application. A webring is a collection of websites linked together in a circular structure, allowing visitors to navigate from one site to another.
6
8
 
7
9
  ## Features
@@ -69,7 +69,7 @@ module Webring
69
69
  end
70
70
 
71
71
  def member_params
72
- params.require(:member).permit(:name, :url, :description, :status)
72
+ params.require(:member).permit(:name, :url, :owner_email, :description, :status)
73
73
  end
74
74
  end
75
75
  end
@@ -1,5 +1,7 @@
1
1
  module Webring
2
2
  class NavigationController < ApplicationController
3
+ before_action :set_cors_headers
4
+
3
5
  before_action :find_member, only: %i[next previous]
4
6
  before_action :ensure_members_exist, :check_member_exists, only: [:random]
5
7
 
@@ -3,7 +3,6 @@ module Webring
3
3
  # Disable CSRF protection for widget.js as it needs to be loaded from other domains
4
4
  skip_forgery_protection
5
5
 
6
- # Set CORS headers for the widget
7
6
  before_action :set_cors_headers
8
7
 
9
8
  # Serve the webring navigation widget JavaScript
@@ -28,13 +27,6 @@ module Webring
28
27
 
29
28
  private
30
29
 
31
- def set_cors_headers
32
- response.headers['Access-Control-Allow-Origin'] = '*'
33
- response.headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'
34
- response.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept'
35
- response.headers['Access-Control-Max-Age'] = '86400'
36
- end
37
-
38
30
  # This function is used to generate the logo SVG function for the compiled widget.js file to overcome args names compression issue
39
31
  def logo_svg_function
40
32
  <<~JS
@@ -57,5 +49,12 @@ module Webring
57
49
  widgetTitle: { default: 'Webring', enforced: false }
58
50
  }
59
51
  end
52
+
53
+ def set_cors_headers
54
+ response.headers['Access-Control-Allow-Origin'] = '*'
55
+ response.headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'
56
+ response.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept'
57
+ response.headers['Access-Control-Max-Age'] = '86400'
58
+ end
60
59
  end
61
60
  end
@@ -11,6 +11,7 @@ module Webring
11
11
  Webring::Member.create!(
12
12
  name: name,
13
13
  url: url,
14
+ owner_email: callback_email,
14
15
  description: description,
15
16
  webring_membership_request_id: id
16
17
  )
@@ -4,7 +4,8 @@ class CreateWebringMembers < ActiveRecord::Migration<%= "[#{Rails::VERSION::MAJO
4
4
  t.string :uid, null: false, limit: 32
5
5
  t.string :name, null: false
6
6
  t.string :url, null: false
7
- t.text :description, null: false
7
+ t.string :owner_email
8
+ t.text :description
8
9
  t.integer :status, null: false, default: 0
9
10
 
10
11
  t.index :uid, unique: true
@@ -1,5 +1,7 @@
1
1
  module Webring
2
2
  class NavigationController < ApplicationController
3
+ before_action :set_cors_headers
4
+
3
5
  before_action :find_member, only: %i[next previous]
4
6
  before_action :ensure_members_exist, :check_member_exists, only: [:random]
5
7
 
@@ -1,3 +1,3 @@
1
1
  module Webring
2
- VERSION = '1.6.0'.freeze
2
+ VERSION = '1.7.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webring-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikita Shkoda