faceless_reels 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 89701ebc0b2011d0784fb5fd85411a65cb705290f82262ed65b29de24b6ff8a3
4
+ data.tar.gz: 664a630d9e02e52933b32dc000038c82cd6c5c70beeb5269893aaed9994e0f0a
5
+ SHA512:
6
+ metadata.gz: 22b389db1499d1b64ac2a3f3dba34b29bf489c5ee066d9e33dee62d5467665c06d40734478dec199e960a5658e5aa8e922482d30f75deb22fd831be1136da5bf
7
+ data.tar.gz: 269ec2a39d2c0e9eb6ae60dc17c5f0567a74dd1cddd25f3cf2d789e673064fb733e9322a340f7c57b79596360e2c1dd81ecf66c8a95738e08c38c4cc88138741
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Allen328
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # Faceless Reels Ruby
2
+
3
+ `faceless_reels` is a small Ruby client for the public endpoints exposed by
4
+ [Faceless Reels](https://faceless-reels.io), an AI-assisted workflow for
5
+ creating narrated vertical videos.
6
+
7
+ The gem currently supports service health checks and public showcase-video
8
+ URLs. It does not call private project APIs or submit video-generation jobs.
9
+
10
+ ## Installation
11
+
12
+ Install the gem directly:
13
+
14
+ ```shell
15
+ gem install faceless_reels
16
+ ```
17
+
18
+ Or add it to your Gemfile:
19
+
20
+ ```ruby
21
+ gem "faceless_reels"
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```ruby
27
+ require "faceless_reels"
28
+
29
+ client = FacelessReels::Client.new
30
+
31
+ client.ping
32
+ # => {"message"=>"pong"}
33
+
34
+ FacelessReels.homepage
35
+ # => "https://faceless-reels.io"
36
+
37
+ FacelessReels.showcase_video_url("shackleton")
38
+ # => "https://faceless-reels.io/api/public/showcase-videos/shackleton"
39
+ ```
40
+
41
+ To convert service failures into a boolean health signal:
42
+
43
+ ```ruby
44
+ client.available?
45
+ # => true or false
46
+ ```
47
+
48
+ ## Development
49
+
50
+ Run the tests:
51
+
52
+ ```shell
53
+ bundle install
54
+ bundle exec rake test
55
+ ```
56
+
57
+ Build the gem:
58
+
59
+ ```shell
60
+ gem build faceless_reels.gemspec
61
+ ```
62
+
63
+ ## Links
64
+
65
+ - Website: <https://faceless-reels.io>
66
+ - Examples: <https://faceless-reels.io/examples>
67
+ - Source: <https://github.com/allen207/faceless-reels-ruby>
68
+ - RubyGems: <https://rubygems.org/gems/faceless_reels>
69
+
70
+ ## License
71
+
72
+ The Ruby client in this repository is available under the MIT License.
73
+
@@ -0,0 +1,54 @@
1
+ require "json"
2
+ require "net/http"
3
+ require "uri"
4
+
5
+ module FacelessReels
6
+ class Client
7
+ SHOWCASE_ID_PATTERN = /\A[a-z0-9]+(?:-[a-z0-9]+)*\z/.freeze
8
+
9
+ def initialize(base_url: HOMEPAGE, http_get: nil)
10
+ @base_url = normalize_base_url(base_url)
11
+ @http_get = http_get || lambda { |uri| Net::HTTP.get_response(uri) }
12
+ end
13
+
14
+ def ping
15
+ response = @http_get.call(URI("#{@base_url}/api/ping"))
16
+ raise HTTPError, response.code unless success?(response)
17
+
18
+ JSON.parse(response.body)
19
+ rescue JSON::ParserError => error
20
+ raise Error, "Faceless Reels returned invalid JSON: #{error.message}"
21
+ end
22
+
23
+ def available?
24
+ ping.fetch("message", nil) == "pong"
25
+ rescue Error, SystemCallError, Timeout::Error
26
+ false
27
+ end
28
+
29
+ def showcase_video_url(showcase_id)
30
+ id = showcase_id.to_s
31
+ unless SHOWCASE_ID_PATTERN.match?(id)
32
+ raise ArgumentError, "Invalid showcase ID"
33
+ end
34
+
35
+ "#{@base_url}/api/public/showcase-videos/#{id}"
36
+ end
37
+
38
+ private
39
+
40
+ def normalize_base_url(base_url)
41
+ uri = URI(base_url.to_s)
42
+ unless %w[http https].include?(uri.scheme) && uri.host
43
+ raise ArgumentError, "base_url must be an HTTP or HTTPS URL"
44
+ end
45
+
46
+ base_url.to_s.sub(%r{/+\z}, "")
47
+ end
48
+
49
+ def success?(response)
50
+ response.code.to_i.between?(200, 299)
51
+ end
52
+ end
53
+ end
54
+
@@ -0,0 +1,4 @@
1
+ module FacelessReels
2
+ VERSION = "0.1.0".freeze
3
+ end
4
+
@@ -0,0 +1,35 @@
1
+ require_relative "faceless_reels/version"
2
+
3
+ module FacelessReels
4
+ HOMEPAGE = "https://faceless-reels.io".freeze
5
+ SUMMARY =
6
+ "Turn story ideas into narrated vertical videos with Faceless Reels.".freeze
7
+
8
+ class Error < StandardError; end
9
+
10
+ class HTTPError < Error
11
+ attr_reader :status
12
+
13
+ def initialize(status)
14
+ @status = status.to_i
15
+ super("Faceless Reels returned HTTP #{@status}")
16
+ end
17
+ end
18
+ end
19
+
20
+ require_relative "faceless_reels/client"
21
+
22
+ module FacelessReels
23
+ def self.homepage
24
+ HOMEPAGE
25
+ end
26
+
27
+ def self.summary
28
+ SUMMARY
29
+ end
30
+
31
+ def self.showcase_video_url(showcase_id)
32
+ Client.new.showcase_video_url(showcase_id)
33
+ end
34
+ end
35
+
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: faceless_reels
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Allen328
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: A small Ruby client for checking Faceless Reels availability and building
13
+ URLs for its public showcase videos.
14
+ email:
15
+ - support@faceless-reels.io
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE
21
+ - README.md
22
+ - lib/faceless_reels.rb
23
+ - lib/faceless_reels/client.rb
24
+ - lib/faceless_reels/version.rb
25
+ homepage: https://faceless-reels.io
26
+ licenses:
27
+ - MIT
28
+ metadata:
29
+ allowed_push_host: https://rubygems.org
30
+ homepage_uri: https://faceless-reels.io
31
+ source_code_uri: https://github.com/allen207/faceless-reels-ruby
32
+ documentation_uri: https://www.rubydoc.info/gems/faceless_reels
33
+ rubygems_mfa_required: 'true'
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 2.6.0
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubygems_version: 3.6.9
49
+ specification_version: 4
50
+ summary: Ruby client for Faceless Reels public endpoints.
51
+ test_files: []