ossy 0.3.7 → 0.4.1

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
  SHA256:
3
- metadata.gz: d8fd096708475709d09b7e44af58dc0a02c025cb2fadb90ed3b9866df03c178e
4
- data.tar.gz: 696b429e62e52b1d6458b1fc1fc759487e866ddcf386b385ea528cd4a81438c5
3
+ metadata.gz: a5c687dc7cca174381ce1eec36f7c1b4598ac627276b760fbfe2621bd0b908c6
4
+ data.tar.gz: 89fd2699ac7f18642c01b6b5c5f83436dc45bed6e6083cebe14e2b66a3796e97
5
5
  SHA512:
6
- metadata.gz: cc081064f3880660818c2de42a1fd16fea7dac0cfa515b2bb75234a971c8807966cb183750f7fb74736b27c2c4a0ca20b22e5443d4b97100fb85ec8bf06b44bc
7
- data.tar.gz: 4096088291ddcbaa12628a3801484fbd6a3922b38e4b9b5075f17415769c321f41f40b06600f690982d7730c35d205a686f0cb45762aef818bc8727f44b1deef
6
+ metadata.gz: e06886aeac5e3a56bc637f3da848196957da4f10622370480fca01945da993d4295377c8a5c580c0269427feb0def4bf533e26bfdf5f0bd5ac55f6e03be8bf40
7
+ data.tar.gz: 837c6010f2b011d7adcedb1c22c6cf56fb5231054eee11e612df772fd4c0ac77a4ab82ebeb03891f25e0a54596142d116182704b803d04d908c300fa3e1597f1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.4.0 2022-11-23
2
+
3
+ ### Changed
4
+
5
+ - Migrate to 1.0 of dry-system and its deps (@flash-gordon)
6
+
1
7
  ## 0.2.0 2021-01-02
2
8
 
3
9
  ### Added
@@ -42,4 +48,3 @@ The first public release!
42
48
  - `ossy changelogs` - commands for updating `CHANGELOG` files automatically based on a YAML config
43
49
  - `ossy configs` - commands for merging YAML configs
44
50
  - `ossy templates` - commands for compiling `erb` templates
45
-
@@ -34,14 +34,14 @@ module Ossy
34
34
  def call(config_path:, output_path:, template_path:, data_path: nil)
35
35
  puts "Generating #{output_path} from #{config_path} using #{template_path}"
36
36
 
37
- ctx_data = YAML.load_file(config_path)
37
+ ctx_data = YAML.load_file(config_path, permitted_classes: [Date])
38
38
  template = Tilt.new(template_path)
39
39
 
40
40
  context = Context.new(ctx_data)
41
41
 
42
42
  if data_path
43
43
  key = File.basename(data_path).gsub(".yml", "")
44
- data = YAML.load_file(data_path)
44
+ data = YAML.load_file(data_path, permitted_classes: [Date])
45
45
 
46
46
  context.update(key => OpenStruct.new(data))
47
47
  end
@@ -20,7 +20,7 @@ module Ossy
20
20
 
21
21
  def call(config_path:, message:)
22
22
  attrs = YAML.safe_load(message)
23
- target = YAML.load_file(config_path)
23
+ target = YAML.load_file(config_path, permitted_classes: [Date])
24
24
 
25
25
  version = attrs["version"] || target[0]["version"]
26
26
  entry = target.detect { |e| e["version"].eql?(version) } || {}
@@ -23,8 +23,8 @@ module Ossy
23
23
 
24
24
  identifiers = opts[:identifiers].split(",").map { |s| s.split(":") }.to_h
25
25
 
26
- source = YAML.load_file(source_path)
27
- target = YAML.load_file(target_path)
26
+ source = YAML.load_file(source_path, permitted_classes: [Date])
27
+ target = YAML.load_file(target_path, permitted_classes: [Date])
28
28
 
29
29
  output = deep_merge(source, target, identifiers)
30
30
 
@@ -42,14 +42,14 @@ module Ossy
42
42
  def call(config_path:, output_path:, template_path:, data_path: nil)
43
43
  puts "Generating #{output_path} from #{config_path} using #{template_path}"
44
44
 
45
- ctx_data = YAML.load_file(config_path)
45
+ ctx_data = YAML.load_file(config_path, permitted_classes: [Date])
46
46
  template = Tilt.new(template_path)
47
47
 
48
48
  context = Context.new(ctx_data)
49
49
 
50
50
  if data_path
51
51
  key = File.basename(data_path).gsub(".yml", "")
52
- data = YAML.load_file(data_path)
52
+ data = YAML.load_file(data_path, permitted_classes: [Date])
53
53
 
54
54
  context.update(key => OpenStruct.new(data))
55
55
  end
@@ -34,7 +34,7 @@ module Ossy
34
34
  def call(source_path:, target_path:, data_file:)
35
35
  puts "Compiling #{source_path} => #{target_path}"
36
36
 
37
- data = YAML.load_file(data_file)
37
+ data = YAML.load_file(data_file, permitted_classes: [Date])
38
38
  template = Tilt.new(source_path)
39
39
  output = template.render(Context.new(data))
40
40
 
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "dry/system"
3
4
  require "dry/system/container"
4
- require "dry/system/components"
5
+ require "dry/system/provider_sources"
5
6
 
6
7
  require "ossy/types"
7
8
 
@@ -12,15 +13,18 @@ module Ossy
12
13
  configure do |config|
13
14
  config.root = Pathname(__dir__).join("../../")
14
15
  config.name = :ossy
15
- config.default_namespace = "ossy"
16
+
17
+ config.component_dirs.add "lib" do |dir|
18
+ dir.namespaces.add "ossy", key: nil
19
+ end
16
20
  end
17
21
 
18
- load_paths! "lib"
22
+ add_to_load_path! "lib"
19
23
 
