dry-swagger 0.6.3 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/dry/swagger.rb +1 -1
- data/lib/dry/swagger/railtie.rb +2 -3
- data/lib/dry/swagger/tasks/configuration_generator.rake +2 -0
- data/lib/dry/swagger/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adbe04dff5b7ae5c94a9ba23ed3121d347c7c2f1c5281c072e6f87db6b61cabb
|
4
|
+
data.tar.gz: d63a26c6c630a180df171227d3e33689d13bdcdfacb21472dd0a7858dd3e262c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d32e5435aa3d0b6f43953af069ed8451af40771ed634246290cc065c7aa1d21251e17553f165627f8f4d3784373433a7df600396e3fc818bc8eed653cb75542b
|
7
|
+
data.tar.gz: d9739bfbdd72a98fab3022cde18c4a81b875702247feb85590a56ac6e39b3bd2f1c0b12cc7111a96bc51f7e1d0b15257a6552cc2a11f0302e97438444c9b9042
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -312,7 +312,7 @@ You can also modify the fields by passing a block after the .call() method.
|
|
312
312
|
|
313
313
|
end.to_swagger()
|
314
314
|
|
315
|
-
##Custom Configuration For Your Project
|
315
|
+
## Custom Configuration For Your Project
|
316
316
|
You can override default configurations by changing the values in the `config/initializers/dry-swagger.rb` file generated from the rake command in the Installation section.
|
317
317
|
|
318
318
|
To modify the descriptions for the Contracts, modify the values in `config/locale/dry-swagger.yml`.
|
data/lib/dry/swagger.rb
CHANGED
@@ -12,6 +12,6 @@ require 'dry/swagger/railtie' if defined?(Rails)
|
|
12
12
|
|
13
13
|
module Dry
|
14
14
|
module Swagger
|
15
|
-
::I18n.load_path << Dir[File.expand_path("config/locales") + "/*.yml"]
|
15
|
+
::I18n.load_path << Dir[File.expand_path("config/locales") + "/*.yml"] unless defined?(Rails)
|
16
16
|
end
|
17
17
|
end
|
data/lib/dry/swagger/railtie.rb
CHANGED
@@ -4,11 +4,10 @@ require 'rails'
|
|
4
4
|
module Dry
|
5
5
|
module Swagger
|
6
6
|
class Railtie < Rails::Railtie
|
7
|
-
railtie_name :dry-swagger
|
7
|
+
railtie_name :"dry-swagger"
|
8
8
|
|
9
9
|
rake_tasks do
|
10
|
-
|
11
|
-
Dir.glob("#{path}/tasks/**/*.rake").each { |f| load f }
|
10
|
+
load "dry/swagger/tasks/configuration_generator.rake"
|
12
11
|
end
|
13
12
|
end
|
14
13
|
end
|
@@ -4,6 +4,7 @@ namespace 'dry-swagger' do
|
|
4
4
|
desc 'Create a configuration file for Struct and Contract'
|
5
5
|
task :create_configuration_file do
|
6
6
|
FileUtils.mkdir_p "#{ Dir.pwd }/config/initializers/"
|
7
|
+
puts "Created #{ Dir.pwd }/config/initializers/dry-swagger.rb"
|
7
8
|
File.open("#{ Dir.pwd }/config/initializers/dry-swagger.rb", "w") { |file|
|
8
9
|
file.puts 'Dry::Swagger::Config::StructConfiguration.configuration do |config|
|
9
10
|
config.enable_required_validation = true
|
@@ -26,6 +27,7 @@ end'
|
|
26
27
|
desc 'Create a YAML file for Contract swagger field descriptions'
|
27
28
|
task :create_contract_descriptions_yaml do
|
28
29
|
FileUtils.mkdir_p "#{ Dir.pwd }/config/locales/"
|
30
|
+
puts "Created #{ Dir.pwd }/config/locales/dry-swagger.yml"
|
29
31
|
File.open("#{ Dir.pwd }/config/locales/dry-swagger.yml", "w") { |file|
|
30
32
|
file.puts 'en:
|
31
33
|
contract:
|
data/lib/dry/swagger/version.rb
CHANGED