dragonruby-egg 1.0.3 → 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: e2cc96708fcea1d190de763ce986d3de7615d955275e052d36d0e2a829e99306
4
- data.tar.gz: 18d24306b2c920c9312b40b378b9d09daf2dd9c457afe8858690dbf8874b8556
3
+ metadata.gz: 8ce98050c48dbf21a6529eaaa3b5c8d230c8b3d527bc792cdc902511998e815d
4
+ data.tar.gz: 11a87150002e5c0d57bce671b47ce27fc5124dc5c0c41f62354f58a8670a51ac
5
5
  SHA512:
6
- metadata.gz: d7e1fce2951cb37bf745a4d5b4b2d5c21606504f386a954811ad8fc984263b2eda29bd0065e41b8dcb188c7abe8e897b9309908cd9675de0042e26af9e006c6e
7
- data.tar.gz: 24b9490248c8bef130e3f9c933a9941381299212b776f66d817d7d3cc9040e87fea27aa1981959b32824b42b0c185816410959a8864e866c2331d4cdf056cfe5
6
+ metadata.gz: 25b295c1aab700d83bf3938e874f9b5c88ae41c8d2b677282baffa711c3efdb8cb419f7b79f803820402f50683d0af9f6e38dc6f5f5e78d42bed5a125bdb7fc6
7
+ data.tar.gz: fcf38702ae63632d083ccac919fc1b40463253077305b40a73507d8495dc8bae3f540c66e074240cf7756021b61e9701b79229691073bd2983e96bc3c5bee38e
@@ -1,5 +1,5 @@
1
1
  module DragonrubyEgg
2
- VERSION = "1.0.3"
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,24 +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
- h_change = lambda do |*e|
11
- result = e[0]
12
- e[1].each do |k|
13
- result = result
14
- .gsub("require \"#{k}", "require \"modules/#{repo_module}/#{k}")
15
- .gsub("require \'#{k}", "require \'modules/#{repo_module}/#{k}")
16
- end
17
- result
18
- end
19
-
20
- content = h_change.call(f.read, ['app', 'lib'])
24
+ content = f.read
21
25
  end
22
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
+
23
32
  File.open path, "w+" do |f|
24
33
  f.write content
25
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.3
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-07 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