ds_doc_wrapper 1.0.4 → 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 +8 -8
- data/README.rdoc +4 -3
- data/lib/doc_wrapper/base.rb +6 -0
- data/lib/doc_wrapper/version.rb +1 -1
- data/test/dummy/config/application.rb +4 -0
- data/test/dummy/lib/doc_wrapper/company_by_tom_cat.rb +11 -0
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTBlOGY4MzMzMDQyOWNkYzcwMGQ5NTY1YmZjZjcxZjIwNDYzMzZhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjdmM2ZmN2JiYjE5YTdhYTQ0Mzk2MzMwMjRkM2E4OTJjZDU3NGUyYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmE4YzFmMjFhOWY3NWNkZjU5NTRiMmMyNjRlMTNkZTViNTExMTQ3MGRkOGU2
|
10
|
+
YTU1NjZmMzI1MDBmMmY3NTRhMTM3NGE0OTkxMzQ3MjMxMDY3ZTNhM2EzNTBj
|
11
|
+
MDcxMWJkZjFlYWUxN2VmYzU4Y2M3Mjc4OTUzOGI0N2FlYjdkODU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjJjZjdhNWYzYzY0YTZjMmE3MWNkOGJhN2ZhZjNkZGQ3OWE0YzQxNzU1NTE5
|
14
|
+
YTJlYWE1YjdjMGZhMWJlNmQ2Nzg1NjliNWViZTQyOGMyZmFmYjAzNGExZmEw
|
15
|
+
YTU5ZWE2ZjgzYjliNjk2YjA2MDM5ZGVmNTI1MmViYzZjNGJiYzY=
|
data/README.rdoc
CHANGED
@@ -26,7 +26,7 @@ The advantage is that the conversion engine is automatically identified, making
|
|
26
26
|
|
27
27
|
First you need define some doc wrappers
|
28
28
|
|
29
|
-
class DocWrapper
|
29
|
+
class DocWrapper::DocByTomCat
|
30
30
|
def self.to_target_doc a_doc
|
31
31
|
# -- here put you converter code
|
32
32
|
{
|
@@ -38,7 +38,7 @@ First you need define some doc wrappers
|
|
38
38
|
|
39
39
|
another doc wrapper:
|
40
40
|
|
41
|
-
class DocWrapper
|
41
|
+
class DocWrapper::DocByCook
|
42
42
|
def self.to_target_doc a_doc
|
43
43
|
# -- here put you converter code
|
44
44
|
{
|
@@ -55,5 +55,6 @@ another doc wrapper:
|
|
55
55
|
:004 > DocWrapper::Base.to_target_doc( { owner: 'cook', 'name' => 'Tom', 'food' => 'fish' } )
|
56
56
|
==> { name: 'Tom', main: 'fish' }
|
57
57
|
|
58
|
-
|
58
|
+
== Change log
|
59
|
+
* Add default options configurations
|
59
60
|
|
data/lib/doc_wrapper/base.rb
CHANGED
@@ -16,10 +16,16 @@ module DocWrapper::Base
|
|
16
16
|
private
|
17
17
|
|
18
18
|
def self.klass_name origem, opts={}
|
19
|
+
|
20
|
+
def_opts = Rails.configuration.doc_wrapper if Rails.configuration.respond_to? 'doc_wrapper'
|
21
|
+
|
22
|
+
opts = def_opts.merge(opts) if def_opts
|
23
|
+
|
19
24
|
modulle = "#{opts[:module].to_s.underscore}::" if opts[:module]
|
20
25
|
prefix = "#{opts[:prefix]}_" if opts[:prefix]
|
21
26
|
sufix = "_#{opts[:sufix]}" if opts[:sufix]
|
22
27
|
|
28
|
+
|
23
29
|
prefix = "DocBy" unless prefix
|
24
30
|
modulle = "DocWrapper::" unless modulle
|
25
31
|
|
data/lib/doc_wrapper/version.rb
CHANGED
@@ -19,6 +19,10 @@ module Dummy
|
|
19
19
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
20
20
|
# config.i18n.default_locale = :de
|
21
21
|
config.autoload_paths += Dir["#{config.root}/lib/**/"]
|
22
|
+
config.doc_wrapper = {
|
23
|
+
prefix: 'DocBy'
|
24
|
+
}
|
25
|
+
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ds_doc_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nardele salomon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
12
|
-
dependencies:
|
11
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
description: A doc converter to another doc. Doc is a data structure like a hash,
|
14
28
|
array or a simple string
|
15
29
|
email:
|
@@ -55,6 +69,7 @@ files:
|
|
55
69
|
- test/dummy/config/locales/en.yml
|
56
70
|
- test/dummy/config/routes.rb
|
57
71
|
- test/dummy/config/secrets.yml
|
72
|
+
- test/dummy/lib/doc_wrapper/company_by_tom_cat.rb
|
58
73
|
- test/dummy/lib/doc_wrapper/doc_by_tom_cat.rb
|
59
74
|
- test/dummy/log/development.log
|
60
75
|
- test/dummy/public/404.html
|
@@ -102,6 +117,7 @@ test_files:
|
|
102
117
|
- test/dummy/public/favicon.ico
|
103
118
|
- test/dummy/public/404.html
|
104
119
|
- test/dummy/log/development.log
|
120
|
+
- test/dummy/lib/doc_wrapper/company_by_tom_cat.rb
|
105
121
|
- test/dummy/lib/doc_wrapper/doc_by_tom_cat.rb
|
106
122
|
- test/dummy/config/application.rb
|
107
123
|
- test/dummy/config/locales/en.yml
|