rswag3-ui 0.0.0 → 0.0.1

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
  SHA1:
3
- metadata.gz: 3f00482a51dea35f4f55613996d797b9332709e7
4
- data.tar.gz: 4fa6d7270507d0709ca2203daa2a0d32dbe46503
3
+ metadata.gz: b0673a21254dd37da41e524d190d2b679a1ccfb3
4
+ data.tar.gz: 7b8efbad2bf8e07db3b0781bbdb6b8013de0cfb4
5
5
  SHA512:
6
- metadata.gz: fd67888f96a16f176743747fdbd74a204f5c968c86ca8372eae90653469f8907234dd3732e439c0f12fe248fd3f21583287e436e33808893cde1b7f9c423e53b
7
- data.tar.gz: 1b3a79b2557788047017b69b84dec54c1320058595a1c3ae10f6653e43c96c898cb3a2e3c126f33259074470b27b8761b5c7fe5689f1c1eca97f3d3304fa3189
6
+ metadata.gz: a8f16305e29c946b28e73db2f021e78f438537231b0d6860c980d5966c18b709cc3bb6b3f069a4fec5bf9804fd31fb2144ca616d80d827c514faa12f1e1875fe
7
+ data.tar.gz: 5ff554151ab0980c0e301e0dc5cb327bafac9d2b4806b6fe00da0dc3f08138abd3328af3de5e15eb69e73d38d524406da81dd0c316cd83624a374096c374ca13
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2015 domaindrivendev
1
+ Copyright 2019 Je33
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ end
14
14
 
15
15
  RDoc::Task.new(:rdoc) do |rdoc|
16
16
  rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = 'rswag-specs'
17
+ rdoc.title = 'rswag3-specs'
18
18
  rdoc.options << '--line-numbers'
19
19
  rdoc.rdoc_files.include('README.rdoc')
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
@@ -2,7 +2,7 @@ Description:
2
2
  Adds a local version of index.html.erb for customizing the swagger-ui
3
3
 
4
4
  Example:
5
- rails generate rswag:ui:custom
5
+ rails generate rswag3:ui:custom
6
6
 
7
7
  This will create:
8
- app/views/rswag/ui/home/index.html.erb
8
+ app/views/rswag3/ui/home/index.html.erb
@@ -0,0 +1,13 @@
1
+ require 'rails/generators'
2
+
3
+ module Rswag3
4
+ module Ui
5
+ class CustomGenerator < Rails::Generators::Base
6
+ source_root File.expand_path('../../../../../../lib/rswag3/ui', __FILE__)
7
+
8
+ def add_custom_index
9
+ copy_file('index.erb', 'app/views/rswag3/ui/home/index.html.erb')
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Adds rswag3-api initializer for configuration
3
+
4
+ Example:
5
+ rails generate rswag3:api:install
6
+
7
+ This will create:
8
+ config/initializers/rswag3-api.rb
@@ -1,17 +1,17 @@
1
1
  require 'rails/generators'
2
2
 
3
- module Rswag
3
+ module Rswag3
4
4
  module Ui
5
5
 
6
6
  class InstallGenerator < Rails::Generators::Base
7
7
  source_root File.expand_path('../templates', __FILE__)
8
8
 
9
9
  def add_initializer
10
- template('rswag-ui.rb', 'config/initializers/rswag-ui.rb')
10
+ template('rswag3-ui.rb', 'config/initializers/rswag3-ui.rb')
11
11
  end
12
12
 
13
13
  def add_routes
14
- route("mount Rswag::Ui::Engine => '/api-docs'")
14
+ route("mount Rswag3::Ui::Engine => '/api-docs'")
15
15
  end
16
16
  end
17
17
  end
@@ -1,7 +1,7 @@
1
- require 'rswag/ui/configuration'
2
- require 'rswag/ui/engine'
1
+ require 'rswag3/ui/configuration'
2
+ require 'rswag3/ui/engine'
3
3
 
4
- module Rswag
4
+ module Rswag3
5
5
  module Ui
6
6
  def self.configure
7
7
  yield(config)
@@ -1,6 +1,6 @@
1
1
  require 'ostruct'
2
2
 
3
- module Rswag
3
+ module Rswag3
4
4
  module Ui
5
5
  class Configuration
6
6
  attr_reader :template_locations
@@ -13,7 +13,7 @@ module Rswag
13
13
  # preffered override location
14
14
  "#{Rack::Directory.new('').root}/swagger/index.erb",
15
15
  # backwards compatible override location
16
- "#{Rack::Directory.new('').root}/app/views/rswag/ui/home/index.html.erb",
16
+ "#{Rack::Directory.new('').root}/app/views/rswag3/ui/home/index.html.erb",
17
17
  # default location
