scalar_ruby 1.0.0 → 1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebbb3b25b5e211a1aba05134d5f54aee9117073edf95f14c55dadd34c26a5141
|
4
|
+
data.tar.gz: d7918de252e40550258ad63b169c9fd6b8be93531390d54950c98f1dd0ca7bc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6f20de57d3558a21630d3f8937ceb3d6863269189c77c75248b756868e2ab903dc6fdc30da9482c6a6e6db690e551b3e49b703ccbc5919bd1e6a3f7a2148472
|
7
|
+
data.tar.gz: 4f28e02faa358651f1aad4fc4f9908086f585d4bf2df05cf3081b13876a307173c91d795af7058755a54d0eb545a3a81c060c19889def3c158b04e3c76ae72b9
|
data/README.md
CHANGED
@@ -1,7 +1,18 @@
|
|
1
|
+
[](https://badge.fury.io/rb/scalar_ruby)
|
2
|
+
[](https://github.com/dmytroshevchuk/scalar_ruby/actions/workflows/check.yml)
|
3
|
+
|
1
4
|
# Scalar API Reference for Ruby
|
2
5
|
|
3
6
|
This gem simplifies the integration of [Scalar](https://scalar.com), a modern open-source developer experience platform for your APIs into Ruby applications.
|
4
7
|
|
8
|
+
## Requirements
|
9
|
+
|
10
|
+
This gem is tested and supported on the following Ruby versions:
|
11
|
+
|
12
|
+
- Ruby 3.0, 3.1, 3.2, 3.3
|
13
|
+
|
14
|
+
Other Ruby versions might work but are not officially supported.
|
15
|
+
|
5
16
|
## Installation
|
6
17
|
|
7
18
|
Add the gem to your application's Gemfile by executing in the terminal:
|
@@ -51,6 +62,14 @@ end
|
|
51
62
|
|
52
63
|
And that's it! More detailed information on other configuration options is in the section below.
|
53
64
|
|
65
|
+
## Integrations
|
66
|
+
|
67
|
+
You can use in-build generator to setup gem into [Ruby in Rails](https://rubyonrails.org) framework by running:
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
bin/rails generate scalar:install
|
71
|
+
```
|
72
|
+
|
54
73
|
## Configuration
|
55
74
|
|
56
75
|
Once mounted to your application, the library requires no further configuration. You can immediately start playing with the provided API reference example.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Scalar
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path('templates', __dir__)
|
7
|
+
|
8
|
+
desc 'Installs Scalar into a Rails app'
|
9
|
+
|
10
|
+
def introduction
|
11
|
+
say <<~INTRODUCTION
|
12
|
+
|
13
|
+
👋 Let's install Scalar into your Rails app!
|
14
|
+
|
15
|
+
INTRODUCTION
|
16
|
+
end
|
17
|
+
|
18
|
+
def update_routes
|
19
|
+
insert_into_file Rails.root.join('config/routes.rb'), after: 'Rails.application.routes.draw do' do
|
20
|
+
"\n mount Scalar::UI, at: \"/docs\""
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_initializer
|
25
|
+
template 'initializer.rb', 'config/initializers/scalar.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
def farewell
|
29
|
+
say <<~FAREWELL
|
30
|
+
|
31
|
+
We're done! Your can run "/docs" to observe a scalar API platform
|
32
|
+
|
33
|
+
FAREWELL
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Scalar.setup do |config|
|
4
|
+
# Specify the specific version of the Scalar. By default it uses the latest one
|
5
|
+
#
|
6
|
+
# config.library_url = "https://cdn.jsdelivr.net/npm/@scalar/api-reference"
|
7
|
+
|
8
|
+
# Add custom page title displayed in the browser tab
|
9
|
+
#
|
10
|
+
# config.page_title = "API Reference"
|
11
|
+
|
12
|
+
# Pass your API specification. It may be URL or file content in OpenAPI format
|
13
|
+
#
|
14
|
+
# config.specification = File.read(Rails.root.join("docs/openapi.yml"))
|
15
|
+
|
16
|
+
# Additional Scalar configuration (e.g. theme) can be set here
|
17
|
+
#
|
18
|
+
# config.scalar_configuration = {
|
19
|
+
# theme: "purple"
|
20
|
+
# }
|
21
|
+
end
|
data/lib/scalar/version.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scalar_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmytro Shevchuk
|
8
8
|
- Serhii Ponomarov
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
|
-
description:
|
15
13
|
email:
|
16
14
|
- dmytro@hey.com
|
17
15
|
- sergii.ponomarov@gmail.com
|
@@ -21,6 +19,9 @@ extra_rdoc_files: []
|
|
21
19
|
files:
|
22
20
|
- README.md
|
23
21
|
- Rakefile
|
22
|
+
- lib/generators/scalar/install/USAGE
|
23
|
+
- lib/generators/scalar/install/install_generator.rb
|
24
|
+
- lib/generators/scalar/install/templates/initializer.rb
|
24
25
|
- lib/scalar/config.rb
|
25
26
|
- lib/scalar/template.erb
|
26
27
|
- lib/scalar/ui.rb
|
@@ -33,7 +34,6 @@ metadata:
|
|
33
34
|
homepage_uri: https://github.com/dmytroshevchuk/scalar_ruby
|
34
35
|
rubygems_mfa_required: 'true'
|
35
36
|
source_code_uri: https://github.com/dmytroshevchuk/scalar_ruby
|
36
|
-
post_install_message:
|
37
37
|
rdoc_options: []
|
38
38
|
require_paths:
|
39
39
|
- lib
|
@@ -41,15 +41,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
41
41
|
requirements:
|
42
42
|
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
44
|
+
version: '3.0'
|
45
45
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
requirements: []
|
51
|
-
rubygems_version: 3.
|
52
|
-
signing_key:
|
51
|
+
rubygems_version: 3.6.3
|
53
52
|
specification_version: 4
|
54
53
|
summary: A gem to automate using Scalar with Ruby apps
|
55
54
|
test_files: []
|