ree 1.0.39 → 1.0.41

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c82febb352bce1cb674d2b77cac4aeb8f8b1a1fcaa5fa81adae56d2e62bdb20
4
- data.tar.gz: d23d1f28309cd3650cd90cd93bb1261011a36359c3fc6096bf8d7945fd9a8598
3
+ metadata.gz: c3718d079d89d559261699484fcf0386395bcd8f9aad0faa9aaa81dbd77f8b22
4
+ data.tar.gz: f2ce896f83ea0f670a5a17279f84abbab3bbcb296cb90c58e4b367d827deed8a
5
5
  SHA512:
6
- metadata.gz: 23819cdc3a1b4d81cbb57baa3946526138baf1662a297522f4ef8e9d4c1377bc311852d1179be445c8cfcea760660e107b97dfffa882b00a70b3b7933e3a5a9e
7
- data.tar.gz: ce36b46fbd0fdffc547020e18eb0ee390f6a84f90150ba1bc3c3f80f59bb781d668008f852b7c47830f9a9dcd83ec59407c720024fe47c2ea8638c06b0cd987f
6
+ metadata.gz: 368cbacf27970b8df6f0e4f7e527f2ef551b09660714464a33fb788b54672ab7b09ea22863e9ddd9c0ef2f5e44bface5bcfe0b1ea74d70d2cca60db1b62fcf43
7
+ data.tar.gz: 011c48a7763e2fe8ca22830322402d41af35bd78e1794b11f320808800fd610a4d01ba35de4df0903353bfcc1b261b88991cf58caef71d6dfa6ae954417f4d07
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree (1.0.39)
4
+ ree (1.0.41)
5
5
  commander (~> 5.0.0)
6
6
 
7
7
  GEM
data/exe/ree CHANGED
@@ -140,58 +140,6 @@ class ReeCliRunner
140
140
  end
141
141
  end
142
142
 
143
- command :"gen.schema_json" do |c|
144
- c.syntax = 'ree gen.schema_json PACKAGE_NAME OBJECT_PATH'
145
- c.description = 'generates Schema.json for specified object in specified package'
146
- c.summary = '> ' + c.description
147
- c.example 'ree gen.schema_json accounts commands/create_account_cmd.rb', ''
148
- c.option '--silence', String, 'Silence all logs'
149
- c.option '--project_path [ROOT_PROJECT_DIR]', String, 'Root project dir path'
150
- c.action do |args, options|
151
- package_name = args[0]
152
- object_path = args[1]
153
- options_hash = options.__hash__
154
-
155
- if options_hash[:project_path]
156
- options_hash[:project_path] = File.expand_path(options_hash[:project_path])
157
- end
158
-
159
- default_options = {
160
- package_name: package_name,
161
- object_path: object_path,
162
- project_path: options_hash[:project_path] || File.expand_path(Dir.pwd),
163
- silence: options_hash.has_key?(:silence)
164
- }
165
-
166
- Ree::CLI::GenerateObjectSchema.run(**default_options)
167
- end
168
- end
169
-
170
- command :"delete.schema_json" do |c|
171
- c.syntax = 'ree delete.schema_json OBJECT_PATH'
172
- c.description = 'removes Schema.json for specified object '
173
- c.summary = '> ' + c.description
174
- c.example 'ree delete.schema_json commands/create_account_cmd.rb', ''
175
- c.option '--silence', String, 'Silence all logs'
176
- c.option '--project_path [ROOT_PROJECT_DIR]', String, 'Root project dir path'
177
- c.action do |args, options|
178
- object_path = args[0]
179
- options_hash = options.__hash__
180
-
181
- if options_hash[:project_path]
182
- options_hash[:project_path] = File.expand_path(options_hash[:project_path])
183
- end
184
-
185
- default_options = {
186
- object_path: object_path,
187
- project_path: options_hash[:project_path] || File.expand_path(Dir.pwd),
188
- silence: options_hash.has_key?(:silence)
189
- }
190
-
191
- Ree::CLI::DeleteObjectSchema.run(**default_options)
192
- end
193
- end
194
-
195
143
  command :"gen.template" do |c|
196
144
  c.syntax = "ree gen.template TEMPLATE_NAME [options]"
197
145
  c.description = "generates template from ROOT/.ree/templates folder with specified variables"
data/lib/ree/cli.rb CHANGED
@@ -5,8 +5,6 @@ module Ree
5
5
  autoload :Init, 'ree/cli/init'
6
6
  autoload :GeneratePackagesSchema, 'ree/cli/generate_packages_schema'
7
7
  autoload :GeneratePackageSchema, 'ree/cli/generate_package_schema'
8
- autoload :GenerateObjectSchema, 'ree/cli/generate_object_schema'
9
- autoload :DeleteObjectSchema, 'ree/cli/delete_object_schema'
10
8
  autoload :GeneratePackage, 'ree/cli/generate_package'
11
9
  autoload :GenerateTemplate, 'ree/cli/generate_template'
12
10
  autoload :Indexing, 'ree/cli/indexing'
@@ -82,40 +82,29 @@ class Ree::ObjectCompiler
82
82
  end
83
83
 
84
84
  if object.factory || object.singleton
85
- eval_list.push(indent + "def self.new(**kwargs)")
85
+ eval_list.push(indent + "def self.new")
86
86
 
87
87
  if object.singleton
88
88
  eval_list.push(indent + " SEMAPHORE.synchronize do")
89
- eval_list.push(indent + " obj_links = #{links.map(&:as).inspect}")
90
- eval_list.push(indent + " if (obj_links & kwargs.keys).size == 0")
91
- eval_list.push(indent + " @__instance ||= begin")
89
+ eval_list.push(indent + " @__instance ||= begin")
92
90
 
