dragonruby-egg 1.0.2 → 1.0.4

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: fa1215a33227e33d8d232ecdade6ff3ab3d1b6bb09be929882ff379606793aec
4
- data.tar.gz: a3d9d14e5c9ee1e0151ace87b62d7f05ee5f1608144a27ceff486dffb3727ba3
3
+ metadata.gz: 8ce98050c48dbf21a6529eaaa3b5c8d230c8b3d527bc792cdc902511998e815d
4
+ data.tar.gz: 11a87150002e5c0d57bce671b47ce27fc5124dc5c0c41f62354f58a8670a51ac
5
5
  SHA512:
6
- metadata.gz: e53feb25ca8d1aa3f17ab87d10624441679dc587f19caa7559f5730614c0ecaf5c7797af65ec5f0db2ccf655c7c34e47364a2dffcbe6aad1b9d57ba8d68417ed
7
- data.tar.gz: 7c4e0d17345d42ebefdbd74c95e4a97ec09ae106f986a7fa3a7e71efae0d1cf375e45f8735f93cdc105664b2d7fc86dbd20cec39d23be84947bfe568611102e1
6
+ metadata.gz: 25b295c1aab700d83bf3938e874f9b5c88ae41c8d2b677282baffa711c3efdb8cb419f7b79f803820402f50683d0af9f6e38dc6f5f5e78d42bed5a125bdb7fc6
7
+ data.tar.gz: fcf38702ae63632d083ccac919fc1b40463253077305b40a73507d8495dc8bae3f540c66e074240cf7756021b61e9701b79229691073bd2983e96bc3c5bee38e
@@ -1,5 +1,5 @@
1
1
  module DragonrubyEgg
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.4"
3
3
  module Constants
4
4
  APP_FULL_NAME = 'DragonRuby-Egg'
5
5
  DR_EXES = {
@@ -66,8 +66,8 @@ module DragonrubyEgg
66
66
  "has been installed in this '.#{module_path.sub(path, '')}' folder.")
67
67
  end
68
68
 
69
- IO.change_require(module_path, repo_module)
70
- Event.print('INSTALL', "Require paths have been changed for this '#{repo_module}' module.")
69
+ IO.change_paths(module_path, repo_module)
70
+ Event.print('INSTALL', "All paths for this '#{repo_module}' module have been changed.")
71
71
  end
72
72
 
73
73
  def new_project name, path
@@ -2,14 +2,33 @@ module DragonrubyEgg
2
2
  module IO
3
3
  module_function
4
4
 
5
- def change_require(module_path, repo_module)
5
+ def change_content(content, repo_module, keywords, find_keyword = '')
6
+ h_change = lambda do |*e|
7
+ result = e[0]
8
+ e[1].each do |k|
9
+ result = result
10
+ .gsub("#{find_keyword}\"#{k}", "#{find_keyword}\"modules/#{repo_module}/#{k}")
11
+ .gsub("#{find_keyword}\'#{k}", "#{find_keyword}\'modules/#{repo_module}/#{k}")
12
+ end
13
+ result
14
+ end
15
+
16
+ h_change.call(content, keywords)
17
+ end
18
+
19
+ def change_paths(module_path, repo_module)
6
20
  rb_files = Dir.glob("#{module_path}/**/*.rb")
7
21
  rb_files.each do |path|
8
22
  content = nil
9
23
  File.open path do |f|
10
- content = f.read.gsub("require \"lib", "require \"modules/#{repo_module}/lib")
24
+ content = f.read
11
25
  end
12
26
  if content
27
+ # Require
28
+ content = change_content(content, repo_module, ['app', 'lib'], 'require ')
29
+ # Path for assets
30
+ content = change_content(content, repo_module, ['sounds/', 'sprites/', 'fonts/', 'data/'])
31
+
13
32
  File.open path, "w+" do |f|
14
33
  f.write content
15
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonruby-egg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filip Vrba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-01 00:00:00.000000000 Z
11
+ date: 2023-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client