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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fea35efb55526a9769f4a8ef6b9c82c0c7c8dda2
4
- data.tar.gz: e76d9dcacb29a806e1deac2bafec0d668461a21d
3
+ metadata.gz: c497f1c651686544ac76c0bef8a35a7985d06890
4
+ data.tar.gz: afed6c73a2b9b35c1a99dbdf1a6dc72c1e49a87b
5
5
  SHA512:
6
- metadata.gz: 7f0c4b887d3233bb0baf287114793aacd92ef6866bc96939f34c832f8bbd565f1eaac15d4210f4a6e075d09e68a0c70f730c87f190bf1a7cb89d39dff1b71c22
7
- data.tar.gz: 4eeacdfbbfa4fad7de47207378800574d8f202e66d522e25d9353ed41c391a9ff8dde599ea30aac1f02008b458bc4a2a8526d8d8cdfbb7be6931114798b4feee
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: Some service 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: The service has a 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
@@ -5,7 +5,7 @@ require_relative 'sdl/receivers'
5
5
  require_relative 'sdl/types'
6
6
  require_relative 'sdl/exporters'
7
7
  require_relative 'sdl/util'
8
- require_relative 'sdl/version'
8
+ require_relative 'sdl/ng/version'
9
9
 
10
10
  ##
11
11
  #
data/lib/sdl/base/type.rb CHANGED
@@ -55,6 +55,10 @@ module SDL
55
55
  end
56
56
  end
57
57
 
58
+ def annotated?
59
+ ! @annotations.blank?
60
+ end
61
+
58
62
  def annotations
59
63
  @annotations ||= []
60
64
  end
@@ -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
- "Not implemented yet"
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
@@ -1,5 +1,5 @@
1
1
  module SDL
2
2
  module NG
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  en:
3
3
  sdl:
4
+ markdown:
5
+ header: "The following facts are known about the service:"
4
6
  xml:
5
7
  annotation: An arbitrary annotation to be displayed for the description consumer.
6
8
  documentation: The documentation of this type or fact instance.
@@ -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.2
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-15 00:00:00.000000000 Z
11
+ date: 2013-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport