gator 0.0.13.pre → 0.0.14.pre

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.13.pre
1
+ 0.0.14.pre
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gator}
8
- s.version = "0.0.13.pre"
8
+ s.version = "0.0.14.pre"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dominic Graefen"]
@@ -31,8 +31,8 @@ Gem::Specification.new do |s|
31
31
  "lib/gator.rb",
32
32
  "lib/gator/command.rb",
33
33
  "lib/gator/commands.rb",
34
- "lib/gator/commands/generate_command.rb",
35
- "lib/gator/commands/project_command.rb",
34
+ "lib/gator/commands/generate.rb",
35
+ "lib/gator/commands/project.rb",
36
36
  "lib/gator/config.rb",
37
37
  "lib/gator/generators.rb",
38
38
  "lib/gator/generators/as3/ClassTemplate.as.tt",
@@ -1,8 +1,8 @@
1
1
  require 'gator/config'
2
2
  require 'gator/project'
3
3
  require 'gator/util'
4
- require 'gator/task'
5
4
  require 'gator/command'
5
+ require 'gator/task'
6
6
  require 'gator/runner'
7
7
  require 'gator/commands'
8
8
  require 'gator/generators'
@@ -1,11 +1,13 @@
1
1
  module Gator
2
2
  class Command < Thor
3
- def self.register_command(target, name, usage, description, mappings=[], options={})
4
- target.register self, name, usage, description, options
5
- target.map mappings => name
3
+
4
+ def self.define( definition )
5
+ @definition = d = definition
6
+ d[:on].register self, d[:as], d[:usage], d[:description], d[:options] || {}
7
+ d[:on].map [ d[:short] ] => d[:as] unless d[:short].nil?
6
8
  end
7
9
 
8
- #The following lines fixes a bug in thor see: https://github.com/wycats/thor/pull/150
10
+ #The following lines fix a bug in thor see: https://github.com/wycats/thor/pull/150
9
11
  class << self
10
12
  def register(klass, subcommand_name, usage, description, options={})
11
13
  if klass <= Thor::Group
@@ -0,0 +1,8 @@
1
+ require 'thor/actions'
2
+
3
+ module Gator
4
+ class GenerateCommand < Command
5
+ define :on => Gator::Runner, :as => "generate", :short => "g",
6
+ :usage => "generate TASK", :description => "Generators."
7
+ end
8
+ end
@@ -9,7 +9,8 @@ module Gator
9
9
  include Thor::Actions
10
10
  include Gator::Configuration
11
11
 
12
- register_command Gator::Runner, "project", "project TASK", "Set of tasks to manage project templates.", ["p"]
12
+ define :on => Gator::Runner, :as => "project", :short => "p",
13
+ :usage => "project TASK", :description => "Set of tasks to manage project templates."
13
14
 
14
15
  def self.source_root
15
16
  Gator::Util.project_template_root
@@ -3,9 +3,10 @@ module Gator
3
3
  class ClassGenerator < Task
4
4
  include Gator::Project
5
5
 
6
- register_task Gator::AS3::GeneratorCollection, "klass", "generate as3 klass CLASS_NAME", "Creates AS3 class."
6
+ define :on => Gator::AS3::GeneratorCollection, :as => "klass",
7
+ :usage => "generate as3 klass CLASS_NAME", :description => "Creates AS3 class."
7
8
 
8
- argument :name
9
+ argument :classname
9
10
 
10
11
  def self.source_root
11
12
  File.dirname __FILE__
@@ -13,7 +14,7 @@ module Gator
13
14
 
14
15
  def generate
15
16
  src = project.path(:src, :main, :as3)
16
- @package_name, @class_name = split_class_name(name)
17
+ @package_name, @class_name = split_class_name(classname)
17
18
  src = File.join(src, @package_name.split(".").join(File::SEPARATOR)) unless @package_name == ""
18
19
  template "ClassTemplate.as.tt", File.join(src, "#{@class_name}.as")
19
20
 
@@ -1,10 +1,15 @@
1
1
  module Gator
2
2
  module AS3
3
+
3
4
  class GeneratorCollection < Gator::Command
4
- register_command Gator::GenerateCommand, "as3", "generate as3 GENERATOR", "Generators for AS3"
5
+ define :on => Gator::GenerateCommand, :as => "as3",
6
+ :usage => "generate as3 GENERATOR", :description => "Generators for AS3."
5
7
  end