20
- boot(:settings, from: :system) do
24
+ register_provider(:settings, from: :dry_system) do
21
25
  settings do
22
- key :github_login, Types::String.constrained(filled: true)
23
- key :github_token, Types::String.constrained(filled: true)
26
+ setting :github_login, constructor: Types::String.constrained(filled: true)
27
+ setting :github_token, constructor: Types::String.constrained(filled: true)
24
28
  end
25
29
  end
26
30
  end
data/lib/ossy/import.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "ossy/container"
3
+ require "ossy"
4
4
 
5
5
  module Ossy
6
6
  Import = Container.injector
data/lib/ossy/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ossy
4
- VERSION = "0.3.7"
4
+ VERSION = "0.4.1"
5
5
  end
data/lib/ossy.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "ossy/version"
4
+ require "ossy/container"
4
5
 
5
6
  module Ossy
6
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ossy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-15 00:00:00.000000000 Z
11
+ date: 2022-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-core
@@ -16,148 +16,89 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '0.9'
19
+ version: '1.0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.8'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '0.9'
26
+ version: '1.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: dry-cli
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '0.5'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.5.1
33
+ version: '1.0'
43
34
  type: :runtime
44
35
  prerelease: false
45
36
  version_requirements: !ruby/object:Gem::Requirement
46
37
  requirements:
47
38
  - - "~>"
48
39
  - !ruby/object:Gem::Version
49
- version: '0.5'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.5.1
40
+ version: '1.0'
53
41
  - !ruby/object:Gem::Dependency
54
42
  name: dry-inflector
55
43
  requirement: !ruby/object:Gem::Requirement
56
44
  requirements:
57
45
  - - "~>"
58
46
  - !ruby/object:Gem::Version
59
- version: '0.1'
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: 0.1.2
47
+ version: '1.0'
63
48
  type: :runtime
64
49
  prerelease: false
65
50
  version_requirements: !ruby/object:Gem::Requirement
66
51
  requirements:
67
52
  - - "~>"
68
53
  - !ruby/object:Gem::Version
69
- version: '0.1'
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- version: 0.1.2
54
+ version: '1.0'
73
55
  - !ruby/object:Gem::Dependency
74
56
  name: dry-struct
75
57
  requirement: !ruby/object:Gem::Requirement
76
58
  requirements:
77
59
  - - "~>"
78
60
  - !ruby/object:Gem::Version
79
- version: '1.2'
80
- - - "<="
81
- - !ruby/object:Gem::Version
82
- version: '1.4'
83
- type: :runtime
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.2'
90
- - - "<="
91
- - !ruby/object:Gem::Version
92
- version: '1.4'
93
- - !ruby/object:Gem::Dependency
94
- name: dry-container
95
- requirement: !ruby/object:Gem::Requirement
96
- requirements:
97
- - - "~>"
98
- - !ruby/object:Gem::Version
99
- version: '0.8'
100
- - - "<="
101
- - !ruby/object:Gem::Version
102
- version: '0.8'
61
+ version: '1.6'
103
62
  type: :runtime
104
63
  prerelease: false
105
64
  version_requirements: !ruby/object:Gem::Requirement
106
65
  requirements:
107
66
  - - "~>"
108
67
  - !ruby/object:Gem::Version
109
- version: '0.8'
110
- - - "<="
111
- - !ruby/object:Gem::Version
112
- version: '0.8'
68
+ version: '1.6'
113
69
  - !ruby/object:Gem::Dependency
114
70
  name: dry-configurable
115
71
  requirement: !ruby/object:Gem::Requirement
116
72
  requirements:
117
73
  - - "~>"
118
74
  - !ruby/object:Gem::Version
119
- version: '0.12'
120
- - - "<"
121
- - !ruby/object:Gem::Version
122
- version: '0.13'
75
+ version: '1.0'
123
76
  type: :runtime
124
77
  prerelease: false
125
78
  version_requirements: !ruby/object:Gem::Requirement
126
79
  requirements:
127
80
  - - "~>"
128
81
  - !ruby/object:Gem::Version
129
- version: '0.12'
130
- - - "<"
131
- - !ruby/object:Gem::Version
132
- version: '0.13'
82
+ version: '1.0'
133
83
  - !ruby/object:Gem::Dependency
134
84
  name: dry-system
135
85
  requirement: !ruby/object:Gem::Requirement
136
86
  requirements:
137
87
  - - "~>"
138
88
  - !ruby/object:Gem::Version
139
- version: 0.18.1
140
- - - "<"
141
- - !ruby/object:Gem::Version
142
- version: '0.19'
89
+ version: '1.0'
143
90
  type: :runtime
144
91
  prerelease: false
145
92
  version_requirements: !ruby/object:Gem::Requirement
146
93
  requirements:
147
94
  - - "~>"
148
95
  - !ruby/object:Gem::Version
149
- version: 0.18.1
150
- - - "<"
151
- - !ruby/object:Gem::Version
152
- version: '0.19'
96
+ version: '1.0'
153
97
  - !ruby/object:Gem::Dependency
154
98
  name: dry-types
155
99
  requirement: !ruby/object:Gem::Requirement
156
100
  requirements:
157
101
  - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '1.2'
160
- - - "<"
161
102
  - !ruby/object:Gem::Version
162
103
  version: '1.6'
163
104
  type: :runtime
@@ -165,9 +106,6 @@ dependencies:
165
106
  version_requirements: !ruby/object:Gem::Requirement
166
107
  requirements:
167
108
  - - "~>"
168
- - !ruby/object:Gem::Version
169
- version: '1.2'
170
- - - "<"
171
109
  - !ruby/object:Gem::Version
172
110
  version: '1.6'
173
111
  - !ruby/object:Gem::Dependency