coronate 0.0.2 → 0.0.3

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzQwNDA3NzVjMDliMzcyZGQyNGU1Yzk1ZDk5ZDI5MzI0MWUzZGUzYQ==
4
+ YzgyNzg4MDRiNzkyMDc3ZjYwNGFmNWMyNWU0MDI5OWQ3Zjk3YzVjYw==
5
5
  data.tar.gz: !binary |-
6
- MWQ1OWExYTU1ZmY4MzRlZDUwZGRjMDY0NzI1NmQxMDcxNDc2MTUxMA==
6
+ NGQ3YzllNmQxYjNkMDA5OGEwNWFlNzZmZDNmZjgzMDc0YWNhNDdlMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTlmZjBlYWEyOGYyNTBmMDk3MDRkODE0NzJkMzYwMDI3OWQ2MDc2MDEyMjJl
10
- ZDhmMjk0Y2M0MDgyMmQ5YTJmOGQ1Y2U0YWRiN2NiZjRjMmNiNmFjNTUxZDA5
11
- ZmFhN2RhZmMyODBlMTVmNjg1MWQyODFkZjAyMzEwNGY3MzkwMGE=
9
+ NWNjNmQ0MWU3Y2NmMmVkNjU2MDdhOTZkMmQwMmU1YTllMWZiNTg3YjVlNzdm
10
+ MTBkMzNlZDdlN2RiNGFlZmU1YmFiZTBhZDUxZWVjNWYyNWNlNDVmMThlZDYz
11
+ NmNkNDVhNjhhZGNhYmE5ODY4M2EwYWE0NWFiMmE2MmYwZGYxMzc=
12
12
  data.tar.gz: !binary |-
13
- MzZjMDQ2NWJiMjBkNzdkNzI1NjFlYzg3MTc1Y2ZjZmVlZTQzODU1YmRmYjk2
14
- OTM1YzI5MDAyZjQ0OTk4NzM1YTY3MjBhNDYwYzMxMGYyZDM4MDg0NTg0Y2M0
15
- YzJmZmU0OTQyNTVjNjM1ODIxM2JiZDI5MTVhMGNjNjIyNDE5ZjM=
13
+ ZDRhNTMzNDU1ODAzMzNiMGY4NjcyYzhmMGViNjUzYjliNmY5NWZlODNmYjUz
14
+ YWQzOTA4MmFiMWFjMTU0MWEyNmIxMDFmN2I3MjJiYTk1MTdkNDhhMTdmNjAw
15
+ NDE1NmI1MmMxM2RiODRlM2E3MTRjMjk0YmZhY2ExMTA1NTY2NDU=
data/README.md CHANGED
@@ -10,16 +10,15 @@
10
10
  $ coronate
11
11
  Commands:
12
12
  coronate help [COMMAND] # Describe available commands or one specific command
13
- coronate project # generate a corona project
14
- coronate scene # generate an scene
15
-
16
-
13
+ coronate project [NAME] # generate a corona project
14
+ coronate scene [NAME] # generate an scene
15
+
17
16
  ### Generate Corona Porject
18
17
 
19
- $ cb project helloworld
20
-
18
+ $ cb project helloworld # default width=320 height=480 orientation=landscape
19
+ $ cb project helloworld -w 320 -h 568 --no-landscape # width=320 height=568 orientation=portrait
21
20
 
22
21
  ### Generate a scene file
23
22
 
24
- $ cb scene page1
23
+ $ coronate scene page1
25
24
 
data/lib/coronate/cli.rb CHANGED
@@ -8,14 +8,21 @@ class CLI < Thor
8
8
  File.dirname(__FILE__)
9
9
  end
10
10
 
11
- desc "scene", "generate an scene"
11
+ desc "scene [NAME]", "generate an scene"
12
12
  def scene(name='scene1')
13
13
  template 'templates/scene.tt', "#{name}.lua"
14
14
  end
15
15
 
16
- desc "project", "generate a corona project"
16
+ desc "project [NAME]", "generate a corona project"
17
+
18
+ method_option :width, :type => :numeric, :default => 320, :required => false, :aliases => "-w", :desc => "width"
19
+ method_option :height, :type => :numeric, :default => 480, :required => false, :aliases => "-h", :desc => "height"
20
+ method_option :landscape, :type => :boolean, :default => true, :required => false, :aliases => "-l", :desc => "landscape or not"
17
21
  def project(name='project1')
18
22
  empty_directory "#{name}/assets"
23
+ @width = options[:width]
24
+ @height = options[:height]
25
+ @orient = options[:orient] ? %{ "landscapeLeft", "landscapeRight" } : %{ "portrait", "portraitUpsideDown" }
19
26
  template 'templates/main.tt', "#{name}/main.lua"
20
27
  template 'templates/utils.tt', "#{name}/utils.lua"
21
28
  template 'templates/titleScene.tt', "#{name}/titleScene.lua"
@@ -3,7 +3,7 @@ settings = {
3
3
  orientation = {
4
4
  default = "landscape",
5
5
  supported = {
6
- "landscapeLeft", "landscapeRight"
6
+ <%= @orient %>
7
7
  }
8
8
  },
9
9
 
@@ -6,8 +6,8 @@ application = {
6
6
  fps = 30,
7
7
 
8
8
  -- Size of screen graphics are targeted to.
9
- width = 480,
10
- height = 800,
9
+ width = <%= @width %>,
10
+ height = <%= @height %>,
11
11
 
12
12
  -- How to stretch graphics on a larger screen.
13
13
  scale = "letterbox"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coronate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eiffel Qiu