ds_doc_wrapper 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGM3Mzg3ZWMzNzI1OWZhYzNhZDZhMGVlZmNkODc1ZjQ3MDRlYWFlMQ==
4
+ ZTBlOGY4MzMzMDQyOWNkYzcwMGQ5NTY1YmZjZjcxZjIwNDYzMzZhNQ==
5
5
  data.tar.gz: !binary |-
6
- Mzk1NmQ0OTliODFmNzM3MTY2ZjY0ODhiNmNhNWYwMWI4MjRkOGMzNQ==
6
+ ZjdmM2ZmN2JiYjE5YTdhYTQ0Mzk2MzMwMjRkM2E4OTJjZDU3NGUyYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjBlNDhiZDAyYTc4MjNkYTZiMjE4YjA3ZjUxOTA2YTY0ZTU5ZDgxOTk1MGE2
10
- Nzk0ZjViMmU4ZjBkMzJkNjNhMmI0MGE4YzJlMzBkODFkZjU4MzBjMzI3ZGM3
11
- YzRkOGI5YTlmZTk2NmQ0MDQ2ZDM5ODFhNTMzMzU0MzE1ZjgzZDc=
9
+ NmE4YzFmMjFhOWY3NWNkZjU5NTRiMmMyNjRlMTNkZTViNTExMTQ3MGRkOGU2
10
+ YTU1NjZmMzI1MDBmMmY3NTRhMTM3NGE0OTkxMzQ3MjMxMDY3ZTNhM2EzNTBj
11
+ MDcxMWJkZjFlYWUxN2VmYzU4Y2M3Mjc4OTUzOGI0N2FlYjdkODU=
12
12
  data.tar.gz: !binary |-
13
- MWJhZjI4ZTI5NWVjMjgwMGUzODA1YzdlODAxYWE4YjZjODc5MTk4MTQ0Y2M3
14
- NmY1M2Q5NGEwYzU0ZmQwM2YyN2JhZmE0MDllY2M5NjdjY2ZjZmYwODRjZWI3
15
- OTVkZGRhMjExMGZjN2U4ZTYxNzk4ZTE0Y2E4MDE0NDkwNWNiZDk=
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:DocByTomCat
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:DocByCook
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
 
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module DocWrapper
2
- VERSION = "1.0.4"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -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
 
@@ -0,0 +1,11 @@
1
+ class DocWrapper::CompanyByTomCat
2
+
3
+ def self.to_target_doc src
4
+ {
5
+ tom: 'is a cat',
6
+ jerry: src[:rat],
7
+ status: 'company by'
8
+ }
9
+ end
10
+
11
+ end
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
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-04 00:00:00.000000000 Z
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