cabbage_doc 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cabbage_doc/authentication.rb +18 -0
- data/lib/cabbage_doc/cache.rb +23 -0
- data/lib/cabbage_doc/client.rb +1 -6
- data/lib/cabbage_doc/configuration.rb +7 -4
- data/lib/cabbage_doc/path.rb +1 -1
- data/lib/cabbage_doc/processor.rb +33 -0
- data/lib/cabbage_doc/processors/documentation.rb +3 -1
- data/lib/cabbage_doc/request.rb +39 -1
- data/lib/cabbage_doc/response.rb +12 -0
- data/lib/cabbage_doc/task.rb +8 -20
- data/lib/cabbage_doc/version.rb +1 -1
- data/lib/cabbage_doc/web.rb +9 -3
- data/lib/cabbage_doc/web_helper.rb +36 -1
- data/lib/cabbage_doc/worker.rb +28 -0
- data/lib/cabbage_doc.rb +2 -1
- data/web/public/css/application.css +10 -0
- data/web/public/css/highlight/agate.css +108 -0
- data/web/public/css/highlight/androidstudio.css +66 -0
- data/web/public/css/highlight/arduino-light.css +88 -0
- data/web/public/css/highlight/arta.css +73 -0
- data/web/public/css/highlight/ascetic.css +45 -0
- data/web/public/css/highlight/atelier-cave-dark.css +83 -0
- data/web/public/css/highlight/atelier-cave-light.css +85 -0
- data/web/public/css/highlight/atelier-dune-dark.css +69 -0
- data/web/public/css/highlight/atelier-dune-light.css +69 -0
- data/web/public/css/highlight/atelier-estuary-dark.css +84 -0
- data/web/public/css/highlight/atelier-estuary-light.css +84 -0
- data/web/public/css/highlight/atelier-forest-dark.css +69 -0
- data/web/public/css/highlight/atelier-forest-light.css +69 -0
- data/web/public/css/highlight/atelier-heath-dark.css +69 -0
- data/web/public/css/highlight/atelier-heath-light.css +69 -0
- data/web/public/css/highlight/atelier-lakeside-dark.css +69 -0
- data/web/public/css/highlight/atelier-lakeside-light.css +69 -0
- data/web/public/css/highlight/atelier-plateau-dark.css +84 -0
- data/web/public/css/highlight/atelier-plateau-light.css +84 -0
- data/web/public/css/highlight/atelier-savanna-dark.css +84 -0
- data/web/public/css/highlight/atelier-savanna-light.css +84 -0
- data/web/public/css/highlight/atelier-seaside-dark.css +69 -0
- data/web/public/css/highlight/atelier-seaside-light.css +69 -0
- data/web/public/css/highlight/atelier-sulphurpool-dark.css +69 -0
- data/web/public/css/highlight/atelier-sulphurpool-light.css +69 -0
- data/web/public/css/highlight/brown-paper.css +64 -0
- data/web/public/css/highlight/codepen-embed.css +60 -0
- data/web/public/css/highlight/color-brewer.css +71 -0
- data/web/public/css/highlight/dark.css +63 -0
- data/web/public/css/highlight/darkula.css +74 -0
- data/web/public/css/highlight/default.css +99 -0
- data/web/public/css/highlight/docco.css +97 -0
- data/web/public/css/highlight/dracula.css +76 -0
- data/web/public/css/highlight/far.css +71 -0
- data/web/public/css/highlight/foundation.css +88 -0
- data/web/public/css/highlight/github-gist.css +71 -0
- data/web/public/css/highlight/github.css +99 -0
- data/web/public/css/highlight/googlecode.css +89 -0
- data/web/public/css/highlight/grayscale.css +101 -0
- data/web/public/css/highlight/gruvbox-dark.css +108 -0
- data/web/public/css/highlight/gruvbox-light.css +108 -0
- data/web/public/css/highlight/hopscotch.css +83 -0
- data/web/public/css/highlight/hybrid.css +102 -0
- data/web/public/css/highlight/idea.css +97 -0
- data/web/public/css/highlight/ir-black.css +73 -0
- data/web/public/css/highlight/kimbie.dark.css +74 -0
- data/web/public/css/highlight/kimbie.light.css +74 -0
- data/web/public/css/highlight/magula.css +70 -0
- data/web/public/css/highlight/mono-blue.css +59 -0
- data/web/public/css/highlight/monokai-sublime.css +83 -0
- data/web/public/css/highlight/monokai.css +70 -0
- data/web/public/css/highlight/obsidian.css +88 -0
- data/web/public/css/highlight/ocean.css +74 -0
- data/web/public/css/highlight/paraiso-dark.css +72 -0
- data/web/public/css/highlight/paraiso-light.css +72 -0
- data/web/public/css/highlight/pojoaque.css +83 -0
- data/web/public/css/highlight/purebasic.css +96 -0
- data/web/public/css/highlight/qtcreator_dark.css +83 -0
- data/web/public/css/highlight/qtcreator_light.css +83 -0
- data/web/public/css/highlight/railscasts.css +106 -0
- data/web/public/css/highlight/rainbow.css +85 -0
- data/web/public/css/highlight/school-book.css +72 -0
- data/web/public/css/highlight/solarized-dark.css +84 -0
- data/web/public/css/highlight/solarized-light.css +84 -0
- data/web/public/css/highlight/sunburst.css +102 -0
- data/web/public/css/highlight/tomorrow-night-blue.css +75 -0
- data/web/public/css/highlight/tomorrow-night-bright.css +74 -0
- data/web/public/css/highlight/tomorrow-night-eighties.css +74 -0
- data/web/public/css/highlight/tomorrow-night.css +75 -0
- data/web/public/css/highlight/tomorrow.css +72 -0
- data/web/public/css/highlight/vs.css +68 -0
- data/web/public/css/highlight/xcode.css +93 -0
- data/web/public/css/highlight/xt256.css +92 -0
- data/web/public/css/highlight/zenburn.css +80 -0
- data/web/public/js/application.js +79 -12
- data/web/public/js/highlight.min.js +3 -0
- data/web/views/layout.haml +6 -3
- data/web/views/response.haml +10 -5
- metadata +81 -7
- data/lib/cabbage_doc/pacto_helper.rb +0 -27
- data/lib/cabbage_doc/processors/contracts.rb +0 -12
- data/lib/cabbage_doc/processors/rspec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27a236fc7439566b6ea5056fcd4fb3ef08697d7e
|
4
|
+
data.tar.gz: f0cacbf8131c633330d0c5f08dc35bc77832a3bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d4a620a2020a673d25bd3706582e999183e2fb269795855154afb11873daa5263f2b235ee36584ea3dac7bc134f03342781bdb29690c4356f448ba08d70b816
|
7
|
+
data.tar.gz: 49a35368edc2326a9c7a47838063226eb698c0baf9e80ea8917aa0dc786141411dfcbe09829e9370d5a3cc9e05631474e23bf036ca2921a578a6e8fbc7baa1fe
|
@@ -36,6 +36,14 @@ module CabbageDoc
|
|
36
36
|
@type = :basic
|
37
37
|
end
|
38
38
|
|
39
|
+
def uri
|
40
|
+
if path && path != '/'
|
41
|
+
"#{root_uri}/#{path}"
|
42
|
+
else
|
43
|
+
root_uri
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
39
47
|
def valid?
|
40
48
|
case type
|
41
49
|
when :basic
|
@@ -50,5 +58,15 @@ module CabbageDoc
|
|
50
58
|
def configurable?
|
51
59
|
@configurable.any?
|
52
60
|
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def root_uri
|
65
|
+
if subdomain
|
66
|
+
"#{scheme}://#{subdomain}.#{domain}"
|
67
|
+
else
|
68
|
+
"#{scheme}://#{domain}"
|
69
|
+
end
|
70
|
+
end
|
53
71
|
end
|
54
72
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module CabbageDoc
|
2
|
+
class Cache
|
3
|
+
def initialize
|
4
|
+
clear
|
5
|
+
end
|
6
|
+
|
7
|
+
def write(key, value, options = {})
|
8
|
+
@_data[key] = value
|
9
|
+
end
|
10
|
+
|
11
|
+
def read(key)
|
12
|
+
@_data[key]
|
13
|
+
end
|
14
|
+
|
15
|
+
def delete(key)
|
16
|
+
@_data.delete(key)
|
17
|
+
end
|
18
|
+
|
19
|
+
def clear
|
20
|
+
@_data = {}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/cabbage_doc/client.rb
CHANGED
@@ -6,12 +6,7 @@ module CabbageDoc
|
|
6
6
|
def new(auth)
|
7
7
|
Class.new(self) do |klass|
|
8
8
|
klass.headers "User-Agent" => auth.user_agent
|
9
|
-
|
10
|
-
if auth.subdomain
|
11
|
-
klass.base_uri "#{auth.scheme}://#{auth.subdomain}.#{auth.domain}/#{auth.path}"
|
12
|
-
else
|
13
|
-
klass.base_uri "#{auth.scheme}://#{auth.domain}/#{auth.path}"
|
14
|
-
end
|
9
|
+
klass.base_uri auth.uri
|
15
10
|
|
16
11
|
if auth.type == :basic
|
17
12
|
klass.basic_auth auth.username, auth.password
|
@@ -3,17 +3,20 @@ module CabbageDoc
|
|
3
3
|
include Singleton
|
4
4
|
|
5
5
|
DEFAULTS = {
|
6
|
-
version: 'v1',
|
7
6
|
path: 'api/v1',
|
8
7
|
title: 'Cabbage Doc',
|
9
8
|
scheme: 'https',
|
10
|
-
verbose: false
|
9
|
+
verbose: false,
|
10
|
+
dev: false,
|
11
|
+
cache: Cache.new,
|
12
|
+
request: proc { |request| request.perform },
|
13
|
+
theme: 'github'
|
11
14
|
}.freeze
|
12
15
|
|
13
|
-
OPTIONAL_ATTRIBUTES = %i(welcome path scheme
|
16
|
+
OPTIONAL_ATTRIBUTES = %i(welcome path scheme title verbose authentication dev request cache theme).freeze
|
14
17
|
REQUIRED_ATTRIBUTES = %i(domain controllers root).freeze
|
15
18
|
ATTRIBUTES = (OPTIONAL_ATTRIBUTES + REQUIRED_ATTRIBUTES).freeze
|
16
|
-
CALLABLE_ATTRIBUTES = %i(controllers authentication).freeze
|
19
|
+
CALLABLE_ATTRIBUTES = %i(controllers authentication request).freeze
|
17
20
|
|
18
21
|
attr_accessor *ATTRIBUTES
|
19
22
|
|
data/lib/cabbage_doc/path.rb
CHANGED
@@ -1,14 +1,39 @@
|
|
1
1
|
module CabbageDoc
|
2
2
|
class Processor
|
3
|
+
class Error < StandardError; end
|
4
|
+
class InvalidType < Error; end
|
5
|
+
class InvalidPriority < Error; end
|
6
|
+
|
7
|
+
PRIORITIES = [:high, :medium, :low].freeze
|
8
|
+
|
3
9
|
class << self
|
4
10
|
def inherited(klass)
|
5
11
|
all[klass.to_s.split('::').last.downcase.to_sym] = klass
|
6
12
|
end
|
7
13
|
|
14
|
+
def priority(value = nil)
|
15
|
+
if value.is_a?(Symbol)
|
16
|
+
raise InvalidPriority, value unless PRIORITIES.include?(value)
|
17
|
+
@_priority = value
|
18
|
+
else
|
19
|
+
@_priority
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
8
23
|
def all
|
9
24
|
@_all ||= {}
|
10
25
|
end
|
11
26
|
|
27
|
+
def perform(type)
|
28
|
+
klass = all[type]
|
29
|
+
|
30
|
+
if klass
|
31
|
+
klass.new.perform
|
32
|
+
else
|
33
|
+
raise InvalidType, type
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
12
37
|
def load!
|
13
38
|
Dir.glob(File.join(File.dirname(__FILE__), 'processors', '*.rb')).sort.each do |processor|
|
14
39
|
require(processor)
|
@@ -22,6 +47,10 @@ module CabbageDoc
|
|
22
47
|
|
23
48
|
protected
|
24
49
|
|
50
|
+
def cache
|
51
|
+
@_cache ||= Cache.new
|
52
|
+
end
|
53
|
+
|
25
54
|
def client
|
26
55
|
@_client ||= Client.new(auth)
|
27
56
|
end
|
@@ -35,6 +64,10 @@ module CabbageDoc
|
|
35
64
|
collection.load!
|
36
65
|
end
|
37
66
|
end
|
67
|
+
|
68
|
+
def config
|
69
|
+
@_config ||= Configuration.instance
|
70
|
+
end
|
38
71
|
end
|
39
72
|
|
40
73
|
Processor.load!
|
@@ -1,10 +1,12 @@
|
|
1
1
|
module CabbageDoc
|
2
2
|
module Processors
|
3
3
|
class Documentation < Processor
|
4
|
+
priority :high
|
5
|
+
|
4
6
|
def perform
|
5
7
|
collection.clear!
|
6
8
|
|
7
|
-
|
9
|
+
config.controllers.call.each do |filename|
|
8
10
|
collection.parse!(filename)
|
9
11
|
end
|
10
12
|
|
data/lib/cabbage_doc/request.rb
CHANGED
@@ -1,9 +1,24 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'digest/sha1'
|
3
|
+
|
1
4
|
module CabbageDoc
|
2
5
|
class Request
|
3
6
|
METHODS = %i[get post put delete].freeze
|
4
7
|
|
5
8
|
attr_reader :raw_request, :collection
|
6
9
|
|
10
|
+
class << self
|
11
|
+
def parse(s)
|
12
|
+
variables = YAML.load(s)
|
13
|
+
|
14
|
+
new(nil, Collection.instance).tap do |instance|
|
15
|
+
[:@_id, :@_auth, :@_action, :@_method, :@_params].each_with_index do |k, i|
|
16
|
+
instance.instance_variable_set(k, variables[i])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
7
22
|
def initialize(raw_request, collection)
|
8
23
|
@raw_request = raw_request
|
9
24
|
@collection = collection
|
@@ -17,8 +32,27 @@ module CabbageDoc
|
|
17
32
|
action && method && METHODS.include?(method)
|
18
33
|
end
|
19
34
|
|
35
|
+
def to_yaml
|
36
|
+
YAML.dump([
|
37
|
+
id,
|
38
|
+
auth,
|
39
|
+
action,
|
40
|
+
method,
|
41
|
+
params
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
def id
|
46
|
+
@_id ||= new_id
|
47
|
+
end
|
48
|
+
|
20
49
|
private
|
21
50
|
|
51
|
+
def new_id
|
52
|
+
components = [MARKER, Time.now.utc, Process.pid, Thread.current.object_id, rand(99999)]
|
53
|
+
Digest::SHA1.hexdigest(components.join('_'))
|
54
|
+
end
|
55
|
+
|
22
56
|
def perform_request
|
23
57
|
key = (method == :get) ? :query : :body
|
24
58
|
client.send(method, action, key => params.to_hash)
|
@@ -56,13 +90,17 @@ module CabbageDoc
|
|
56
90
|
end
|
57
91
|
|
58
92
|
def params
|
59
|
-
@_params ||= Params.new(
|
93
|
+
@_params ||= Params.new(raw_params, collection)
|
60
94
|
end
|
61
95
|
|
62
96
|
def auth
|
63
97
|
@_auth ||= Authentication.new(raw_request)
|
64
98
|
end
|
65
99
|
|
100
|
+
def raw_params
|
101
|
+
@_raw_params ||= raw_request.params
|
102
|
+
end
|
103
|
+
|
66
104
|
def client
|
67
105
|
@_client ||= Client.new(auth)
|
68
106
|
end
|
data/lib/cabbage_doc/response.rb
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
1
3
|
module CabbageDoc
|
2
4
|
class Response
|
3
5
|
attr_reader :url, :headers, :params, :code, :body
|
4
6
|
|
7
|
+
class << self
|
8
|
+
def parse(s)
|
9
|
+
YAML.load(s)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
5
13
|
def initialize(url, params, response)
|
6
14
|
@url = url
|
7
15
|
@params = params
|
@@ -10,6 +18,10 @@ module CabbageDoc
|
|
10
18
|
@body = response.parsed_response
|
11
19
|
end
|
12
20
|
|
21
|
+
def to_yaml
|
22
|
+
YAML.dump(self)
|
23
|
+
end
|
24
|
+
|
13
25
|
def to_json
|
14
26
|
{
|
15
27
|
url: url,
|
data/lib/cabbage_doc/task.rb
CHANGED
@@ -9,6 +9,7 @@ module CabbageDoc
|
|
9
9
|
new.tap do |instance|
|
10
10
|
yield instance if block_given?
|
11
11
|
instance.validate!
|
12
|
+
instance.sort!
|
12
13
|
instance.define!
|
13
14
|
end
|
14
15
|
end
|
@@ -18,35 +19,22 @@ module CabbageDoc
|
|
18
19
|
@name = :cabbagedoc
|
19
20
|
end
|
20
21
|
|
21
|
-
def
|
22
|
-
|
23
|
-
@processors.delete(:rspec) if @processors.include?(:rspec)
|
24
|
-
@processors << :contracts
|
25
|
-
@processors << :rspec
|
26
|
-
else
|
27
|
-
@processors.delete(:contracts)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def rspec=(value)
|
32
|
-
if value
|
33
|
-
@processors << :contracts unless @processors.include?(:contracts)
|
34
|
-
@processors << :rspec
|
35
|
-
else
|
36
|
-
@processors.delete(:rspec)
|
37
|
-
end
|
22
|
+
def sort!
|
23
|
+
processors.sort! { |processor| Processor::PRIORITIES.index(Processor.all[processor].priority) }
|
38
24
|
end
|
39
25
|
|
40
26
|
def define!
|
41
27
|
namespace name do
|
42
28
|
processors.each do |processor|
|
43
29
|
desc "Process #{processor}"
|
44
|
-
|
45
|
-
|
30
|
+
namespace :process do
|
31
|
+
task processor.to_s => :environment do
|
32
|
+
Processor.all[processor].new.perform
|
33
|
+
end
|
46
34
|
end
|
47
35
|
end
|
48
36
|
|
49
|
-
desc "Customize Web"
|
37
|
+
desc "Customize Web UI"
|
50
38
|
task :customize => :environment do
|
51
39
|
Customizer.new.perform
|
52
40
|
end
|
data/lib/cabbage_doc/version.rb
CHANGED
data/lib/cabbage_doc/web.rb
CHANGED
@@ -25,12 +25,18 @@ module CabbageDoc
|
|
25
25
|
haml :index
|
26
26
|
end
|
27
27
|
|
28
|
+
get '/:id' do
|
29
|
+
response_by_id(params[:id])
|
30
|
+
end
|
31
|
+
|
28
32
|
post '/' do
|
29
|
-
response =
|
33
|
+
response = Configuration.instance.request.call(post_request)
|
30
34
|
|
31
|
-
if response
|
32
|
-
content_type :json
|
35
|
+
if response.is_a?(Response)
|
36
|
+
content_type :json
|
33
37
|
response.to_json
|
38
|
+
elsif post_request.valid?
|
39
|
+
response_by_id(post_request.id)
|
34
40
|
else
|
35
41
|
halt 500
|
36
42
|
end
|
@@ -1,17 +1,35 @@
|
|
1
1
|
module CabbageDoc
|
2
2
|
module WebHelper
|
3
|
+
def asset_path(path)
|
4
|
+
[request.path, path].join('/').gsub(/\/\/+/, '/')
|
5
|
+
end
|
6
|
+
|
7
|
+
def theme_path
|
8
|
+
asset_path("css/highlight/#{config.theme}.css")
|
9
|
+
end
|
10
|
+
|
3
11
|
def config
|
4
12
|
Configuration.instance
|
5
13
|
end
|
6
14
|
|
7
15
|
def collection
|
16
|
+
if config.dev
|
17
|
+
Processor.perform(:documentation)
|
18
|
+
@_collection = nil
|
19
|
+
end
|
20
|
+
|
8
21
|
@_collection ||= Collection.instance.tap do |collection|
|
9
22
|
collection.load!
|
10
23
|
end
|
11
24
|
end
|
12
25
|
|
13
26
|
def markdown
|
14
|
-
@_markdown ||= Redcarpet::Markdown.new(
|
27
|
+
@_markdown ||= Redcarpet::Markdown.new(
|
28
|
+
Redcarpet::Render::HTML.new,
|
29
|
+
tables: true,
|
30
|
+
fenced_code_blocks: true,
|
31
|
+
autolink: true
|
32
|
+
)
|
15
33
|
end
|
16
34
|
|
17
35
|
def title
|
@@ -21,5 +39,22 @@ module CabbageDoc
|
|
21
39
|
def auth
|
22
40
|
@_auth ||= Authentication.new(request)
|
23
41
|
end
|
42
|
+
|
43
|
+
def post_request
|
44
|
+
@_post_request ||= Request.new(request, collection)
|
45
|
+
end
|
46
|
+
|
47
|
+
def response_by_id(id)
|
48
|
+
response = Worker.get(id)
|
49
|
+
|
50
|
+
if response.is_a?(Response)
|
51
|
+
content_type :json
|
52
|
+
response.to_json
|
53
|
+
else
|
54
|
+
status 503
|
55
|
+
content_type :json
|
56
|
+
{ id: id }.to_json
|
57
|
+
end
|
58
|
+
end
|
24
59
|
end
|
25
60
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module CabbageDoc
|
2
|
+
module Worker
|
3
|
+
EXPIRES_IN = 30.freeze # 30 seconds
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def get(id)
|
7
|
+
response = CabbageDoc::Configuration.instance.cache.read([CabbageDoc::MARKER, id].join('_'))
|
8
|
+
Response.parse(response) if response
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def perform(serialized_request)
|
13
|
+
request = Request.parse(serialized_request)
|
14
|
+
response = request.perform
|
15
|
+
write(request.id, response) if response
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def write(id, response)
|
21
|
+
CabbageDoc::Configuration.instance.cache.write(
|
22
|
+
[CabbageDoc::MARKER, id].join('_'),
|
23
|
+
response.to_yaml,
|
24
|
+
expires_in: EXPIRES_IN
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/cabbage_doc.rb
CHANGED
@@ -4,7 +4,6 @@ module CabbageDoc
|
|
4
4
|
autoload :Path, 'cabbage_doc/path'
|
5
5
|
autoload :Singleton, 'cabbage_doc/singleton'
|
6
6
|
autoload :Cloneable, 'cabbage_doc/cloneable'
|
7
|
-
autoload :PactoHelper, 'cabbage_doc/pacto_helper'
|
8
7
|
autoload :Parser, 'cabbage_doc/parser'
|
9
8
|
autoload :Client, 'cabbage_doc/client'
|
10
9
|
autoload :Request, 'cabbage_doc/request'
|
@@ -22,6 +21,8 @@ module CabbageDoc
|
|
22
21
|
autoload :Processor, 'cabbage_doc/processor'
|
23
22
|
autoload :Customizer, 'cabbage_doc/customizer'
|
24
23
|
autoload :Task, 'cabbage_doc/task'
|
24
|
+
autoload :Worker, 'cabbage_doc/worker'
|
25
|
+
autoload :Cache, 'cabbage_doc/cache'
|
25
26
|
|
26
27
|
class << self
|
27
28
|
def configure
|
@@ -7,6 +7,11 @@ body
|
|
7
7
|
pre, code, .authentication form
|
8
8
|
{
|
9
9
|
font-family: monospace;
|
10
|
+
border: 1px solid #e5e0c6;
|
11
|
+
}
|
12
|
+
|
13
|
+
.authentication form
|
14
|
+
{
|
10
15
|
background-color: #fcf6db;
|
11
16
|
border: 1px solid #e5e0c6;
|
12
17
|
padding: 10px;
|
@@ -178,6 +183,11 @@ a:hover
|
|
178
183
|
margin-top: 10px;
|
179
184
|
}
|
180
185
|
|
186
|
+
.action .response pre
|
187
|
+
{
|
188
|
+
overflow: hidden;
|
189
|
+
}
|
190
|
+
|
181
191
|
.action .description
|
182
192
|
{
|
183
193
|
margin-bottom: 20px;
|
@@ -0,0 +1,108 @@
|
|
1
|
+
/*!
|
2
|
+
* Agate by Taufik Nurrohman <https://github.com/tovic>
|
3
|
+
* ----------------------------------------------------
|
4
|
+
*
|
5
|
+
* #ade5fc
|
6
|
+
* #a2fca2
|
7
|
+
* #c6b4f0
|
8
|
+
* #d36363
|
9
|
+
* #fcc28c
|
10
|
+
* #fc9b9b
|
11
|
+
* #ffa
|
12
|
+
* #fff
|
13
|
+
* #333
|
14
|
+
* #62c8f3
|
15
|
+
* #888
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
|
19
|
+
.hljs {
|
20
|
+
display: block;
|
21
|
+
overflow-x: auto;
|
22
|
+
padding: 0.5em;
|
23
|
+
background: #333;
|
24
|
+
color: white;
|
25
|
+
}
|
26
|
+
|
27
|
+
.hljs-name,
|
28
|
+
.hljs-strong {
|
29
|
+
font-weight: bold;
|
30
|
+
}
|
31
|
+
|
32
|
+
.hljs-code,
|
33
|
+
.hljs-emphasis {
|
34
|
+
font-style: italic;
|
35
|
+
}
|
36
|
+
|
37
|
+
.hljs-tag {
|
38
|
+
color: #62c8f3;
|
39
|
+
}
|
40
|
+
|
41
|
+
.hljs-variable,
|
42
|
+
.hljs-template-variable,
|
43
|
+
.hljs-selector-id,
|
44
|
+
.hljs-selector-class {
|
45
|
+
color: #ade5fc;
|
46
|
+
}
|
47
|
+
|
48
|
+
.hljs-string,
|
49
|
+
.hljs-bullet {
|
50
|
+
color: #a2fca2;
|
51
|
+
}
|
52
|
+
|
53
|
+
.hljs-type,
|
54
|
+
.hljs-title,
|
55
|
+
.hljs-section,
|
56
|
+
.hljs-attribute,
|
57
|
+
.hljs-quote,
|
58
|
+
.hljs-built_in,
|
59
|
+
.hljs-builtin-name {
|
60
|
+
color: #ffa;
|
61
|
+
}
|
62
|
+
|
63
|
+
.hljs-number,
|
64
|
+
.hljs-symbol,
|
65
|
+
.hljs-bullet {
|
66
|
+
color: #d36363;
|
67
|
+
}
|
68
|
+
|
69
|
+
.hljs-keyword,
|
70
|
+
.hljs-selector-tag,
|
71
|
+
.hljs-literal {
|
72
|
+
color: #fcc28c;
|
73
|
+
}
|
74
|
+
|
75
|
+
.hljs-comment,
|
76
|
+
.hljs-deletion,
|
77
|
+
.hljs-code {
|
78
|
+
color: #888;
|
79
|
+
}
|
80
|
+
|
81
|
+
.hljs-regexp,
|
82
|
+
.hljs-link {
|
83
|
+
color: #c6b4f0;
|
84
|
+
}
|
85
|
+
|
86
|
+
.hljs-meta {
|
87
|
+
color: #fc9b9b;
|
88
|
+
}
|
89
|
+
|
90
|
+
.hljs-deletion {
|
91
|
+
background-color: #fc9b9b;
|
92
|
+
color: #333;
|
93
|
+
}
|
94
|
+
|
95
|
+
.hljs-addition {
|
96
|
+
background-color: #a2fca2;
|
97
|
+
color: #333;
|
98
|
+
}
|
99
|
+
|
100
|
+
.hljs a {
|
101
|
+
color: inherit;
|
102
|
+
}
|
103
|
+
|
104
|
+
.hljs a:focus,
|
105
|
+
.hljs a:hover {
|
106
|
+
color: inherit;
|
107
|
+
text-decoration: underline;
|
108
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/*
|
2
|
+
Date: 24 Fev 2015
|
3
|
+
Author: Pedro Oliveira <kanytu@gmail . com>
|
4
|
+
*/
|
5
|
+
|
6
|
+
.hljs {
|
7
|
+
color: #a9b7c6;
|
8
|
+
background: #282b2e;
|
9
|
+
display: block;
|
10
|
+
overflow-x: auto;
|
11
|
+
padding: 0.5em;
|
12
|
+
}
|
13
|
+
|
14
|
+
.hljs-number,
|
15
|
+
.hljs-literal,
|
16
|
+
.hljs-symbol,
|
17
|
+
.hljs-bullet {
|
18
|
+
color: #6897BB;
|
19
|
+
}
|
20
|
+
|
21
|
+
.hljs-keyword,
|
22
|
+
.hljs-selector-tag,
|
23
|
+
.hljs-deletion {
|
24
|
+
color: #cc7832;
|
25
|
+
}
|
26
|
+
|
27
|
+
.hljs-variable,
|
28
|
+
.hljs-template-variable,
|
29
|
+
.hljs-link {
|
30
|
+
color: #629755;
|
31
|
+
}
|
32
|
+
|
33
|
+
.hljs-comment,
|
34
|
+
.hljs-quote {
|
35
|
+
color: #808080;
|
36
|
+
}
|
37
|
+
|
38
|
+
.hljs-meta {
|
39
|
+
color: #bbb529;
|
40
|
+
}
|
41
|
+
|
42
|
+
.hljs-string,
|
43
|
+
.hljs-attribute,
|
44
|
+
.hljs-addition {
|
45
|
+
color: #6A8759;
|
46
|
+
}
|
47
|
+
|
48
|
+
.hljs-section,
|
49
|
+
.hljs-title,
|
50
|
+
.hljs-type {
|
51
|
+
color: #ffc66d;
|
52
|
+
}
|
53
|
+
|
54
|
+
.hljs-name,
|
55
|
+
.hljs-selector-id,
|
56
|
+
.hljs-selector-class {
|
57
|
+
color: #e8bf6a;
|
58
|
+
}
|
59
|
+
|
60
|
+
.hljs-emphasis {
|
61
|
+
font-style: italic;
|
62
|
+
}
|
63
|
+
|
64
|
+
.hljs-strong {
|
65
|
+
font-weight: bold;
|
66
|
+
}
|