93
91
  if object.factory
94
- eval_list.push(indent + " super(**kwargs).#{object.factory}")
92
+ eval_list.push(indent + " super.#{object.factory}")
95
93
  else
96
- eval_list.push(indent + " super(**kwargs)")
97
- end
98
-
99
- eval_list.push(indent + " end")
100
- eval_list.push(indent + " else")
101
-
102
- if object.factory
103
- eval_list.push(indent + " super(**kwargs).#{object.factory}")
104
- else
105
- eval_list.push(indent + " super(**kwargs)")
94
+ eval_list.push(indent + " super")
106
95
  end
107
96
 
108
97
  eval_list.push(indent + " end")
109
98
  eval_list.push(indent + " end")
110
99
  else
111
- eval_list.push(indent + " super(**kwargs).#{object.factory}")
100
+ eval_list.push(indent + " super.#{object.factory}")
112
101
  end
113
102
 
114
103
  eval_list.push(indent + "end")
115
104
  end
116
105
 
117
106
  eval_list.push("\n")
118
- eval_list.push(indent + "def initialize(**kwargs)")
107
+ eval_list.push(indent + "def initialize")
119
108
 
120
109
  indent = inc_indent(indent)
121
110
 
@@ -126,7 +115,7 @@ class Ree::ObjectCompiler
126
115
 
127
116
  @packages_facade.load_package_object(pckg.name, obj.name)
128
117
 
129
- eval_list.push(indent + "@#{_.as} = kwargs[:#{_.as}] || #{obj.klass}.new(**kwargs)")
118
+ eval_list.push(indent + "@#{_.as} = #{obj.klass}.new")
130
119
  end
131
120
 
132
121
  if object.after_init?
data/lib/ree/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ree
4
- VERSION = "1.0.39"
4
+ VERSION = "1.0.41"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.39
4
+ version: 1.0.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-29 00:00:00.000000000 Z
11
+ date: 2024-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -63,8 +63,6 @@ files:
63
63
  - lib/ree/args.rb
64
64
  - lib/ree/bean_dsl.rb
65
65
  - lib/ree/cli.rb
66
- - lib/ree/cli/delete_object_schema.rb
67
- - lib/ree/cli/generate_object_schema.rb
68
66
  - lib/ree/cli/generate_package.rb
69
67
  - lib/ree/cli/generate_package_schema.rb
70
68
  - lib/ree/cli/generate_packages_schema.rb
@@ -1,43 +0,0 @@
1
- require 'fileutils'
2
-
3
- module Ree
4
- module CLI
5
- class DeleteObjectSchema
6
- class << self
7
- def run(object_path:, project_path:, silence: false)
8
- ENV['REE_SKIP_ENV_VARS_CHECK'] = 'true'
9
-
10
- path = Ree.locate_packages_schema(project_path)
11
- dir = Pathname.new(path).dirname.to_s
12
-
13
- Ree.init(dir)
14
-
15
- object_name = object_path.split('/')[-1].split('.').first.to_sym
16
-
17
- puts("Deleting old #{object_name}.schema.json") if !silence
18
-
19
- schema_path = Ree::PathHelper.object_schema_rpath(object_path)
20
- abs_schema_path = File.join(dir, schema_path)
21
-
22
- if File.exist?(abs_schema_path)
23
- FileUtils.rm(abs_schema_path)
24
-
25
- facade = Ree.container.packages_facade
26
- package_name = Ree::PathHelper.package_name_from_dir(File.dirname(object_path))
27
- if package_name
28
- package_name = package_name.to_sym
29
- facade.load_package_entry(package_name)
30
- package = facade.get_package(package_name)
31
- package.remove_object(object_name)
32
- facade.dump_package_schema(package_name)
33
- end
34
-
35
- puts(" #{schema_path}: is deleted") if !silence
36
- end
37
-
38
- puts("done") if !silence
39
- end
40
- end
41
- end
42
- end
43
- end
@@ -1,49 +0,0 @@
1
- require 'fileutils'
2
-
3
- module Ree
4
- module CLI
5
- class GenerateObjectSchema
6
- class << self
7
- def run(package_name:, object_path:, project_path:, silence: false)
8
- ENV['REE_SKIP_ENV_VARS_CHECK'] = 'true'
9
-
10
- path = Ree.locate_packages_schema(project_path)
11
- dir = Pathname.new(path).dirname.to_s
12
-
13
- Ree.init(dir)
14
-
15
- package_name = package_name.to_sym
16
- object_name = object_path.split('/')[-1].split('.').first.to_sym
17
-
18
- puts("Generating #{object_name}.schema.json in #{package_name} package") if !silence
19
-
20
- facade = Ree.container.packages_facade
21
- Ree.load_package(package_name)
22
-
23
- package = facade.get_package(package_name)
24
-
25
- if facade.has_object?(package_name, object_name)
26
- object = facade.load_package_object(package_name, object_name)
27
- Ree.write_object_schema(package.name, object.name)
28
- facade.dump_package_schema(package_name)
29
- else
30
- file_path = File.join(dir, object_path)
31
-
32
- if File.exist?(file_path)
33
- facade.load_file(file_path, package_name)
34
- facade.dump_package_schema(package_name)
35
-
36
- if facade.has_object?(package_name, object_name)
37
- Ree.write_object_schema(package_name, object_name)
38
- end
39
- else
40
- raise Ree::Error.new("package file not found: #{file_path}")
41
- end
42
- end
43
-
44
- puts("done") if !silence
45
- end
46
- end
47
- end
48
- end
49
- end