coronate 0.0.6 → 0.0.7
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 +8 -8
- data/bin/coronate +0 -1
- data/lib/coronate/cli.rb +14 -25
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmM3ZTkzZjc1OTU1ZWI5MmYzNjlhMDhmN2QyMzIzMGNkZDE0ZmNjOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTYxMzI2YTE3M2Y1ODIyYTNmZDkxMzQxNTE2MTA5YjEwNGIwZTY1OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjJkZjMzY2FlYjVjNWI2ZTQ5MTExNzdkYjZlMDkwMmEyNDljNjNjOWE0NDJh
|
10
|
+
OTIzNWNlMmFlODFiZmViMjc5M2M1MDJmMWVjMTEzODUxYzJmNDNiODdjMDg2
|
11
|
+
ZDhiZjViODgyY2NhZDMxM2ZiNzVjYTMzNjAyNmE1ZGE3YmY1ODY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjM1ODZhOTlhODY1NThkMTcxMzA5MDQxMDFmM2YyNWFlNDU4YjdlN2FjZjlm
|
14
|
+
YmQ1YTQyZjE2ODZmNzBjY2I0OWQ2ZGU2ZjgwMzUwNTA4MmUwYWNlNTM1MWJk
|
15
|
+
OWNmZWNiYzEwNzEyMjgxNjc5OTNhM2YzMmM1MGEyMGRjYzU3Y2I=
|
data/bin/coronate
CHANGED
data/lib/coronate/cli.rb
CHANGED
@@ -1,51 +1,40 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require_relative 'extensions/string_extention'
|
3
|
-
|
4
3
|
%w[project app game ebook scene].each { |task| require_relative "builder/#{task}_builder" }
|
5
4
|
|
6
5
|
class Coronate::CLI < Thor
|
7
6
|
include Thor::Actions
|
8
|
-
|
9
7
|
Coronate::Builder.constants.each { |b| include "Coronate::Builder::#{b}".to_class }
|
10
8
|
|
11
|
-
def initialize(*args)
|
12
|
-
super
|
13
|
-
method = args[2][:current_command][:name]
|
14
|
-
processing(args[0][0] || "#{method}1" , method)
|
15
|
-
end
|
9
|
+
def initialize(*args); super; processing(*args) end
|
16
10
|
|
17
|
-
def self.source_root
|
18
|
-
File.dirname(__FILE__)
|
19
|
-
end
|
11
|
+
def self.source_root; File.dirname(__FILE__) end
|
20
12
|
|
21
13
|
class_option :width, :type => :numeric, :default => 320, :required => false, :aliases => "-w", :desc => "width"
|
22
14
|
class_option :height, :type => :numeric, :default => 480, :required => false, :aliases => "-h", :desc => "height"
|
23
|
-
class_option :
|
15
|
+
class_option :layout, :type => :boolean, :default => true, :required => false, :aliases => "-l", :desc => "layout"
|
24
16
|
|
25
17
|
desc "scene [NAME]", "generate an scene"
|
26
|
-
def scene(name=
|
18
|
+
def scene(name=nil) end
|
27
19
|
|
28
20
|
desc "project [NAME]", "generate a corona project"
|
29
|
-
def project(name=
|
21
|
+
def project(name=nil) end
|
30
22
|
|
31
23
|
desc "game [NAME]", "generate a corona game project"
|
32
|
-
def game(name=
|
24
|
+
def game(name=nil) end
|
33
25
|
|
34
26
|
desc "ebook [NAME]", "generate a corona ebook project"
|
35
|
-
def ebook(name=
|
27
|
+
def ebook(name=nil) end
|
36
28
|
|
37
29
|
desc "app [NAME]", "generate a corona app project"
|
38
|
-
def app(name=
|
30
|
+
def app(name=nil) end
|
39
31
|
|
40
32
|
private
|
41
|
-
|
42
|
-
|
43
|
-
@name, @width, @height, @orient =
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
%{ "landscapeLeft", "landscapeRight" } : %{ "portrait", "portraitUpsideDown" }
|
48
|
-
send "build_#{method}"
|
33
|
+
def processing(*args)
|
34
|
+
method = args[2][:current_command][:name] # default project name is app type name
|
35
|
+
@name, @width, @height, @orient = args[0][0] || "#{method}", options[:width], options[:height],
|
36
|
+
options[:layout] ? # default portrait
|
37
|
+
%{ "portrait", "portraitUpsideDown" } : %{ "landscapeLeft", "landscapeRight" }
|
38
|
+
send "build_#{method}" if method != 'help'
|
49
39
|
end
|
50
|
-
|
51
40
|
end
|