cor 0.0.3 → 0.0.4
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 +4 -4
- data/lib/cor.rb +36 -7
- data/lib/cor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2e8d018084e7661a0785b7ab138e1be4e930c1a
|
4
|
+
data.tar.gz: 6ed4cf74bfbe4f0a490e6bac5bf88ba309a8e3db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8fdd5db7e950ae16cc39835afd73b47e14f8e08f39f1a5f289173612b1f31ae67c55ce44c655cdfd08220086bc95d09a98a45d761103014c6563da2915db271
|
7
|
+
data.tar.gz: 4a60de7b10ad5ab1fc967ca381fcb30fe4c78f6295db23b9dc4b23890b3d8753788838a3706dfbefd099c859359078d5a1400871d1751ee2a15fecc0095b765a
|
data/lib/cor.rb
CHANGED
@@ -7,23 +7,29 @@ module Cor
|
|
7
7
|
|
8
8
|
class Executor
|
9
9
|
def self.version(args)
|
10
|
-
|
10
|
+
puts "Code on Rmake gem Version #{Cor::VERSION}"
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.call_command(args)
|
14
14
|
command = self.analyze_argument(args)
|
15
15
|
|
16
|
+
if command[:command].to_s == ''
|
17
|
+
command[:command] = :help
|
18
|
+
end
|
19
|
+
|
16
20
|
if self.methods(false).include?(command[:command])
|
17
21
|
self.send(command[:command], command[:args])
|
18
22
|
else
|
19
|
-
|
20
|
-
|
23
|
+
puts "undefined command #{args[0]}"
|
24
|
+
puts "ARGS: #{args.join(', ')}"
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
24
28
|
def self.analyze_argument(args)
|
29
|
+
command = args.shift.to_s
|
30
|
+
|
25
31
|
result = {
|
26
|
-
:command =>
|
32
|
+
:command => command.gsub(':', '_').to_sym,
|
27
33
|
:args => args
|
28
34
|
}
|
29
35
|
|
@@ -43,7 +49,7 @@ module Cor
|
|
43
49
|
project_name = args[1].to_s
|
44
50
|
|
45
51
|
unless Cor::Project_Types.include? project_type
|
46
|
-
|
52
|
+
puts "Wrong Project Type #{project_type}"
|
47
53
|
return
|
48
54
|
end
|
49
55
|
|
@@ -52,10 +58,10 @@ module Cor
|
|
52
58
|
if !File.exists?(project_dir)
|
53
59
|
FileUtils.mkdir_p(%W(#{project_dir} #{project_dir}/materials #{project_dir}/data #{project_dir}/src))
|
54
60
|
else
|
55
|
-
|
61
|
+
puts "#{project_name} Project is already exists. "
|
56
62
|
end
|
57
63
|
else
|
58
|
-
|
64
|
+
puts "Wrong Project Name #{project_name}. You can use [a-zA-Z_]."
|
59
65
|
end
|
60
66
|
end
|
61
67
|
|
@@ -83,6 +89,29 @@ module Cor
|
|
83
89
|
|
84
90
|
end
|
85
91
|
|
92
|
+
def self.help(args)
|
93
|
+
puts <<-EOS
|
94
|
+
Cor gem provides convenient commands for Code on Rmake.
|
95
|
+
|
96
|
+
Usage:
|
97
|
+
cor help
|
98
|
+
cor version
|
99
|
+
cor command [arguments...]
|
100
|
+
|
101
|
+
Commands:
|
102
|
+
cor version
|
103
|
+
cor project:create my_game_directory
|
104
|
+
|
105
|
+
Information:
|
106
|
+
https://github.com/akasata/cor-gem
|
107
|
+
|
108
|
+
About Code on Rmake:
|
109
|
+
https://core.rmake.jp/
|
110
|
+
|
111
|
+
EOS
|
112
|
+
|
113
|
+
end
|
114
|
+
|
86
115
|
|
87
116
|
end
|
88
117
|
end
|
data/lib/cor/version.rb
CHANGED