shaf 1.6.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/iana_link_relations.csv.gz +0 -0
- data/lib/shaf/alps/attribute_serializer.rb +41 -0
- data/lib/shaf/alps/json_serializer.rb +50 -0
- data/lib/shaf/alps/relation_serializer.rb +70 -0
- data/lib/shaf/app.rb +32 -7
- data/lib/shaf/authenticator/base.rb +161 -0
- data/lib/shaf/authenticator/basic_auth.rb +25 -0
- data/lib/shaf/authenticator/challenge.rb +32 -0
- data/lib/shaf/authenticator/parameter.rb +31 -0
- data/lib/shaf/authenticator/request.rb +17 -0
- data/lib/shaf/authenticator.rb +56 -0
- data/lib/shaf/command/base.rb +4 -0
- data/lib/shaf/command/console.rb +1 -1
- data/lib/shaf/command/generate.rb +5 -2
- data/lib/shaf/command/new.rb +24 -7
- data/lib/shaf/command/server.rb +5 -1
- data/lib/shaf/command/templates/Gemfile.erb +1 -0
- data/{templates/config/settings.yml → lib/shaf/command/templates/config/settings.yml.erb} +9 -12
- data/lib/shaf/errors.rb +11 -0
- data/lib/shaf/extensions/api_routes.rb +60 -0
- data/lib/shaf/extensions/authorize.rb +11 -9
- data/lib/shaf/extensions/log.rb +1 -1
- data/lib/shaf/extensions/resource_uris.rb +95 -137
- data/lib/shaf/extensions/symbolic_routes.rb +9 -19
- data/lib/shaf/extensions.rb +3 -3
- data/lib/shaf/formable/builder.rb +58 -19
- data/lib/shaf/formable/form.rb +14 -11
- data/lib/shaf/formable.rb +10 -24
- data/lib/shaf/generator/base.rb +84 -3
- data/lib/shaf/generator/controller.rb +30 -42
- data/lib/shaf/generator/doc.rb +17 -0
- data/lib/shaf/generator/forms.rb +11 -14
- data/lib/shaf/generator/helper.rb +2 -1
- data/lib/shaf/generator/migration/add_column.rb +0 -4
- data/lib/shaf/generator/migration/add_index.rb +0 -4
- data/lib/shaf/generator/migration/base.rb +15 -3
- data/lib/shaf/generator/migration/create_table.rb +0 -4
- data/lib/shaf/generator/migration/drop_column.rb +0 -4
- data/lib/shaf/generator/migration/rename_column.rb +0 -4
- data/lib/shaf/generator/migration/type.rb +4 -26
- data/lib/shaf/generator/migration/types.rb +45 -16
- data/lib/shaf/generator/model.rb +29 -15
- data/lib/shaf/generator/policy.rb +8 -14
- data/lib/shaf/generator/profile.rb +47 -0
- data/lib/shaf/generator/scaffold.rb +6 -9
- data/lib/shaf/generator/serializer.rb +64 -98
- data/lib/shaf/generator/templates/api/controller.rb.erb +13 -13
- data/lib/shaf/generator/templates/api/forms.rb.erb +2 -2
- data/lib/shaf/generator/templates/api/model.rb.erb +1 -1
- data/lib/shaf/generator/templates/api/policy.rb.erb +2 -2
- data/lib/shaf/generator/templates/api/profile.rb.erb +16 -0
- data/lib/shaf/generator/templates/api/serializer.rb.erb +3 -3
- data/lib/shaf/generator/templates/spec/integration_spec.rb.erb +15 -16
- data/lib/shaf/generator/templates/spec/serializer_spec.rb.erb +5 -5
- data/lib/shaf/generator.rb +2 -0
- data/lib/shaf/helpers/authentication.rb +79 -0
- data/lib/shaf/helpers/paginate.rb +1 -1
- data/lib/shaf/helpers/payload.rb +14 -34
- data/lib/shaf/helpers/vary.rb +8 -0
- data/lib/shaf/helpers.rb +4 -0
- data/lib/shaf/logger.rb +12 -0
- data/lib/shaf/parser/base.rb +44 -0
- data/lib/shaf/parser/form_data.rb +15 -0
- data/lib/shaf/parser/json.rb +26 -0
- data/lib/shaf/parser.rb +65 -0
- data/lib/shaf/profile/attribute.rb +29 -0
- data/lib/shaf/profile/evaluator.rb +46 -0
- data/lib/shaf/profile/relation.rb +29 -0
- data/lib/shaf/profile/unique_id.rb +58 -0
- data/lib/shaf/profile.rb +115 -0
- data/lib/shaf/profiles/shaf_basic.rb +20 -0
- data/lib/shaf/profiles/shaf_error.rb +49 -0
- data/lib/shaf/profiles/shaf_form.rb +110 -0
- data/lib/shaf/profiles.rb +46 -0
- data/lib/shaf/registrable_factory.rb +62 -32
- data/lib/shaf/responder/alps_json.rb +25 -0
- data/lib/shaf/responder/base.rb +20 -17
- data/lib/shaf/responder/hal.rb +66 -5
- data/lib/shaf/responder/html.rb +43 -16
- data/lib/shaf/responder/problem_json.rb +2 -2
- data/lib/shaf/responder.rb +41 -2
- data/lib/shaf/router.rb +65 -12
- data/lib/shaf/serializer.rb +35 -0
- data/lib/shaf/settings.rb +25 -12
- data/lib/shaf/spec/authenticator.rb +13 -0
- data/lib/shaf/spec/base.rb +1 -1
- data/lib/shaf/spec/http_method_utils.rb +1 -1
- data/lib/shaf/spec/integration_spec.rb +26 -14
- data/lib/shaf/spec/payload_utils.rb +2 -2
- data/lib/shaf/spec.rb +1 -0
- data/lib/shaf/supported_http_methods.rb +15 -0
- data/lib/shaf/tasks/routes_task.rb +14 -17
- data/lib/shaf/tasks.rb +0 -1
- data/lib/shaf/upgrade/manifest.rb +11 -2
- data/lib/shaf/upgrade/package.rb +73 -45
- data/lib/shaf/upgrade/version.rb +11 -10
- data/lib/shaf/utils.rb +19 -5
- data/lib/shaf/version.rb +3 -1
- data/lib/shaf/yard/attribute_method_handler.rb +19 -0
- data/lib/shaf/yard/attribute_object.rb +30 -0
- data/lib/shaf/yard/base_method_handler.rb +30 -0
- data/lib/shaf/yard/link_method_handler.rb +39 -0
- data/lib/shaf/yard/link_object.rb +60 -0
- data/lib/shaf/yard/nested_attributes.rb +37 -0
- data/lib/shaf/yard/parser.rb +64 -0
- data/lib/shaf/yard/profile_method_handler.rb +51 -0
- data/lib/shaf/yard/profile_object.rb +21 -0
- data/lib/shaf/yard/resource_object.rb +55 -0
- data/lib/shaf/yard/serializer_handler.rb +27 -0
- data/lib/shaf/yard.rb +34 -0
- data/lib/shaf.rb +6 -0
- data/templates/Rakefile +0 -6
- data/templates/api/controllers/base_controller.rb +0 -12
- data/templates/api/controllers/docs_controller.rb +5 -3
- data/templates/api/controllers/root_controller.rb +7 -1
- data/templates/api/policies/base_policy.rb +2 -0
- data/templates/api/serializers/base_serializer.rb +1 -3
- data/templates/api/serializers/error_serializer.rb +1 -5
- data/templates/api/serializers/form_serializer.rb +1 -5
- data/templates/api/serializers/root_serializer.rb +0 -11
- data/templates/api/serializers/validation_error_serializer.rb +1 -5
- data/templates/config/bootstrap.rb +1 -2
- data/templates/config/directories.rb +52 -44
- data/templates/config/helpers.rb +1 -1
- data/templates/config/initializers/authentication.rb +18 -0
- data/templates/config/initializers/db_migrations.rb +2 -2
- data/templates/config/initializers/logging.rb +2 -2
- data/templates/config/initializers/middleware.rb +6 -0
- data/templates/config/initializers.rb +52 -8
- data/templates/config.ru +1 -1
- data/templates/spec/spec_helper.rb +5 -0
- data/upgrades/0.5.0.tar.gz +0 -0
- data/upgrades/1.0.4.tar.gz +0 -0
- data/upgrades/1.1.0.tar.gz +0 -0
- data/upgrades/1.6.1.tar.gz +0 -0
- data/upgrades/2.0.0.tar.gz +0 -0
- data/upgrades/3.0.0.tar.gz +0 -0
- data/yard_templates/api_doc/doc_index/html/body.erb +3 -0
- data/yard_templates/api_doc/doc_index/setup.rb +8 -0
- data/yard_templates/api_doc/html/css/api-doc.css +222 -0
- data/yard_templates/api_doc/html/favicon.ico +0 -0
- data/yard_templates/api_doc/html/js/switch_tab.js +17 -0
- data/yard_templates/api_doc/html/setup.rb +59 -0
- data/yard_templates/api_doc/layout/html/footer.erb +3 -0
- data/yard_templates/api_doc/layout/html/header.erb +7 -0
- data/yard_templates/api_doc/layout/html/layout.erb +13 -0
- data/yard_templates/api_doc/layout/setup.rb +24 -0
- data/yard_templates/api_doc/profile/html/attributes.erb +10 -0
- data/yard_templates/api_doc/profile/html/profile.erb +6 -0
- data/yard_templates/api_doc/profile/html/relations.erb +10 -0
- data/yard_templates/api_doc/profile/setup.rb +38 -0
- data/yard_templates/api_doc/profile_attribute/html/attribute.erb +23 -0
- data/yard_templates/api_doc/profile_attribute/setup.rb +21 -0
- data/yard_templates/api_doc/profile_relation/html/relation.erb +37 -0
- data/yard_templates/api_doc/profile_relation/setup.rb +41 -0
- data/yard_templates/api_doc/resource/html/attributes.erb +10 -0
- data/yard_templates/api_doc/resource/html/profile.erb +14 -0
- data/yard_templates/api_doc/resource/html/relations.erb +10 -0
- data/yard_templates/api_doc/resource/html/resource.erb +5 -0
- data/yard_templates/api_doc/resource/setup.rb +56 -0
- data/yard_templates/api_doc/resource_attribute/html/attribute.erb +23 -0
- data/yard_templates/api_doc/resource_attribute/setup.rb +20 -0
- data/yard_templates/api_doc/resource_relation/html/relation.erb +47 -0
- data/yard_templates/api_doc/resource_relation/setup.rb +80 -0
- data/yard_templates/api_doc/setup.rb +31 -0
- data/yard_templates/api_doc/sidebar/html/profile_list.erb +8 -0
- data/yard_templates/api_doc/sidebar/html/search.erb +7 -0
- data/yard_templates/api_doc/sidebar/html/serializer_list.erb +8 -0
- data/yard_templates/api_doc/sidebar/html/sidebar.erb +13 -0
- data/yard_templates/api_doc/sidebar/setup.rb +56 -0
- data.tar.gz.sig +2 -2
- metadata +143 -38
- metadata.gz.sig +0 -0
- data/lib/shaf/api_doc/comment.rb +0 -27
- data/lib/shaf/api_doc/document.rb +0 -137
- data/lib/shaf/extensions/current_user.rb +0 -48
- data/lib/shaf/middleware.rb +0 -1
- data/lib/shaf/responder/hal_serializable.rb +0 -64
- data/lib/shaf/tasks/api_doc_task.rb +0 -125
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
include Shaf::Yard::NestedAttributes
|
4
|
+
|
5
|
+
def init
|
6
|
+
super
|
7
|
+
|
8
|
+
@attribute = object
|
9
|
+
@nested_attributes = nested_attributes_for(object.descriptor)
|
10
|
+
|
11
|
+
sections %i[attribute] end
|
12
|
+
|
13
|
+
def value_types
|
14
|
+
object.value_types.map do |type|
|
15
|
+
{
|
16
|
+
type: type,
|
17
|
+
class_name: 'profile'
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<h4 class=description-list>
|
2
|
+
<strong> <%= object.name %></strong>
|
3
|
+
</h4>
|
4
|
+
<p><%= object.documentation %></p>
|
5
|
+
|
6
|
+
<p>Source:
|
7
|
+
<% if source.href %>
|
8
|
+
<span class="property-source <%= source.type %>">
|
9
|
+
<a href="<%= source.href %>"><%= source.name %></a>
|
10
|
+
</span>
|
11
|
+
<% else %>
|
12
|
+
<span class="property-source <%= source.type %>"><%= source.name %></span>
|
13
|
+
<% end %>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<% if href %>
|
17
|
+
<p>Reference: <a href="<%= href %>"><%= href %></a></p>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% unless http_methods.empty? %>
|
21
|
+
<p>Supported HTTP Methods: <% http_methods.each do |method| %>
|
22
|
+
<span class="<%= css_classes_for(http_method: method) %>"><%= method %></span>
|
23
|
+
<%= %>
|
24
|
+
<% end %>
|
25
|
+
</p>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<% unless @nested_attributes.empty? %>
|
29
|
+
<div class="nested-attributes">
|
30
|
+
<h5>Nested attributes</h5>
|
31
|
+
<ul>
|
32
|
+
<% @nested_attributes.each do |key, attr| %>
|
33
|
+
<li>
|
34
|
+
<h6>
|
35
|
+
<strong> <%= key %></strong>
|
36
|
+
<span class="property-source profile"><%= attr.type %></span>
|
37
|
+
</h6>
|
38
|
+
<p><%= attr.doc %></p>
|
39
|
+
</li>
|
40
|
+
<% end %>
|
41
|
+
</ul>
|
42
|
+
</div>
|
43
|
+
<% end %>
|
44
|
+
|
45
|
+
<% if content_type %>
|
46
|
+
<p>Response type: <%= content_type %></p>
|
47
|
+
<% end %>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'forwardable'
|
4
|
+
|
5
|
+
extend Forwardable
|
6
|
+
include Shaf::Yard::NestedAttributes
|
7
|
+
|
8
|
+
def_delegators :object, :name, :http_methods, :href, :content_type
|
9
|
+
|
10
|
+
HTTP_METHODS = %w(head options get put patch post delete).freeze
|
11
|
+
IANA_HREF = 'https://www.iana.org/assignments/link-relations/link-relations.xhtml'
|
12
|
+
|
13
|
+
class Source
|
14
|
+
attr_reader :name, :href, :type
|
15
|
+
|
16
|
+
def initialize(name:, href:, type:)
|
17
|
+
@name, @href, @type = name, href, type
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def init
|
22
|
+
super
|
23
|
+
|
24
|
+
@nested_attributes = nested_attributes_for(object.descriptor)
|
25
|
+
|
26
|
+
sections %i[relation]
|
27
|
+
end
|
28
|
+
|
29
|
+
def source
|
30
|
+
return @source if defined? @source
|
31
|
+
|
32
|
+
# We currently only support one profile per resource.
|
33
|
+
# But this might change in the future.
|
34
|
+
profile_objects = [object.profile_object].compact
|
35
|
+
profile_objects.each do |profile_object|
|
36
|
+
next unless profile_object.profile.find_relation(name)
|
37
|
+
|
38
|
+
path = profile_object.path.sub(/Profiles::/, '')
|
39
|
+
|
40
|
+
@source = Source.new(
|
41
|
+
name: profile_object.name,
|
42
|
+
href: "/api_doc/#{path}.html",
|
43
|
+
type: :profile
|
44
|
+
)
|
45
|
+
break
|
46
|
+
end
|
47
|
+
|
48
|
+
@source ||= iana_source if object.iana_doc
|
49
|
+
@source ||= unknown_source
|
50
|
+
@source
|
51
|
+
end
|
52
|
+
|
53
|
+
def iana_source
|
54
|
+
Source.new(
|
55
|
+
name: 'IANA',
|
56
|
+
href: IANA_HREF,
|
57
|
+
type: :iana
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
def unknown_source
|
62
|
+
Source.new(
|
63
|
+
name: 'Unknown',
|
64
|
+
href: nil,
|
65
|
+
type: :unknown
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
69
|
+
def css_classes_for(**options)
|
70
|
+
classes = []
|
71
|
+
classes.concat http_method_classes(options[:http_method]) if options.key? :http_method
|
72
|
+
classes.join(' ' )
|
73
|
+
end
|
74
|
+
|
75
|
+
def http_method_classes(method)
|
76
|
+
method = method.to_s.downcase
|
77
|
+
css_classes = ['http-method']
|
78
|
+
css_classes << method if HTTP_METHODS.include? method
|
79
|
+
css_classes
|
80
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'shaf/profiles'
|
4
|
+
|
5
|
+
def init
|
6
|
+
super
|
7
|
+
|
8
|
+
init_options
|
9
|
+
end
|
10
|
+
|
11
|
+
def init_options
|
12
|
+
options.resources = YARD::Registry.all(:resource)
|
13
|
+
options.profiles = YARD::Registry.all(:profile)
|
14
|
+
end
|
15
|
+
|
16
|
+
def serializer(base_path: nil)
|
17
|
+
YARD::Serializers::FileSystemSerializer.new.tap do |serializer|
|
18
|
+
base_path ||= self.base_path
|
19
|
+
serializer.basepath = base_path
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def base_path
|
24
|
+
"#{public_path}/api_doc"
|
25
|
+
end
|
26
|
+
|
27
|
+
def public_path
|
28
|
+
path = String(Shaf::Settings.public_folder)
|
29
|
+
return 'public' if path.empty?
|
30
|
+
path
|
31
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div id="profile-list" class="list sidebar-content <%= 'active' if profile? %>">
|
2
|
+
<ul>
|
3
|
+
<% @profiles.each do |name:, path:| %>
|
4
|
+
<li class="sidebar-link <%= 'active' if profile_active?(name) %>">
|
5
|
+
<a href=<%= path %> class="<%= 'active' if profile_active?(name) %>"><%= name%></a>
|
6
|
+
</li>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div id="serializer-list" class="list sidebar-content <%= 'active' if resource? || index? %>">
|
2
|
+
<ul>
|
3
|
+
<% @resources.each do |name:, path:| %>
|
4
|
+
<li class="sidebar-link <%= 'active' if resource_active?(name) %>">
|
5
|
+
<a href=<%= path %> class="<%= 'active' if resource_active?(name) %>"><%= name%></a>
|
6
|
+
</li>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="sidebar">
|
2
|
+
<div class="sidebar-tabs">
|
3
|
+
<button class="sidebar-tab-btn<%= ' active' if resource? || index? %>" onclick="openTab(event, 'serializer-list')">
|
4
|
+
Resources
|
5
|
+
</button>
|
6
|
+
<button class="sidebar-tab-btn<%= ' active' if profile? %>" onclick="openTab(event, 'profile-list')">
|
7
|
+
Profiles
|
8
|
+
</button>
|
9
|
+
</div>
|
10
|
+
<div class="sidebar-container">
|
11
|
+
<%= yieldall %>
|
12
|
+
</div>
|
13
|
+
</div>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'set'
|
4
|
+
|
5
|
+
def init
|
6
|
+
super
|
7
|
+
|
8
|
+
@resources = resources
|
9
|
+
@profiles = profiles
|
10
|
+
|
11
|
+
sections :sidebar, %i[serializer_list profile_list]
|
12
|
+
end
|
13
|
+
|
14
|
+
def resources
|
15
|
+
options.resources.map do |resource|
|
16
|
+
path = resource.path.sub(/Serializers::/, '')
|
17
|
+
|
18
|
+
{
|
19
|
+
name: resource.resource_name,
|
20
|
+
path: "/api_doc/#{path}.html"
|
21
|
+
}
|
22
|
+
end.sort_by { |h| h[:name] }
|
23
|
+
end
|
24
|
+
|
25
|
+
def profiles
|
26
|
+
options.profiles.map do |profile|
|
27
|
+
path = profile.path.sub(/Profiles::/, '')
|
28
|
+
|
29
|
+
{
|
30
|
+
name: profile.profile_name,
|
31
|
+
path: "/api_doc/#{path}.html"
|
32
|
+
}
|
33
|
+
end.sort_by { |h| h[:name] }
|
34
|
+
end
|
35
|
+
|
36
|
+
def profile?
|
37
|
+
object.is_a? Shaf::Yard::ProfileObject
|
38
|
+
end
|
39
|
+
|
40
|
+
def resource?
|
41
|
+
object.is_a? Shaf::Yard::ResourceObject
|
42
|
+
end
|
43
|
+
|
44
|
+
def index?
|
45
|
+
object.type == :doc_index
|
46
|
+
end
|
47
|
+
|
48
|
+
def resource_active?(name)
|
49
|
+
return false unless resource?
|
50
|
+
object.resource_name == name
|
51
|
+
end
|
52
|
+
|
53
|
+
def profile_active?(name)
|
54
|
+
return false unless profile?
|
55
|
+
object.profile_name == name
|
56
|
+
end
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
�
|
2
|
-
|
1
|
+
�;�xE��i`��2l���(A��w����vn1,i`��[�UBx��R�`� �I0Ѹ�C���O��`)X<�ȕk�q��&����yX/��R}f�ɑ�i�-+�NSS�=��������
|
2
|
+
��Bq"q�C���[��#&(�7`���.��@w�����Gev�����J�iH�E�cYXO@1� �㳉�\���Аl����V?�o%��Bf�(��2<P����S^o��fֳ��SCG���
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sammy Henningsson
|
@@ -10,28 +10,41 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
M40=
|
13
|
+
MIIDVjCCAj6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAqMSgwJgYDVQQDDB9zYW1t
|
14
|
+
eS5oZW5uaW5nc3Nvbi9EQz1oZXkvREM9Y29tMB4XDTIxMDIwMjEzNTY1OFoXDTIy
|
15
|
+
MDIwMjEzNTY1OFowKjEoMCYGA1UEAwwfc2FtbXkuaGVubmluZ3Nzb24vREM9aGV5
|
16
|
+
L0RDPWNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+SDC1mfyhu
|
17
|
+
cJ6Va21rIHUGscEtQrdvyBqxFG1s2TgPMAv4RbqwdJVPa7kjtbCzslADlUE1oru2
|
18
|
+
C+rcJsMtVGX02ukMIPHT1OjTyy0/EMqLqSy3WeRI8APyDSxCVbe+h5BMf3zZnYfd
|
19
|
+
dR6AeG7ln09T1P/tX+9lTMc+I+DW1fUlQgY48CNUayvtJR61svXvXMrhLhi29SQi
|
20
|
+
g1qmH6Zoe22/JgH+m2JksPndY5Ep3gqfDc6Imwu2vGvmGErJD63FB0XQ/wb4WVH4
|
21
|
+
l7sHQSTfKDp8SImCt1xqNgIyjw578ZG2geGLoncuxgDrbQ/UFIJ11lDZd4vLevMh
|
22
|
+
nIxTSJpPr2cCAwEAAaOBhjCBgzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
|
23
|
+
HQ4EFgQUukjj1Cd2ea6IOHDLZe0ymzs2jWkwJAYDVR0RBB0wG4EZc2FtbXkuaGVu
|
24
|
+
bmluZ3Nzb25AaGV5LmNvbTAkBgNVHRIEHTAbgRlzYW1teS5oZW5uaW5nc3NvbkBo
|
25
|
+
ZXkuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBt310FZ56E/fp/y5Wym1xb4C0owfnI
|
26
|
+
LzUqOjXWZTO7RezlBJV/qIwqt6bEjYDQR56zULJFSp4YdoDsratmQ+/kwtbHF7xf
|
27
|
+
WYkSE36mhLP2ggQFH9fXtX6XdyIlwFqwEfNW73ZrkBXGjMxLVKIS9uHdN7PoNhbS
|
28
|
+
0YjOZZD/rq1Jf+klwl/G7bBDPjn58DWlUmwzoj49goGS/UBG37RssQxRwPelKHZh
|
29
|
+
5ZlcHq9h5CxVt380OKaU6wMg95RJBd/kUJqmPxxlxMH8QDQinTwZmmFA9wW7PJdy
|
30
|
+
wAx8px9LkSjTs0GVLH7VtVRWAELllsswCJktz63Adelx9fmIMgrTYgZM
|
32
31
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
32
|
+
date: 2021-10-03 00:00:00.000000000 Z
|
34
33
|
dependencies:
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: file_transactions
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
type: :runtime
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
35
48
|
- !ruby/object:Gem::Dependency
|
36
49
|
name: minitest
|
37
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,9 +52,9 @@ dependencies:
|
|
39
52
|
- - "~>"
|
40
53
|
- !ruby/object:Gem::Version
|
41
54
|
version: '5'
|
42
|
-
- - "
|
55
|
+
- - "~>"
|
43
56
|
- !ruby/object:Gem::Version
|
44
|
-
version: '5.
|
57
|
+
version: '5.14'
|
45
58
|
type: :development
|
46
59
|
prerelease: false
|
47
60
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,9 +62,9 @@ dependencies:
|
|
49
62
|
- - "~>"
|
50
63
|
- !ruby/object:Gem::Version
|
51
64
|
version: '5'
|
52
|
-
- - "
|
65
|
+
- - "~>"
|
53
66
|
- !ruby/object:Gem::Version
|
54
|
-
version: '5.
|
67
|
+
version: '5.14'
|
55
68
|
- !ruby/object:Gem::Dependency
|
56
69
|
name: rack-test
|
57
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,19 +136,19 @@ dependencies:
|
|
123
136
|
- !ruby/object:Gem::Version
|
124
137
|
version: '1.3'
|
125
138
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
139
|
+
name: yard
|
127
140
|
requirement: !ruby/object:Gem::Requirement
|
128
141
|
requirements:
|
129
142
|
- - "~>"
|
130
143
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
144
|
+
version: '0.9'
|
132
145
|
type: :development
|
133
146
|
prerelease: false
|
134
147
|
version_requirements: !ruby/object:Gem::Requirement
|
135
148
|
requirements:
|
136
149
|
- - "~>"
|
137
150
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
151
|
+
version: '0.9'
|
139
152
|
- !ruby/object:Gem::Dependency
|
140
153
|
name: faraday
|
141
154
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +197,28 @@ dependencies:
|
|
184
197
|
requirements:
|
185
198
|
- - "~>"
|
186
199
|
- !ruby/object:Gem::Version
|
187
|
-
version: '1.
|
200
|
+
version: '1.6'
|
188
201
|
type: :development
|
189
202
|
prerelease: false
|
190
203
|
version_requirements: !ruby/object:Gem::Requirement
|
191
204
|
requirements:
|
192
205
|
- - "~>"
|
193
206
|
- !ruby/object:Gem::Version
|
194
|
-
version: '1.
|
207
|
+
version: '1.6'
|
208
|
+
- !ruby/object:Gem::Dependency
|
209
|
+
name: byebug
|
210
|
+
requirement: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
type: :development
|
216
|
+
prerelease: false
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ">="
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
195
222
|
description: A framework for building hypermedia driven APIs with sinatra and sequel.
|
196
223
|
email: sammy.henningsson@gmail.com
|
197
224
|
executables:
|
@@ -200,10 +227,18 @@ extensions: []
|
|
200
227
|
extra_rdoc_files: []
|
201
228
|
files:
|
202
229
|
- bin/shaf
|
230
|
+
- iana_link_relations.csv.gz
|
203
231
|
- lib/shaf.rb
|
204
|
-
- lib/shaf/
|
205
|
-
- lib/shaf/
|
232
|
+
- lib/shaf/alps/attribute_serializer.rb
|
233
|
+
- lib/shaf/alps/json_serializer.rb
|
234
|
+
- lib/shaf/alps/relation_serializer.rb
|
206
235
|
- lib/shaf/app.rb
|
236
|
+
- lib/shaf/authenticator.rb
|
237
|
+
- lib/shaf/authenticator/base.rb
|
238
|
+
- lib/shaf/authenticator/basic_auth.rb
|
239
|
+
- lib/shaf/authenticator/challenge.rb
|
240
|
+
- lib/shaf/authenticator/parameter.rb
|
241
|
+
- lib/shaf/authenticator/request.rb
|
207
242
|
- lib/shaf/command.rb
|
208
243
|
- lib/shaf/command/base.rb
|
209
244
|
- lib/shaf/command/console.rb
|
@@ -211,6 +246,7 @@ files:
|
|
211
246
|
- lib/shaf/command/new.rb
|
212
247
|
- lib/shaf/command/server.rb
|
213
248
|
- lib/shaf/command/templates/Gemfile.erb
|
249
|
+
- lib/shaf/command/templates/config/settings.yml.erb
|
214
250
|
- lib/shaf/command/test.rb
|
215
251
|
- lib/shaf/command/test/filter.rb
|
216
252
|
- lib/shaf/command/test/runnable_method.rb
|
@@ -219,9 +255,9 @@ files:
|
|
219
255
|
- lib/shaf/command/version.rb
|
220
256
|
- lib/shaf/errors.rb
|
221
257
|
- lib/shaf/extensions.rb
|
258
|
+
- lib/shaf/extensions/api_routes.rb
|
222
259
|
- lib/shaf/extensions/authorize.rb
|
223
260
|
- lib/shaf/extensions/controller_hooks.rb
|
224
|
-
- lib/shaf/extensions/current_user.rb
|
225
261
|
- lib/shaf/extensions/log.rb
|
226
262
|
- lib/shaf/extensions/resource_uris.rb
|
227
263
|
- lib/shaf/extensions/symbolic_routes.rb
|
@@ -232,6 +268,7 @@ files:
|
|
232
268
|
- lib/shaf/generator.rb
|
233
269
|
- lib/shaf/generator/base.rb
|
234
270
|
- lib/shaf/generator/controller.rb
|
271
|
+
- lib/shaf/generator/doc.rb
|
235
272
|
- lib/shaf/generator/forms.rb
|
236
273
|
- lib/shaf/generator/helper.rb
|
237
274
|
- lib/shaf/generator/migration.rb
|
@@ -246,39 +283,58 @@ files:
|
|
246
283
|
- lib/shaf/generator/migration/types.rb
|
247
284
|
- lib/shaf/generator/model.rb
|
248
285
|
- lib/shaf/generator/policy.rb
|
286
|
+
- lib/shaf/generator/profile.rb
|
249
287
|
- lib/shaf/generator/scaffold.rb
|
250
288
|
- lib/shaf/generator/serializer.rb
|
251
289
|
- lib/shaf/generator/templates/api/controller.rb.erb
|
252
290
|
- lib/shaf/generator/templates/api/forms.rb.erb
|
253
291
|
- lib/shaf/generator/templates/api/model.rb.erb
|
254
292
|
- lib/shaf/generator/templates/api/policy.rb.erb
|
293
|
+
- lib/shaf/generator/templates/api/profile.rb.erb
|
255
294
|
- lib/shaf/generator/templates/api/serializer.rb.erb
|
256
295
|
- lib/shaf/generator/templates/spec/integration_spec.rb.erb
|
257
296
|
- lib/shaf/generator/templates/spec/model.rb.erb
|
258
297
|
- lib/shaf/generator/templates/spec/serializer_spec.rb.erb
|
259
298
|
- lib/shaf/helpers.rb
|
299
|
+
- lib/shaf/helpers/authentication.rb
|
260
300
|
- lib/shaf/helpers/cache_control.rb
|
261
301
|
- lib/shaf/helpers/http_header.rb
|
262
302
|
- lib/shaf/helpers/json_html.rb
|
263
303
|
- lib/shaf/helpers/paginate.rb
|
264
304
|
- lib/shaf/helpers/payload.rb
|
305
|
+
- lib/shaf/helpers/vary.rb
|
265
306
|
- lib/shaf/immutable_attr.rb
|
266
|
-
- lib/shaf/
|
307
|
+
- lib/shaf/logger.rb
|
267
308
|
- lib/shaf/middleware/request_id.rb
|
309
|
+
- lib/shaf/parser.rb
|
310
|
+
- lib/shaf/parser/base.rb
|
311
|
+
- lib/shaf/parser/form_data.rb
|
312
|
+
- lib/shaf/parser/json.rb
|
313
|
+
- lib/shaf/profile.rb
|
314
|
+
- lib/shaf/profile/attribute.rb
|
315
|
+
- lib/shaf/profile/evaluator.rb
|
316
|
+
- lib/shaf/profile/relation.rb
|
317
|
+
- lib/shaf/profile/unique_id.rb
|
318
|
+
- lib/shaf/profiles.rb
|
319
|
+
- lib/shaf/profiles/shaf_basic.rb
|
320
|
+
- lib/shaf/profiles/shaf_error.rb
|
321
|
+
- lib/shaf/profiles/shaf_form.rb
|
268
322
|
- lib/shaf/rake.rb
|
269
323
|
- lib/shaf/rake/db.rb
|
270
324
|
- lib/shaf/rake/test.rb
|
271
325
|
- lib/shaf/registrable_factory.rb
|
272
326
|
- lib/shaf/resource_doc.rb
|
273
327
|
- lib/shaf/responder.rb
|
328
|
+
- lib/shaf/responder/alps_json.rb
|
274
329
|
- lib/shaf/responder/base.rb
|
275
330
|
- lib/shaf/responder/hal.rb
|
276
|
-
- lib/shaf/responder/hal_serializable.rb
|
277
331
|
- lib/shaf/responder/html.rb
|
278
332
|
- lib/shaf/responder/problem_json.rb
|
279
333
|
- lib/shaf/router.rb
|
334
|
+
- lib/shaf/serializer.rb
|
280
335
|
- lib/shaf/settings.rb
|
281
336
|
- lib/shaf/spec.rb
|
337
|
+
- lib/shaf/spec/authenticator.rb
|
282
338
|
- lib/shaf/spec/base.rb
|
283
339
|
- lib/shaf/spec/fixture.rb
|
284
340
|
- lib/shaf/spec/fixtures.rb
|
@@ -290,8 +346,8 @@ files:
|
|
290
346
|
- lib/shaf/spec/payload_utils.rb
|
291
347
|
- lib/shaf/spec/serializer_spec.rb
|
292
348
|
- lib/shaf/spec/system_spec.rb
|
349
|
+
- lib/shaf/supported_http_methods.rb
|
293
350
|
- lib/shaf/tasks.rb
|
294
|
-
- lib/shaf/tasks/api_doc_task.rb
|
295
351
|
- lib/shaf/tasks/db_task.rb
|
296
352
|
- lib/shaf/tasks/routes_task.rb
|
297
353
|
- lib/shaf/tasks/test_task.rb
|
@@ -301,6 +357,18 @@ files:
|
|
301
357
|
- lib/shaf/upgrade/version.rb
|
302
358
|
- lib/shaf/utils.rb
|
303
359
|
- lib/shaf/version.rb
|
360
|
+
- lib/shaf/yard.rb
|
361
|
+
- lib/shaf/yard/attribute_method_handler.rb
|
362
|
+
- lib/shaf/yard/attribute_object.rb
|
363
|
+
- lib/shaf/yard/base_method_handler.rb
|
364
|
+
- lib/shaf/yard/link_method_handler.rb
|
365
|
+
- lib/shaf/yard/link_object.rb
|
366
|
+
- lib/shaf/yard/nested_attributes.rb
|
367
|
+
- lib/shaf/yard/parser.rb
|
368
|
+
- lib/shaf/yard/profile_method_handler.rb
|
369
|
+
- lib/shaf/yard/profile_object.rb
|
370
|
+
- lib/shaf/yard/resource_object.rb
|
371
|
+
- lib/shaf/yard/serializer_handler.rb
|
304
372
|
- templates/Rakefile
|
305
373
|
- templates/api/controllers/base_controller.rb
|
306
374
|
- templates/api/controllers/docs_controller.rb
|
@@ -320,12 +388,13 @@ files:
|
|
320
388
|
- templates/config/directories.rb
|
321
389
|
- templates/config/helpers.rb
|
322
390
|
- templates/config/initializers.rb
|
391
|
+
- templates/config/initializers/authentication.rb
|
323
392
|
- templates/config/initializers/db_migrations.rb
|
324
393
|
- templates/config/initializers/hal_presenter.rb
|
325
394
|
- templates/config/initializers/logging.rb
|
395
|
+
- templates/config/initializers/middleware.rb
|
326
396
|
- templates/config/initializers/sequel.rb
|
327
397
|
- templates/config/paths.rb
|
328
|
-
- templates/config/settings.yml
|
329
398
|
- templates/frontend/assets/css/main.css
|
330
399
|
- templates/frontend/views/form.erb
|
331
400
|
- templates/frontend/views/headers.erb
|
@@ -347,6 +416,42 @@ files:
|
|
347
416
|
- upgrades/1.4.0.tar.gz
|
348
417
|
- upgrades/1.5.0.tar.gz
|
349
418
|
- upgrades/1.6.0.tar.gz
|
419
|
+
- upgrades/1.6.1.tar.gz
|
420
|
+
- upgrades/2.0.0.tar.gz
|
421
|
+
- upgrades/3.0.0.tar.gz
|
422
|
+
- yard_templates/api_doc/doc_index/html/body.erb
|
423
|
+
- yard_templates/api_doc/doc_index/setup.rb
|
424
|
+
- yard_templates/api_doc/html/css/api-doc.css
|
425
|
+
- yard_templates/api_doc/html/favicon.ico
|
426
|
+
- yard_templates/api_doc/html/js/switch_tab.js
|
427
|
+
- yard_templates/api_doc/html/setup.rb
|
428
|
+
- yard_templates/api_doc/layout/html/footer.erb
|
429
|
+
- yard_templates/api_doc/layout/html/header.erb
|
430
|
+
- yard_templates/api_doc/layout/html/layout.erb
|
431
|
+
- yard_templates/api_doc/layout/setup.rb
|
432
|
+
- yard_templates/api_doc/profile/html/attributes.erb
|
433
|
+
- yard_templates/api_doc/profile/html/profile.erb
|
434
|
+
- yard_templates/api_doc/profile/html/relations.erb
|
435
|
+
- yard_templates/api_doc/profile/setup.rb
|
436
|
+
- yard_templates/api_doc/profile_attribute/html/attribute.erb
|
437
|
+
- yard_templates/api_doc/profile_attribute/setup.rb
|
438
|
+
- yard_templates/api_doc/profile_relation/html/relation.erb
|
439
|
+
- yard_templates/api_doc/profile_relation/setup.rb
|
440
|
+
- yard_templates/api_doc/resource/html/attributes.erb
|
441
|
+
- yard_templates/api_doc/resource/html/profile.erb
|
442
|
+
- yard_templates/api_doc/resource/html/relations.erb
|
443
|
+
- yard_templates/api_doc/resource/html/resource.erb
|
444
|
+
- yard_templates/api_doc/resource/setup.rb
|
445
|
+
- yard_templates/api_doc/resource_attribute/html/attribute.erb
|
446
|
+
- yard_templates/api_doc/resource_attribute/setup.rb
|
447
|
+
- yard_templates/api_doc/resource_relation/html/relation.erb
|
448
|
+
- yard_templates/api_doc/resource_relation/setup.rb
|
449
|
+
- yard_templates/api_doc/setup.rb
|
450
|
+
- yard_templates/api_doc/sidebar/html/profile_list.erb
|
451
|
+
- yard_templates/api_doc/sidebar/html/search.erb
|
452
|
+
- yard_templates/api_doc/sidebar/html/serializer_list.erb
|
453
|
+
- yard_templates/api_doc/sidebar/html/sidebar.erb
|
454
|
+
- yard_templates/api_doc/sidebar/setup.rb
|
350
455
|
homepage:
|
351
456
|
licenses:
|
352
457
|
- MIT
|
@@ -368,7 +473,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
368
473
|
- !ruby/object:Gem::Version
|
369
474
|
version: '0'
|
370
475
|
requirements: []
|
371
|
-
rubygems_version: 3.
|
476
|
+
rubygems_version: 3.1.4
|
372
477
|
signing_key:
|
373
478
|
specification_version: 4
|
374
479
|
summary: Sinatra Hypermedia Api Framework
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/shaf/api_doc/comment.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
module Shaf
|
2
|
-
module ApiDoc
|
3
|
-
class Comment
|
4
|
-
def initialize
|
5
|
-
@indent = 0
|
6
|
-
@comment = ""
|
7
|
-
end
|
8
|
-
|
9
|
-
def to_s
|
10
|
-
@comment
|
11
|
-
end
|
12
|
-
|
13
|
-
def empty?
|
14
|
-
@comment.empty?
|
15
|
-
end
|
16
|
-
|
17
|
-
def <<(line)
|
18
|
-
@indent = line[/\A\s*/].size if empty?
|
19
|
-
@comment << "\n#{extract(line)}"
|
20
|
-
end
|
21
|
-
|
22
|
-
def extract(line)
|
23
|
-
line.sub(%r(\A\s{#{@indent}}), "")
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|