ree 1.0.9 → 1.0.10

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: 754004035abda42c6d92689e63dd8c2b5e58d0aa706097cd6a825decdbad36f3
4
- data.tar.gz: 43c066a73992ff94ce014301d9dea2df68ab804f90ae580d7a3dfca36f9c59e5
3
+ metadata.gz: c1b2264b5461e4f29c6a6a09d71b4f594607777e30b7fd9ee04eb581f8ca4c27
4
+ data.tar.gz: f56ccea02c51d34be30d0a53da9cb2a855265510b6167d19986b4ceb708a92f7
5
5
  SHA512:
6
- metadata.gz: f126d959715dbf0c9e2c4bf01824c832a111e78385afe4573c2752c259f7b42ce108995eec25398f3fd3b0b8b32fee9d8edfdd382dd4799dcb6b467dbea2d741
7
- data.tar.gz: b6663db03cca36ba13f6faddb54ae041a40d1e20f36ac426b55a126aae9f207c0d217a03527fd89951f0d91658db436ef5f995d9810205fd907f2562e46100af
6
+ metadata.gz: c423007aa3b01f9251f820eb432186ef18d909dbfc06c52d6c6748eddc7ab6d35e1d38c337ad5afcefea302a0b057832ec29eb50dda7dd4ba053bdc9ddee7913
7
+ data.tar.gz: f3f0ed83742454c2f4ae91c7eb47be2a1cbce89ee2775ef220c5a73682bed9b051f9c79196b46990ab800783c630e5ef015fd9ab665a727ef9f8b8ef9b04b723
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ree (1.0.9)
4
+ ree (1.0.10)
5
5
  commander (~> 4.6.0)
6
6
 
7
7
  GEM
data/exe/ree CHANGED
@@ -251,7 +251,7 @@ class ReeCliRunner
251
251
  package_abs_path = Ree::PathHelper.abs_package_dir(package)
252
252
  exec_abs_path = Pathname.new(package_abs_path).join(Pathname.new(executable_path)).to_s
253
253
 
254
- raise Ree::Error.new("File #{exec_abs_path} not found") unless File.exists?(exec_abs_path)
254
+ raise Ree::Error.new("File #{exec_abs_path} not found") unless File.exist?(exec_abs_path)
255
255
 
256
256
  system("chmod +x #{exec_abs_path}") if run_chmod_x
257
257
  system(exec_abs_path)
@@ -19,7 +19,7 @@ module Ree
19
19
  schema_path = Ree::PathHelper.object_schema_rpath(object_path)
20
20
  abs_schema_path = File.join(dir, schema_path)
21
21
 
22
- if File.exists?(abs_schema_path)
22
+ if File.exist?(abs_schema_path)
23
23
  FileUtils.rm(abs_schema_path)
24
24
 
25
25
  puts(" #{schema_path}: is deleted") if !silence
@@ -29,7 +29,7 @@ module Ree
29
29
  else
30
30
  file_path = File.join(dir, object_path)
31
31
 
32
- if File.exists?(file_path)
32
+ if File.exist?(file_path)
33
33
  facade.load_file(file_path, package_name)
34
34
  facade.dump_package_schema(package_name)
35
35
 
@@ -6,16 +6,14 @@ require_relative 'engine_proxy'
6
6
 
7
7
  module Ree::Contracts
8
8
  module Contractable
9
- if !Ree::Contracts.no_contracts?
10
- def method_added(name)
11
- MethodDecorator.new(name, false, self).call
12
- super
13
- end
9
+ def method_added(name)
10
+ MethodDecorator.new(name, false, self).call
11
+ super
12
+ end
14
13
 
15
- def singleton_method_added(name)
16
- MethodDecorator.new(name, true, self).call
17
- super
18
- end
14
+ def singleton_method_added(name)
15
+ MethodDecorator.new(name, true, self).call
16
+ super
19
17
  end
20
18
 
21
19
  def doc(str)
@@ -38,11 +38,6 @@ class Ree::PackageLoader
38
38
  @loaded_packages[name] = true
39
39
  package = @packages_store.get(name)
40
40
 
41
- if package.dir.nil?
42
- package.set_schema_loaded
43
- return package
44
- end
45
-
46
41
  if !package
47
42
  raise Ree::Error.new(
48
43
  "Package :#{name} was not found. Did you mistype the name? Run `ree gen.packages_json` to update Packages.schema.json",
@@ -50,6 +45,11 @@ class Ree::PackageLoader
50
45
  )
