oscal 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +15 -0
  3. data/.github/workflows/release.yml +24 -0
  4. data/.gitignore +11 -0
  5. data/.gitmodules +3 -0
  6. data/.hound.yml +5 -0
  7. data/.rubocop.yml +10 -0
  8. data/Gemfile +2 -0
  9. data/README.adoc +63 -0
  10. data/bin/console +30 -0
  11. data/bin/setup +8 -0
  12. data/exe/convert2oscalyaml.rb +560 -0
  13. data/lib/oscal/add.rb +25 -0
  14. data/lib/oscal/address.rb +21 -0
  15. data/lib/oscal/address_line.rb +10 -0
  16. data/lib/oscal/alter.rb +21 -0
  17. data/lib/oscal/back_matter.rb +19 -0
  18. data/lib/oscal/base64_object.rb +10 -0
  19. data/lib/oscal/base_class.rb +49 -0
  20. data/lib/oscal/catalog.rb +50 -10
  21. data/lib/oscal/choice.rb +10 -0
  22. data/lib/oscal/citation.rb +21 -0
  23. data/lib/oscal/combine.rb +10 -0
  24. data/lib/oscal/common_utils.rb +35 -0
  25. data/lib/oscal/constraint.rb +19 -0
  26. data/lib/oscal/control.rb +20 -31
  27. data/lib/oscal/custom.rb +21 -0
  28. data/lib/oscal/document_id.rb +10 -0
  29. data/lib/oscal/email_address.rb +10 -0
  30. data/lib/oscal/exclude_control.rb +21 -0
  31. data/lib/oscal/external_id.rb +10 -0
  32. data/lib/oscal/group.rb +26 -35
  33. data/lib/oscal/guideline.rb +10 -0
  34. data/lib/oscal/hash_object.rb +10 -0
  35. data/lib/oscal/import_object.rb +21 -0
  36. data/lib/oscal/include_control.rb +21 -0
  37. data/lib/oscal/insert_control.rb +21 -0
  38. data/lib/oscal/link.rb +10 -0
  39. data/lib/oscal/location.rb +30 -0
  40. data/lib/oscal/location_uuid.rb +10 -0
  41. data/lib/oscal/matching.rb +10 -0
  42. data/lib/oscal/member_of_organization.rb +10 -0
  43. data/lib/oscal/merge.rb +19 -0
  44. data/lib/oscal/metadata_block.rb +28 -14
  45. data/lib/oscal/modify.rb +21 -0
  46. data/lib/oscal/parameter.rb +22 -20
  47. data/lib/oscal/part.rb +13 -22
  48. data/lib/oscal/party.rb +35 -0
  49. data/lib/oscal/party_uuid.rb +10 -0
  50. data/lib/oscal/profile.rb +32 -7
  51. data/lib/oscal/property.rb +3 -25
  52. data/lib/oscal/remove.rb +10 -0
  53. data/lib/oscal/resource.rb +28 -0
  54. data/lib/oscal/responsible_party.rb +23 -0
  55. data/lib/oscal/revision.rb +22 -0
  56. data/lib/oscal/rlink.rb +19 -0
  57. data/lib/oscal/role.rb +21 -0
  58. data/lib/oscal/select.rb +19 -0
  59. data/lib/oscal/serializer.rb +17 -4
  60. data/lib/oscal/set_parameter.rb +30 -0
  61. data/lib/oscal/telephone_number.rb +10 -0
  62. data/lib/oscal/test.rb +10 -0
  63. data/lib/oscal/url.rb +10 -0
  64. data/lib/oscal/value.rb +36 -0
  65. data/lib/oscal/version.rb +1 -1
  66. data/lib/oscal/with_id.rb +39 -0
  67. data/lib/oscal.rb +1 -13
  68. data/oscal.gemspec +9 -11
  69. data/spec/oscal/catalog_spec.rb +39 -0
  70. data/spec/oscal_spec.rb +7 -0
  71. data/spec/spec_helper.rb +15 -0
  72. metadata +65 -9
  73. data/lib/oscal/component.rb +0 -14
  74. data/lib/oscal/prose.rb +0 -13
  75. data/lib/oscal/statement.rb +0 -12
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe Oscal do
4
+ it "has a version number" do
5
+ expect(Oscal::VERSION).not_to be nil
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "oscal"
4
+
5
+ RSpec.configure do |config|
6
+ # Enable flags like --only-failures and --next-failure
7
+ config.example_status_persistence_file_path = ".rspec_status"
8
+
9
+ # Disable RSpec exposing methods globally on `Module` and `main`
10
+ config.disable_monkey_patching!
11
+
12
+ config.expect_with :rspec do |c|
13
+ c.syntax = :expect
14
+ end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oscal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
- - Ronald Tse
7
+ - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-20 00:00:00.000000000 Z
11
+ date: 2023-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaml
@@ -26,38 +26,94 @@ dependencies:
26
26
  version: '0'
27
27
  description: Ruby library and parser for OSCAL models
28
28
  email:
29
- - ronald.tse@ribose.com
30
- executables: []
29
+ - open.source@ribose.com
30
+ executables:
31
+ - convert2oscalyaml.rb
31
32
  extensions: []