8
+
6
9
  class TestGeneratorCollection < Gator::Command
7
- register_command GeneratorCollection, "test", "generate as3 test GENERATOR", "TestGenerators for AS3"
10
+ define :on => GeneratorCollection, :as => "test",
11
+ :usage => "generate as3 test GENERATOR", :description => "TestGenerators for AS3."
8
12
  end
13
+
9
14
  end
10
15
  end
@@ -3,9 +3,10 @@ module Gator
3
3
  class ClassTestGenerator < Task
4
4
  include Gator::Project
5
5
 
6
- register_task Gator::AS3::TestGeneratorCollection, "klass", "generate as3 test klass CLASS_NAME", "Creates AS3 class test."
6
+ define :on => Gator::AS3::TestGeneratorCollection, :as => "klass",
7
+ :usage => "generate as3 test klass CLASS_NAME", :description => "Creates AS3 class test."
7
8
 
8
- argument :name
9
+ argument :classname
9
10
 
10
11
  def self.source_root
11
12
  File.dirname __FILE__
@@ -13,7 +14,7 @@ module Gator
13
14
 
14
15
  def generate
15
16
  src = project.path(:src, :test, :as3)
16
- @package_name, @class_name = split_class_name(name)
17
+ @package_name, @class_name = split_class_name(classname)
17
18
  @class_name += "Test"
18
19
  src = File.join(src, @package_name.split(".").join(File::SEPARATOR)) unless @package_name == ""
19
20
  template "ClassTemplate.as.tt", File.join(src, "#{@class_name}.as")
@@ -4,9 +4,12 @@ require "thor/actions"
4
4
  module Gator
5
5
  class Task < Thor::Group
6
6
  include Thor::Actions
7
- def self.register_task( target, name, usage, description, mappings=[], options={} )
8
- target.register self, name, usage,description,options
9
- target.map mappings => name
7
+
8
+ def self.define( definition )
9
+ @definition = d = definition
10
+ d[:on].register self, d[:as], d[:usage], d[:description], d[:options] || {}
11
+ d[:on].map [ d[:short] ] => d[:as] unless d[:short].nil?
10
12
  end
13
+
11
14
  end
12
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13.pre
4
+ version: 0.0.14.pre
5
5
  prerelease: 7
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable: gator
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
17
- requirement: &2161742020 !ruby/object:Gem::Requirement
17
+ requirement: &2157356460 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.14.6
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2161742020
25
+ version_requirements: *2157356460
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &2161741520 !ruby/object:Gem::Requirement
28
+ requirement: &2157355940 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 2.3.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2161741520
36
+ version_requirements: *2157355940
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &2161741000 !ruby/object:Gem::Requirement
39
+ requirement: &2157355400 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2161741000
47
+ version_requirements: *2157355400
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: jeweler
50
- requirement: &2161740460 !ruby/object:Gem::Requirement
50
+ requirement: &2157354800 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 1.6.2
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2161740460
58
+ version_requirements: *2157354800
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rcov
61
- requirement: &2161739860 !ruby/object:Gem::Requirement
61
+ requirement: &2157346500 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2161739860
69
+ version_requirements: *2157346500
70
70
  description: gator - the friendly code-generator
71
71
  email: dominic.graefen@gmail.com
72
72
  executables:
@@ -88,8 +88,8 @@ files:
88
88
  - lib/gator.rb
89
89
  - lib/gator/command.rb
90
90
  - lib/gator/commands.rb
91
- - lib/gator/commands/generate_command.rb
92
- - lib/gator/commands/project_command.rb
91
+ - lib/gator/commands/generate.rb
92
+ - lib/gator/commands/project.rb
93
93
  - lib/gator/config.rb
94
94
  - lib/gator/generators.rb
95
95
  - lib/gator/generators/as3/ClassTemplate.as.tt
@@ -118,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  segments:
120
120
  - 0
121
- hash: 2732303947582231571
121
+ hash: -355308578619065228
122
122
  required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  none: false
124
124
  requirements:
@@ -1,7 +0,0 @@
1
- require 'thor/actions'
2
-
3
- module Gator
4
- class GenerateCommand < Command
5
- register_command Gator::Runner, "generate", "generate TASK", "Generators.", ["g"]
6
- end
7
- end