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.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/bin/coronate +0 -1
  3. data/lib/coronate/cli.rb +14 -25
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZThlMDdmZjQ1Mzk5NTRkMzkxZWQ3MjgzN2E1YjUyNGVjNmM2MTY2Ng==
4
+ MmM3ZTkzZjc1OTU1ZWI5MmYzNjlhMDhmN2QyMzIzMGNkZDE0ZmNjOA==
5
5
  data.tar.gz: !binary |-
6
- ZjNkMDU5OTQ5MGJlZDNjMDdhODc3YzU5OWE4NjJlMTg5ZmRhOGUwZQ==
6
+ OTYxMzI2YTE3M2Y1ODIyYTNmZDkxMzQxNTE2MTA5YjEwNGIwZTY1OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDg3YTIxZTZjYTM4N2M0NzE5MDAwZGIxOWJlY2NkZTIxNmYzNGE0OGE4MTdl
10
- MDgyYTMxN2FkMWEwYTY4OTU5ZDlmYjM0M2M4NTY0ZWU0MGY4NjlhNzIyYmNi
11
- MzUyMzMyZmI0M2ExMWE5ZDliMDU4NjgxYTMwMTIwNDgxZmIxMzc=
9
+ NjJkZjMzY2FlYjVjNWI2ZTQ5MTExNzdkYjZlMDkwMmEyNDljNjNjOWE0NDJh
10
+ OTIzNWNlMmFlODFiZmViMjc5M2M1MDJmMWVjMTEzODUxYzJmNDNiODdjMDg2
11
+ ZDhiZjViODgyY2NhZDMxM2ZiNzVjYTMzNjAyNmE1ZGE3YmY1ODY=
12
12
  data.tar.gz: !binary |-
13
- NWYyN2FkNzljODkwZDUyNGJhMzdmMmI0NTI4NGEyNzM4OGY4NjllOTI5MDYw
14
- MDNkNWQ2MDI5YTU5OGU1ZGJjOGU1M2QzZWJhMjMyMDZiZTg5OGM0ZGJlYzlk
15
- Njc0MzhmNTkyNDgyMzdiNjMxOTM4YTVkYjQ0YTEyYjY4YjU3M2M=
13
+ ZjM1ODZhOTlhODY1NThkMTcxMzA5MDQxMDFmM2YyNWFlNDU4YjdlN2FjZjlm
14
+ YmQ1YTQyZjE2ODZmNzBjY2I0OWQ2ZGU2ZjgwMzUwNTA4MmUwYWNlNTM1MWJk
15
+ OWNmZWNiYzEwNzEyMjgxNjc5OTNhM2YzMmM1MGEyMGRjYzU3Y2I=
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'coronate/cli'
3
- require 'coronate/builder/project_builder'
4
3
 
5
4
  Coronate::CLI.start
@@ -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 :landscape, :type => :boolean, :default => false, :required => false, :aliases => "-l", :desc => "landscape or not"
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='scene1') end
18
+ def scene(name=nil) end
27
19
 
28
20
  desc "project [NAME]", "generate a corona project"
29
- def project(name='project1') end
21
+ def project(name=nil) end
30
22
 
31
23
  desc "game [NAME]", "generate a corona game project"
32
- def game(name='game1') end
24
+ def game(name=nil) end
33
25
 
34
26
  desc "ebook [NAME]", "generate a corona ebook project"
35
- def ebook(name='ebook1') end
27
+ def ebook(name=nil) end
36
28
 
37
29
  desc "app [NAME]", "generate a corona app project"
38
- def app(name='app1') end
30
+ def app(name=nil) end
39
31
 
40
32
  private
41
-
42
- def processing(name,method)
43
- @name, @width, @height, @orient = name,
44
- options[:width],
45
- options[:height],
46
- options[:landscape] ?
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
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eiffel Qiu