32
33
  extra_rdoc_files: []
33
34
  files:
35
+ - ".github/workflows/rake.yml"
36
+ - ".github/workflows/release.yml"
37
+ - ".gitignore"
38
+ - ".gitmodules"
39
+ - ".hound.yml"
34
40
  - ".rspec"
41
+ - ".rubocop.yml"
35
42
  - CODE_OF_CONDUCT.md
36
43
  - Gemfile
37
44
  - README.adoc
38
45
  - Rakefile
46
+ - bin/console
47
+ - bin/setup
48
+ - exe/convert2oscalyaml.rb
39
49
  - lib/oscal.rb
50
+ - lib/oscal/add.rb
51
+ - lib/oscal/address.rb
52
+ - lib/oscal/address_line.rb
53
+ - lib/oscal/alter.rb
54
+ - lib/oscal/back_matter.rb
55
+ - lib/oscal/base64_object.rb
56
+ - lib/oscal/base_class.rb
40
57
  - lib/oscal/catalog.rb
41
- - lib/oscal/component.rb
58
+ - lib/oscal/choice.rb
59
+ - lib/oscal/citation.rb
60
+ - lib/oscal/combine.rb
61
+ - lib/oscal/common_utils.rb
62
+ - lib/oscal/constraint.rb
42
63
  - lib/oscal/control.rb
64
+ - lib/oscal/custom.rb
65
+ - lib/oscal/document_id.rb
66
+ - lib/oscal/email_address.rb
67
+ - lib/oscal/exclude_control.rb
68
+ - lib/oscal/external_id.rb
43
69
  - lib/oscal/group.rb
70
+ - lib/oscal/guideline.rb
71
+ - lib/oscal/hash_object.rb
72
+ - lib/oscal/import_object.rb
73
+ - lib/oscal/include_control.rb
74
+ - lib/oscal/insert_control.rb
75
+ - lib/oscal/link.rb
76
+ - lib/oscal/location.rb
77
+ - lib/oscal/location_uuid.rb
78
+ - lib/oscal/matching.rb
79
+ - lib/oscal/member_of_organization.rb
80
+ - lib/oscal/merge.rb
44
81
  - lib/oscal/metadata_block.rb
82
+ - lib/oscal/modify.rb
45
83
  - lib/oscal/parameter.rb
46
84
  - lib/oscal/part.rb
85
+ - lib/oscal/party.rb
86
+ - lib/oscal/party_uuid.rb
47
87
  - lib/oscal/profile.rb
48
88
  - lib/oscal/property.rb
49
- - lib/oscal/prose.rb
89
+ - lib/oscal/remove.rb
90
+ - lib/oscal/resource.rb
91
+ - lib/oscal/responsible_party.rb
92
+ - lib/oscal/revision.rb
93
+ - lib/oscal/rlink.rb
94
+ - lib/oscal/role.rb
95
+ - lib/oscal/select.rb
50
96
  - lib/oscal/serializer.rb
51
- - lib/oscal/statement.rb
97
+ - lib/oscal/set_parameter.rb
98
+ - lib/oscal/telephone_number.rb
99
+ - lib/oscal/test.rb
100
+ - lib/oscal/url.rb
101
+ - lib/oscal/value.rb
52
102
  - lib/oscal/version.rb
103
+ - lib/oscal/with_id.rb
53
104
  - oscal.gemspec
54
105
  - sig/oscal.rbs
106
+ - spec/oscal/catalog_spec.rb
107
+ - spec/oscal_spec.rb
108
+ - spec/spec_helper.rb
55
109
  homepage: https://github.com/metanorma/oscal-ruby/
56
- licenses: []
110
+ licenses:
111
+ - BSD-2-Clause
57
112
  metadata:
58
113
  homepage_uri: https://github.com/metanorma/oscal-ruby/
59
114
  source_code_uri: https://github.com/metanorma/oscal-ruby/
60
115
  changelog_uri: https://github.com/metanorma/oscal-ruby/CHANGELOG
116
+ rubygems_mfa_required: 'true'
61
117
  post_install_message:
62
118
  rdoc_options: []
63
119
  require_paths:
@@ -1,14 +0,0 @@
1
- module Oscal
2
- class Component
3
- attr_accessor :id, :name, :type, :description, :properties
4
-
5
- def initialize(id, name, type, description, properties)
6
- @id = id
7
- @name = name
8
- @type = type
9
- @description = description
10
- @properties = properties
11
- end
12
- end
13
-
14
- end
data/lib/oscal/prose.rb DELETED
@@ -1,13 +0,0 @@
1
- require_relative "serializer"
2
-
3
- module Oscal
4
- class Prose
5
- include Serializer
6
-
7
- attr_serializable :value, :media_type
8
-
9
- def to_xml(builder)
10
- builder.prose(value, {'media-type' => media_type})
11
- end
12
- end
13
- end
@@ -1,12 +0,0 @@
1
- module Oscal
2
- class Statement
3
- attr_accessor :description, :prose, :properties
4
-
5
- def initialize(description, prose, properties)
6
- @description = description
7
- @prose = prose
8
- @properties = properties
9
- end
10
- end
11
-
12
- end