sdl-ng 0.0.4 → 0.0.5
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/lib/sdl.rb +18 -7
- data/lib/sdl/base.rb +7 -6
- data/lib/sdl/base/fact.rb +7 -11
- data/lib/sdl/base/property.rb +22 -26
- data/lib/sdl/base/service.rb +8 -12
- data/lib/sdl/base/service_compendium.rb +97 -109
- data/lib/sdl/base/type.rb +62 -68
- data/lib/sdl/exporters.rb +13 -9
- data/lib/sdl/exporters/exporter.rb +10 -14
- data/lib/sdl/exporters/markdown_service_exporter.rb +0 -2
- data/lib/sdl/exporters/rdf_exporter.rb +17 -21
- data/lib/sdl/exporters/rdf_mapping.rb +0 -1
- data/lib/sdl/exporters/schema_exporter.rb +3 -7
- data/lib/sdl/exporters/service_exporter.rb +4 -8
- data/lib/sdl/exporters/xml_service_exporter.rb +22 -26
- data/lib/sdl/exporters/xsd_schema_exporter.rb +65 -70
- data/lib/sdl/ng/version.rb +1 -1
- data/lib/sdl/receivers.rb +7 -6
- data/lib/sdl/receivers/fact_receiver.rb +8 -12
- data/lib/sdl/receivers/service_receiver.rb +41 -47
- data/lib/sdl/receivers/type_instance_receiver.rb +67 -73
- data/lib/sdl/receivers/type_receiver.rb +72 -76
- data/lib/sdl/types.rb +15 -9
- data/lib/sdl/types/sdl_datetime.rb +4 -8
- data/lib/sdl/types/sdl_description.rb +6 -10
- data/lib/sdl/types/sdl_duration.rb +4 -8
- data/lib/sdl/types/sdl_number.rb +4 -8
- data/lib/sdl/types/sdl_simple_type.rb +13 -6
- data/lib/sdl/types/sdl_string.rb +4 -8
- data/lib/sdl/types/sdl_type.rb +20 -24
- data/lib/sdl/types/sdl_url.rb +9 -13
- data/lib/sdl/util.rb +1 -0
- metadata +2 -2
data/lib/sdl/types/sdl_string.rb
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
class SDLString < SDLSimpleType
|
4
|
-
include SDLType
|
1
|
+
class SDL::Types::SDLString < SDL::Types::SDLSimpleType
|
2
|
+
include SDL::Types::SDLType
|
5
3
|
|
6
|
-
|
7
|
-
|
8
|
-
end
|
9
|
-
end
|
4
|
+
wraps String
|
5
|
+
codes :string, :str
|
10
6
|
end
|
data/lib/sdl/types/sdl_type.rb
CHANGED
@@ -1,31 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
base.extend ClassMethods
|
8
|
-
end
|
1
|
+
##
|
2
|
+
# An SDLType is a wrapper around a basic Ruby type
|
3
|
+
module SDL::Types::SDLType
|
4
|
+
def self.included(base)
|
5
|
+
base.extend ClassMethods
|
6
|
+
end
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
module ClassMethods
|
9
|
+
## The Ruby type, which is to be wrapped
|
10
|
+
attr :wrapped_type
|
13
11
|
|
14
|
-
|
15
|
-
|
12
|
+
## The codes, which are to be used to refer to this type
|
13
|
+
attr :codes
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
##
|
16
|
+
# Sets the wrapped Ruby type
|
17
|
+
def wraps(type)
|
18
|
+
@wrapped_type = type
|
19
|
+
end
|
22
20
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
28
|
-
end
|
21
|
+
##
|
22
|
+
# Registers the codes +symbols+ to be used to refer to this type
|
23
|
+
def codes(*symbols)
|
24
|
+
@codes = symbols
|
29
25
|
end
|
30
26
|
end
|
31
27
|
end
|
data/lib/sdl/types/sdl_url.rb
CHANGED
@@ -1,20 +1,16 @@
|
|
1
1
|
require 'uri'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
class SDLUrl < SDLSimpleType
|
6
|
-
include SDLType
|
3
|
+
class SDL::Types::SDLUrl < SDL::Types::SDLSimpleType
|
4
|
+
include SDL::Types::SDLType
|
7
5
|
|
8
|
-
|
9
|
-
|
6
|
+
wraps URI
|
7
|
+
codes :uri, :url
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
9
|
+
def from_string(string_value)
|
10
|
+
begin
|
11
|
+
URI.parse string_value
|
12
|
+
rescue URI::InvalidURIError
|
13
|
+
throw "Invalid URI: #{string_value}"
|
18
14
|
end
|
19
15
|
end
|
20
16
|
end
|
data/lib/sdl/util.rb
CHANGED
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathias Slawik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|