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 +4 -4
- data/lib/dragonruby_egg/constants.rb +1 -1
- data/lib/dragonruby_egg/executable.rb +2 -2
- data/lib/dragonruby_egg/io.rb +21 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ce98050c48dbf21a6529eaaa3b5c8d230c8b3d527bc792cdc902511998e815d
|
4
|
+
data.tar.gz: 11a87150002e5c0d57bce671b47ce27fc5124dc5c0c41f62354f58a8670a51ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25b295c1aab700d83bf3938e874f9b5c88ae41c8d2b677282baffa711c3efdb8cb419f7b79f803820402f50683d0af9f6e38dc6f5f5e78d42bed5a125bdb7fc6
|
7
|
+
data.tar.gz: fcf38702ae63632d083ccac919fc1b40463253077305b40a73507d8495dc8bae3f540c66e074240cf7756021b61e9701b79229691073bd2983e96bc3c5bee38e
|
@@ -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.
|
70
|
-
Event.print('INSTALL', "
|
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
|
data/lib/dragonruby_egg/io.rb
CHANGED
@@ -2,14 +2,33 @@ module DragonrubyEgg
|
|
2
2
|
module IO
|
3
3
|
module_function
|
4
4
|
|
5
|
-
def
|
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
|
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.
|
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-
|
11
|
+
date: 2023-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|