sdl-ng 0.0.2 → 0.0.3
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 +4 -4
- data/examples/translations/en.yml +6 -2
- data/lib/sdl.rb +1 -1
- data/lib/sdl/base/type.rb +4 -0
- data/lib/sdl/exporters/markdown_service_exporter.rb +25 -1
- data/lib/sdl/ng/version.rb +1 -1
- data/lib/sdl/translations/en.yml +2 -0
- data/lib/sdl/util/documentation.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c497f1c651686544ac76c0bef8a35a7985d06890
|
|
4
|
+
data.tar.gz: afed6c73a2b9b35c1a99dbdf1a6dc72c1e49a87b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4e00d32bc7abf06443de8d8963388ad508972ed3fa3154ce74c5a183e1bd0b47d8fb9e484219d1b53d3522d88602a7127c0ec9f6a7aa4ff6804a87cf792d8b7
|
|
7
|
+
data.tar.gz: 29fe5546a275bc0be41b44094004cccfe95006907d6de86e0a07378089a5af7e0f0d618e335163780e6a189f5a37e0fd51153be3224c6feb58085e964280eb40
|
|
@@ -21,7 +21,7 @@ en:
|
|
|
21
21
|
data_location: The service offers to locate service data at runtime
|
|
22
22
|
data_location_transparency: The provider makes the location of service data
|
|
23
23
|
transparent
|
|
24
|
-
documentation:
|
|
24
|
+
documentation: The service has public documentation
|
|
25
25
|
duration: Generic duration of something.
|
|
26
26
|
duration_provision_end_user_duration: The duration for provisioning an end user.
|
|
27
27
|
duration_set_up_consumption_duration: The duration for setting up the service.
|
|
@@ -35,7 +35,7 @@ en:
|
|
|
35
35
|
maintenance: The service has maintenance information
|
|
36
36
|
maintenance_maintenance_free: The service is maintenance free
|
|
37
37
|
maintenance_maintenance_window: The service has a maintenance window
|
|
38
|
-
name:
|
|
38
|
+
name: ''
|
|
39
39
|
offline_capability: Service functionality can be used offline
|
|
40
40
|
payment_option: The service can be payed by a payment option, e.g. credit card.
|
|
41
41
|
service_category: The service belongs to a category
|
|
@@ -45,6 +45,10 @@ en:
|
|
|
45
45
|
service_tag: The service is tagged
|
|
46
46
|
status_page: The service has a status page
|
|
47
47
|
instance:
|
|
48
|
+
fact:
|
|
49
|
+
add_on_repository: "There are #{number_of_add_ons} add-ons available at #{url}"
|
|
50
|
+
documentation: "The documentation URL is #{url}"
|
|
51
|
+
name: "The service name is: #{name}"
|
|
48
52
|
type:
|
|
49
53
|
billing_term:
|
|
50
54
|
annually: Annually billing
|
data/lib/sdl.rb
CHANGED
data/lib/sdl/base/type.rb
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
|
+
require 'active_support/i18n'
|
|
2
|
+
|
|
1
3
|
class SDL::Exporters::MarkdownServiceExporter < SDL::Exporters::ServiceExporter
|
|
2
4
|
def export_service(service)
|
|
3
|
-
|
|
5
|
+
buf = StringIO.new
|
|
6
|
+
|
|
7
|
+
buf.puts I18n.t('sdl.markdown.header')
|
|
8
|
+
|
|
9
|
+
service.facts.each do |fact|
|
|
10
|
+
indent = 0
|
|
11
|
+
|
|
12
|
+
unless fact.class.documentation.empty?
|
|
13
|
+
buf.puts "* #{fact.class.documentation}"
|
|
14
|
+
|
|
15
|
+
indent = 2
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
buf.puts "#{' '* indent}* #{fact.documentation}#{fact.annotated? ? " (#{fact.annotations.join(', ')})" : ''}"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
buf.string
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def export_property_descriptions(property_holder, indentation = 0, buf)
|
|
25
|
+
property_holder.property_values.each do |property, value|
|
|
26
|
+
buf.puts("#{' '*indentation}* #{property.documentation}")
|
|
27
|
+
end
|
|
4
28
|
end
|
|
5
29
|
end
|
data/lib/sdl/ng/version.rb
CHANGED
data/lib/sdl/translations/en.yml
CHANGED
|
@@ -38,7 +38,13 @@ module SDL
|
|
|
38
38
|
|
|
39
39
|
def documentation
|
|
40
40
|
if self.respond_to?(:documentation_key)
|
|
41
|
-
I18n.t(documentation_key)
|
|
41
|
+
documentation = I18n.t(documentation_key)
|
|
42
|
+
|
|
43
|
+
if documentation =~ /#\{.*\}/
|
|
44
|
+
eval '"' + I18n.t(documentation_key) + '"', binding
|
|
45
|
+
else
|
|
46
|
+
documentation
|
|
47
|
+
end
|
|
42
48
|
end
|
|
43
49
|
end
|
|
44
50
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sdl-ng
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mathias Slawik
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-12-
|
|
11
|
+
date: 2013-12-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|