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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cor.rb +36 -7
  3. data/lib/cor/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5f181a615478a449323df206250ba26307c279a
4
- data.tar.gz: 66bb390b9d6db3193e5dec6e61d5cf7cdc61b4fb
3
+ metadata.gz: e2e8d018084e7661a0785b7ab138e1be4e930c1a
4
+ data.tar.gz: 6ed4cf74bfbe4f0a490e6bac5bf88ba309a8e3db
5
5
  SHA512:
6
- metadata.gz: f2bc393bd6f67ab9e8f78f948a1657f12b355a8e3fd0997784d692df61bbbd5a2194dcb0c9fa1e423923be118d13f0354e5513d4ce8d159af73774a13552ea21
7
- data.tar.gz: 79f6f61ffd1febbe20d36e80d991edcc82e266fc401ecffecead3f069273f4600c138cd394dae31d898eb84eb1b67d907f45f01dcb6ab21b912884c953e7600c
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
- p "Code on Rmake gem Version #{Cor::VERSION}"
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
- p "undefined command #{args[0]}"
20
- p "ARGS: #{args.join(', ')}"
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 => args.shift.gsub(':', '_').to_sym,
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
- p "Wrong Project Type #{project_type}"
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
- p "#{project_name} Project is already exists. "
61
+ puts "#{project_name} Project is already exists. "
56
62
  end
57
63
  else
58
- p "Wrong Project Name #{project_name}. You can use [a-zA-Z_]."
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
@@ -1,3 +1,3 @@
1
1
  module Cor
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - akasata