51
46
  end
52
47
 
48
+ if package.dir.nil?
49
+ package.set_schema_loaded
50
+ return package
51
+ end
52
+
53
53
  not_loaded = Set.new(
54
54
  [name, package.deps.map(&:name)]
55
55
  .uniq
@@ -46,7 +46,7 @@ class Ree::PackageSchemaLoader
46
46
  # @param [Nilor[Ree::Package]] existing_package Loaded package
47
47
  # @return [Ree::Package]
48
48
  def call(abs_schema_path, existing_package = nil)
49
- if !File.exists?(abs_schema_path)
49
+ if !File.exist?(abs_schema_path)
50
50
  raise Ree::Error.new("File not found: #{abs_schema_path}", :invalid_package_schema)
51
51
  end
52
52
 
@@ -6,7 +6,7 @@ class Ree::PackagesDetector
6
6
  # @param [String] dir Packages root dir
7
7
  # @return [ArrayOf[{name: String, entry_path: String, package_schema_path: String, gem_name: Nilor[String]}]]
8
8
  def call(dir, gem_name = nil)
9
- if !Dir.exists?(dir)
9
+ if !Dir.exist?(dir)
10
10
  raise Ree::Error.new("dir does not exist: #{dir}", :invalid_dir)
11
11
  end
12
12
 
@@ -22,7 +22,7 @@ class Ree::PackagesDetector
22
22
  name = package_schema_path.split('/')[-2]
23
23
  entry_path = Ree::PathHelper.package_entry_path(package_schema_path)
24
24
 
25
- if !File.exists?(File.join(dir, entry_path))
25
+ if !File.exist?(File.join(dir, entry_path))
26
26
  Ree.logger.error("Entry file does not exist for '#{name}' package: #{entry_path}")
27
27
  end
28
28
 
@@ -25,7 +25,7 @@ class Ree::PackagesSchemaLoader
25
25
  # @param Nilor[Ree::PackagesStore] packages_store Existing packages store
26
26
  # @return [Ree::PackagesStore]
27
27
  def call(abs_schema_path, packages_store = nil, gem_name = nil)
28
- if !File.exists?(abs_schema_path)
28
+ if !File.exist?(abs_schema_path)
29
29
  raise Ree::Error.new("File not found: #{abs_schema_path}", :invalid_packages_schema)
30
30
  end
31
31
 
@@ -165,10 +165,10 @@ class Ree::ObjectDsl
165
165
  Ree::PACKAGE, path
166
166
  )
167
167
 
168
- if !File.exists?(file_path)
168
+ if !File.exist?(file_path)
169
169
  file_path = "#{file_path}.rb"
170
170
 
171
- if !File.exists?(file_path)
171
+ if !File.exist?(file_path)
172
172
  raise_error("Unable to link '#{path}'. File not found #{file_path}")
173
173
  end
174
174
  end
@@ -223,7 +223,7 @@ class Ree::ObjectDsl
223
223
  raise Ree::Error.new("Mount as should be one of #{MOUNT_AS.inspect}", :invalid_dsl_usage)
224
224
  end
225
225
 
226
- object_name_from_path = if File.exists?(path) && !Ree.irb_mode?
226
+ object_name_from_path = if File.exist?(path) && !Ree.irb_mode?
227
227
  File.basename(path, ".*").to_sym
228
228
  end
229
229
 
@@ -12,11 +12,11 @@ def package_require(path)
12
12
  Ree::PathHelper.abs_package_module_dir(package), list.join('/')
13
13
  )
14
14
 
15
- if !File.exists?(path)
15
+ if !File.exist?(path)
16
16
  path = path + '.rb'
17
17
  end
18
18
 
19
- if !File.exists?(path)
19
+ if !File.exist?(path)
20
20
  raise Ree::Error.new("file not found: #{path}")
21
21
  end
22
22
 
@@ -37,8 +37,8 @@ def package_file_exists?(path)
37
37
  Ree::PathHelper.abs_package_module_dir(package), list.join('/')
38
38
  )
39
39
 
40
- return true if File.exists?(path)
40
+ return true if File.exist?(path)
41
41
 
42
42
  path = path + '.rb'
43
- File.exists?(path)
43
+ File.exist?(path)
44
44
  end
@@ -78,7 +78,7 @@ class Ree::PackagesFacade
78
78
  if package.dir
79
79
  schema_path = Ree::PathHelper.abs_package_schema_path(package)
80
80
 
