runway-ruby 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.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.tool-versions +1 -0
  3. data/LICENSE.txt +21 -0
  4. data/OPENAPI_VALIDATION.md +100 -0
  5. data/README.md +789 -0
  6. data/Rakefile +11 -0
  7. data/lib/runway_ml/character_performance.rb +106 -0
  8. data/lib/runway_ml/client.rb +84 -0
  9. data/lib/runway_ml/contract_validator.rb +151 -0
  10. data/lib/runway_ml/errors.rb +179 -0
  11. data/lib/runway_ml/image_processor.rb +128 -0
  12. data/lib/runway_ml/image_to_video.rb +158 -0
  13. data/lib/runway_ml/media_processor.rb +343 -0
  14. data/lib/runway_ml/openapi_spec_loader.rb +120 -0
  15. data/lib/runway_ml/organization.rb +89 -0
  16. data/lib/runway_ml/sound_effect.rb +57 -0
  17. data/lib/runway_ml/spec_coverage_analyzer.rb +134 -0
  18. data/lib/runway_ml/speech_to_speech.rb +90 -0
  19. data/lib/runway_ml/task.rb +116 -0
  20. data/lib/runway_ml/test_client.rb +62 -0
  21. data/lib/runway_ml/text_to_speech.rb +52 -0
  22. data/lib/runway_ml/text_to_video.rb +103 -0
  23. data/lib/runway_ml/uploads.rb +74 -0
  24. data/lib/runway_ml/validator_builder.rb +95 -0
  25. data/lib/runway_ml/validators/base_validators.rb +338 -0
  26. data/lib/runway_ml/validators/character_performance_validator.rb +41 -0
  27. data/lib/runway_ml/validators/gen3a_turbo_validator.rb +48 -0
  28. data/lib/runway_ml/validators/gen4_turbo_validator.rb +50 -0
  29. data/lib/runway_ml/validators/prompt_image_validator.rb +97 -0
  30. data/lib/runway_ml/validators/sound_effect_validator.rb +27 -0
  31. data/lib/runway_ml/validators/speech_to_speech_validator.rb +57 -0
  32. data/lib/runway_ml/validators/text_to_speech_validator.rb +28 -0
  33. data/lib/runway_ml/validators/text_veo3_stable_validator.rb +35 -0
  34. data/lib/runway_ml/validators/text_veo3_validator.rb +33 -0
  35. data/lib/runway_ml/validators/uploads_validator.rb +44 -0
  36. data/lib/runway_ml/validators/veo3_stable_validator.rb +43 -0
  37. data/lib/runway_ml/validators/veo3_validator.rb +46 -0
  38. data/lib/runway_ml/validators/voice_dubbing_validator.rb +128 -0
  39. data/lib/runway_ml/validators/voice_isolation_validator.rb +35 -0
  40. data/lib/runway_ml/validators/voice_validator.rb +32 -0
  41. data/lib/runway_ml/version.rb +5 -0
  42. data/lib/runway_ml/voice_dubbing.rb +74 -0
  43. data/lib/runway_ml/voice_isolation.rb +57 -0
  44. data/lib/runway_ml.rb +81 -0
  45. data/lib/tasks/openapi.rake +33 -0
  46. metadata +90 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f57e9cd74e026d83aad28ba433502d42acc3fbcb4b155101756962bbbcfaca28
4
+ data.tar.gz: 366ab1709fcc7f56f2f3d9c3e268e9d329c5516d20c276b247a07a53f144c1ff
5
+ SHA512:
6
+ metadata.gz: dda508c8d93f8e03090121c0e9cc3144677017083fbc58a4747a50463235acc6f05bd6092ecfd7820ed9b19a979a0722cbcb5b87e4ad004fdd63da52727b1398
7
+ data.tar.gz: 8f86994048cdddd58cecbc29e1821f18eaaa43fa62a6aa23b5fb7013ac854e0dbe41587032c381dbca2131491eba624530fe23429e6fc8a3de8dc4733f8f0aa0
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.3.5
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Oriol Gual
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,100 @@
1
+ # OpenAPI Contract Validation
2
+
3
+ This document describes how to validate the RunwayML Ruby SDK against the OpenAPI specification.
4
+
5
+ ## Quick Start
6
+
7
+ ### Check Spec Compliance
8
+
9
+ ```bash
10
+ bundle exec rake spec:coverage
11
+ ```
12
+
13
+ Shows which endpoints are defined in the spec and which SDK methods implement them.
14
+
15
+ ### Run Contract Tests
16
+
17
+ ```bash
18
+ bundle exec rake spec:validate
19
+ ```
20
+
21
+ Validates that SDK requests and responses conform to the OpenAPI spec.
22
+
23
+ ## Tools
24
+
25
+ ### OpenAPI Spec Loader
26
+
27
+ Fetches and caches the official OpenAPI spec from GitHub.
28
+
29
+ ```ruby
30
+ # Load the spec
31
+ spec = RunwayML::OpenAPISpecLoader.load_spec
32
+
33
+ # Force reload
34
+ spec = RunwayML::OpenAPISpecLoader.load_spec(force_reload: true)
35
+
36
+ # Get endpoint schemas
37
+ schema = RunwayML::OpenAPISpecLoader.get_request_schema("POST", "/v1/text_to_video")
38
+ schema = RunwayML::OpenAPISpecLoader.get_response_schema("POST", "/v1/text_to_video")
39
+ ```
40
+
41
+ ### Contract Validator
42
+
43
+ Validates requests and responses against OpenAPI schemas.
44
+
45
+ ```ruby
46
+ validator = RunwayML::ContractValidator.new
47
+
48
+ result = validator.validate_request("POST", "/v1/text_to_video", {
49
+ "promptText" => "A beautiful sunset",
50
+ "ratio" => "1280:720",
51
+ "duration" => 8,
52
+ "model" => "veo3.1"
53
+ })
54
+
55
+ puts result[:valid] ? "Valid" : "Invalid: #{result[:errors].join(', ')}"
56
+ ```
57
+
58
+ ### Spec Coverage Analyzer
59
+
60
+ Analyzes SDK completeness.
61
+
62
+ ```ruby
63
+ # Print human-readable report
64
+ RunwayML::SpecCoverageAnalyzer.print_coverage_report
65
+ ```
66
+
67
+ ## Critical Endpoints Monitored
68
+
69
+ | Endpoint | SDK Class | Method |
70
+ | ------------------------------ | -------------------- | -------- |
71
+ | POST /v1/text_to_video | TextToVideo | create |
72
+ | POST /v1/image_to_video | ImageToVideo | create |
73
+ | POST /v1/text_to_speech | TextToSpeech | create |
74
+ | POST /v1/speech_to_speech | SpeechToSpeech | create |
75
+ | POST /v1/sound_effect | SoundEffect | create |
76
+ | POST /v1/voice_isolation | VoiceIsolation | create |
77
+ | POST /v1/voice_dubbing | VoiceDubbing | create |
78
+ | POST /v1/character_performance | CharacterPerformance | create |
79
+ | POST /v1/video_to_video | VideoToVideo | create |
80
+ | POST /v1/text_to_image | TextToImage | create |
81
+ | GET /v1/tasks/{id} | Task | retrieve |
82
+ | DELETE /v1/tasks/{id} | Task | delete |
83
+ | GET /v1/organization | Organization | retrieve |
84
+ | POST /v1/uploads | Uploads | create |
85
+
86
+ ## Automatic Drift Detection
87
+
88
+ Three GitHub Actions workflows automatically monitor spec compliance:
89
+
90
+ - **spec-compliance.yml** - Daily check that SDK remains 100% compliant
91
+ - **spec-validation.yml** - Validates contracts on every PR
92
+ - **spec-update-alert.yml** - Weekly alert when upstream spec changes
93
+
94
+ See `.github/workflows/` for details.
95
+
96
+ ## References
97
+
98
+ - [RunwayML API Docs](https://docs.dev.runwayml.com)
99
+ - [OpenAPI Specification](https://spec.openapis.org/oas/v3.1.0)
100
+ - [RunwayML OpenAPI Spec](https://github.com/runwayml/openapi)