activeyaml 0.1.1 → 0.1.4

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: 05b46532e76e8c768208126f531178f16b50f1adaa0adbc09eb1194aaafb7ccc
4
- data.tar.gz: '02019d5c54f428f18683ec8be883d1204f972e765704a6e7e3b43e158492572a'
3
+ metadata.gz: 2a0ae13d0234df31efaf43a77ce974bc1c51fc250a1172ec6b0e3d01ecbc63cb
4
+ data.tar.gz: 941f51b22c2da9e192797caaf0c332979743f87ce640c1526a41bcec843f6bb9
5
5
  SHA512:
6
- metadata.gz: fd3b5ce708a296948f33a69098544b857f0e61bfe84136566ef3aa7c197ca874fc47add9934057f51bfe5ae54ee8f99f1845bbbe2a1790f5c1acb3c03a895481
7
- data.tar.gz: ff652618b9b2aeaf9706443735513740d5414e8bd4b7009d170c48815821ea92818bc30636619b7d0d145f289f5eceb939bd0c4030c87142acbb7f69a817cd22
6
+ metadata.gz: 52542244c4b5b9524817c7ae501918a7c3c52c5ef44e2c1ae71e26b960f7418a1bd753af511a4f287a0ed4fe6eaddfdc27864c37b7fb09d9e42b7320759e3cb3
7
+ data.tar.gz: 4fe3c6de770022c413026f56a53aec1f1b642384490c181654630b90f25c7375000ed0a5730c86e496a81eb90f9db718e3625e05320eae857ba0953a77bd8a92
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveYaml
4
+ # base mapper
5
+ class MethodMapper
6
+ def initialize; end
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'psych'
4
+
5
+ module ActiveYaml
6
+ # base parser
7
+ class Parser
8
+ def self.parse(file_path)
9
+ Psych.safe_load_file(file_path)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveYaml
4
+ VERSION = '0.1.4'
5
+ end
data/lib/active_yaml.rb CHANGED
@@ -1,8 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # main
4
- class ActiveYaml
5
- def self.hello
6
- 'hello'
3
+ require_relative 'active_yaml/parser'
4
+ require_relative 'active_yaml/method_mapper'
5
+
6
+ module ActiveYaml
7
+ # base
8
+ class Base < MethodMapper
9
+ def self.yaml(file_path)
10
+ define_method(:yaml_file_path) do
11
+ @yaml_file_path = yaml_file_path
12
+ end
13
+
14
+ define_method(:yaml_data) do
15
+ @yaml_data = Parser.parse(file_path)
16
+ end
17
+ end
7
18
  end
8
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeyaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Leonov
@@ -9,14 +9,31 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2023-11-30 00:00:00.000000000 Z
12
- dependencies: []
13
- description: activeyaml
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: psych
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.1'
27
+ description: framework for convenient and complete work with Yaml files
14
28
  email: leonov7632@gmail.com
15
29
  executables: []
16
30
  extensions: []
17
31
  extra_rdoc_files: []
18
32
  files:
19
33
  - lib/active_yaml.rb
34
+ - lib/active_yaml/method_mapper.rb
35
+ - lib/active_yaml/parser.rb
36
+ - lib/active_yaml/version.rb
20
37
  homepage: https://github.com/leonovk/activeyaml
21
38
  licenses:
22
39
  - MIT
@@ -39,8 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
56
  - !ruby/object:Gem::Version
40
57
  version: '0'
41
58
  requirements: []
42
- rubygems_version: 3.4.22
59
+ rubygems_version: 3.4.10
43
60
  signing_key:
44
61
  specification_version: 4
45
- summary: activeyaml
62
+ summary: yaml object-relational mapping
46
63
  test_files: []