18
18
  File.expand_path('../index.erb', __FILE__)
19
19
  ]
@@ -0,0 +1,17 @@
1
+ require 'rswag3/ui/middleware'
2
+
3
+ module Rswag3
4
+ module Ui
5
+ class Engine < ::Rails::Engine
6
+ isolate_namespace Rswag3::Ui
7
+
8
+ initializer 'rswag3-ui.initialize' do |app|
9
+ middleware.use Rswag3::Ui::Middleware, Rswag3::Ui.config
10
+ end
11
+
12
+ rake_tasks do
13
+ load File.expand_path('../../../tasks/rswag3-ui_tasks.rake', __FILE__)
14
+ end
15
+ end
16
+ end
17
+ end
File without changes
@@ -1,4 +1,4 @@
1
- module Rswag
1
+ module Rswag3
2
2
  module Ui
3
3
  class Middleware < Rack::Static
4
4
 
@@ -1,4 +1,4 @@
1
- namespace :rswag do
1
+ namespace :rswag3 do
2
2
  namespace :ui do
3
3
 
4
4
  desc 'TODO'
@@ -6,7 +6,7 @@ namespace :rswag do
6
6
  dest = args[:dest]
7
7
  FileUtils.rm_r(dest, force: true)
8
8
  FileUtils.mkdir_p(dest)
9
- FileUtils.cp_r(Dir.glob("#{Rswag::Ui.config.assets_root}/{*.js,*.png,*.css}"), dest)
9
+ FileUtils.cp_r(Dir.glob("#{Rswag3::Ui.config.assets_root}/{*.js,*.png,*.css}"), dest)
10
10
  end
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rswag3-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Koltsov
@@ -60,17 +60,17 @@ extra_rdoc_files: []
60
60
  files:
61
61
  - MIT-LICENSE
62
62
  - Rakefile
63
- - lib/generators/rswag/ui/custom/USAGE
64
- - lib/generators/rswag/ui/custom/custom_generator.rb
65
- - lib/generators/rswag/ui/install/USAGE
66
- - lib/generators/rswag/ui/install/install_generator.rb
67
- - lib/generators/rswag/ui/install/templates/rswag-ui.rb
68
- - lib/rswag/ui.rb
69
- - lib/rswag/ui/configuration.rb
70
- - lib/rswag/ui/engine.rb
71
- - lib/rswag/ui/index.erb
72
- - lib/rswag/ui/middleware.rb
73
- - lib/tasks/rswag-ui_tasks.rake
63
+ - lib/generators/rswag3/ui/custom/USAGE
64
+ - lib/generators/rswag3/ui/custom/custom_generator.rb
65
+ - lib/generators/rswag3/ui/install/USAGE
66
+ - lib/generators/rswag3/ui/install/install_generator.rb
67
+ - lib/generators/rswag3/ui/install/templates/rswag-ui.rb
68
+ - lib/rswag3/ui.rb
69
+ - lib/rswag3/ui/configuration.rb
70
+ - lib/rswag3/ui/engine.rb
71
+ - lib/rswag3/ui/index.erb
72
+ - lib/rswag3/ui/middleware.rb
73
+ - lib/tasks/rswag3-ui_tasks.rake
74
74
  - node_modules/swagger-ui-dist/README.md
75
75
  - node_modules/swagger-ui-dist/absolute-path.js
76
76
  - node_modules/swagger-ui-dist/favicon-16x16.png
@@ -1,13 +0,0 @@
1
- require 'rails/generators'
2
-
3
- module Rswag
4
- module Ui
5
- class CustomGenerator < Rails::Generators::Base
6
- source_root File.expand_path('../../../../../../lib/rswag/ui', __FILE__)
7
-
8
- def add_custom_index
9
- copy_file('index.erb', 'app/views/rswag/ui/home/index.html.erb')
10
- end
11
- end
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- Description:
2
- Adds rswag-api initializer for configuration
3
-
4
- Example:
5
- rails generate rswag:api:install
6
-
7
- This will create:
8
- config/initializers/rswag-api.rb
@@ -1,17 +0,0 @@
1
- require 'rswag/ui/middleware'
2
-
3
- module Rswag
4
- module Ui
5
- class Engine < ::Rails::Engine
6
- isolate_namespace Rswag::Ui
7
-
8
- initializer 'rswag-ui.initialize' do |app|
9
- middleware.use Rswag::Ui::Middleware, Rswag::Ui.config
10
- end
11
-
12
- rake_tasks do
13
- load File.expand_path('../../../tasks/rswag-ui_tasks.rake', __FILE__)
14
- end
15
- end
16
- end
17
- end