81
- if !File.exists?(schema_path)
81
+ if !File.exist?(schema_path)
82
82
  raise Ree::Error.new("File does not exist: #{schema_path}", :invalid_path)
83
83
  end
84
84
 
@@ -101,7 +101,7 @@ class Ree::PackagesFacade
101
101
  if package.dir
102
102
  schema_path = Ree::PathHelper.abs_package_schema_path(package)
103
103
 
104
- if !File.exists?(schema_path)
104
+ if !File.exist?(schema_path)
105
105
  raise Ree::Error.new("File does not exist: #{schema_path}", :invalid_path)
106
106
  end
107
107
 
@@ -126,7 +126,7 @@ class Ree::PackagesFacade
126
126
 
127
127
  schema_path = Ree::PathHelper.abs_object_schema_path(object)
128
128
 
129
- if !File.exists?(schema_path)
129
+ if !File.exist?(schema_path)
130
130
  only_dir_path = schema_path.split('/')[0..-2]
131
131
  FileUtils.mkdir_p(File.join(only_dir_path))
132
132
  end
@@ -80,7 +80,7 @@ class Ree::TemplateHandler
80
80
  rendered_abs_path = Ree::TemplateRenderer.handle(get_destination_path(path), @locals)
81
81
  rendered_rel_path = Pathname.new(rendered_abs_path).relative_path_from Pathname.new(project_path)
82
82
 
83
- if File.file?(rendered_abs_path) && File.exists?(rendered_abs_path)
83
+ if File.file?(rendered_abs_path) && File.exist?(rendered_abs_path)
84
84
  @stdout.puts "Warning! #{rendered_rel_path} already exists. Skipping file creation..."
85
85
  next
86
86
  end
data/lib/ree/link_dsl.rb CHANGED
@@ -107,10 +107,10 @@ module Ree::LinkDSL
107
107
  Ree::PACKAGE, path
108
108
  )
109
109
 
110
- if !File.exists?(file_path)
110
+ if !File.exist?(file_path)
111
111
  file_path = "#{file_path}.rb"
112
112
 
113
- if !File.exists?(file_path)
113
+ if !File.exist?(file_path)
114
114
  _raise_error("Unable to link '#{path}'. File not found #{file_path}")
115
115
  end
116
116
  end
@@ -26,7 +26,7 @@ class Ree::TemplateDetector
26
26
  def template_file_path(template_name, relative_path)
27
27
  file_path = [detect_template_folder(template_name), DEFAULT_TEMPLATES_DIRECTORY]
28
28
  .map {|folder| File.join(folder, relative_path)}
29
- .detect {|file| File.exists?(file)}
29
+ .detect {|file| File.exist?(file)}
30
30
 
31
31
  raise Ree::Error.new('Template does not exist') if file_path.nil?
32
32
 
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.9"
4
+ VERSION = "1.0.10"
5
5
  end
data/lib/ree.rb CHANGED
@@ -144,7 +144,7 @@ module Ree
144
144
  def init(dir, irb: false)
145
145
  check_arg(dir, :dir, String)
146
146
 
147
- if !Dir.exists?(dir)
147
+ if !Dir.exist?(dir)
148
148
  raise Ree::Error.new("Dir does not exist: #{dir}", :invalid_root_dir)
149
149
  end
150
150
 
@@ -153,7 +153,7 @@ module Ree
153
153
 
154
154
  ree_setup_path = File.join(@root_dir, REE_SETUP)
155
155
 
156
- if File.exists?(ree_setup_path)
156
+ if File.exist?(ree_setup_path)
157
157
  require(ree_setup_path)
158
158
  end
159
159
 
@@ -192,7 +192,7 @@ module Ree
192
192
  raise Ree::Error.new("Ree already registered gem `#{name}`", :duplicate_gem)
193
193
  end
194
194
 
195
- if !Dir.exists?(dir)
195
+ if !Dir.exist?(dir)
196
196
  raise Ree::Error.new("Dir does not exist: #{dir}", :invalid_gem_dir)
197
197
  end
198
198
 
@@ -201,7 +201,7 @@ module Ree
201
201
  gem_dir = Pathname.new(packages_schema_path).dirname.to_s
202
202
  ree_setup_path = File.join(gem_dir, REE_SETUP)
203
203
 
204
- if File.exists?(ree_setup_path)
204
+ if File.exist?(ree_setup_path)
205
205
  require(ree_setup_path)
206
206
  end
207
207
 
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.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-30 00:00:00.000000000 Z
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander