gator 0.0.5.pre → 0.0.6.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.5.pre
1
+ 0.0.6.pre
data/bin/gator CHANGED
@@ -2,4 +2,4 @@
2
2
  require "rubygems"
3
3
  require "gator"
4
4
 
5
- Gator.application.execute ARGV
5
+ Gator::Runner.start
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gator}
8
- s.version = "0.0.5.pre"
8
+ s.version = "0.0.6.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"]
12
- s.date = %q{2011-07-03}
12
+ s.date = %q{2011-07-04}
13
13
  s.default_executable = %q{gator}
14
14
  s.description = %q{gator - the friendly code-generator}
15
15
  s.email = %q{dominic.graefen@gmail.com}
@@ -28,24 +28,29 @@ Gem::Specification.new do |s|
28
28
  "VERSION",
29
29
  "bin/gator",
30
30
  "gator.gemspec",
31
- "lib/core.rb",
32
- "lib/core/cli.rb",
33
- "lib/core/cli/application.rb",
34
- "lib/core/cli/shell.rb",
35
- "lib/core/command.rb",
36
- "lib/core/command/command.rb",
37
- "lib/core/configuration.rb",
38
- "lib/core/configuration/configuration.rb",
39
- "lib/core/project.rb",
40
- "lib/core/project/layout.rb",
41
- "lib/core/project/project.rb",
42
- "lib/default.rb",
43
- "lib/default/commands/generator_command.rb",
44
- "lib/default/commands/new_command.rb",
45
- "lib/default/commands/new_template/.gator/project.rb.tt",
46
- "lib/default/generators/AS3ClassTemplate.as.tt",
47
- "lib/default/generators/as3_class_generator.rb",
31
+ "lib/__legacy/core.rb",
32
+ "lib/__legacy/core/cli.rb",
33
+ "lib/__legacy/core/cli/application.rb",
34
+ "lib/__legacy/core/cli/shell.rb",
35
+ "lib/__legacy/core/command.rb",
36
+ "lib/__legacy/core/command/command.rb",
37
+ "lib/__legacy/core/configuration.rb",
38
+ "lib/__legacy/core/configuration/configuration.rb",
39
+ "lib/__legacy/core/project.rb",
40
+ "lib/__legacy/core/project/layout.rb",
41
+ "lib/__legacy/core/project/project.rb",
42
+ "lib/__legacy/default.rb",
43
+ "lib/__legacy/default/commands/generator_command.rb",
44
+ "lib/__legacy/default/commands/new_command.rb",
45
+ "lib/__legacy/default/commands/new_template/.gator/project.rb.tt",
46
+ "lib/__legacy/default/generators/AS3ClassTemplate.as.tt",
47
+ "lib/__legacy/default/generators/as3_class_generator.rb",
48
+ "lib/__legacy/gator.rb",
48
49
  "lib/gator.rb",
50
+ "lib/gator/command.rb",
51
+ "lib/gator/project.rb",
52
+ "lib/gator/runner.rb",
53
+ "lib/gator/util.rb",
49
54
  "spec/core/command/command_spec.rb",
50
55
  "spec/core/project/project_spec.rb",
51
56
  "spec/spec_helper.rb"
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -87,10 +87,6 @@ module Gator
87
87
  Gator::Project.project
88
88
  end
89
89
 
90
- # def define_project(project)
91
- # Gator::Project.project= project
92
- # end
93
-
94
90
  def load_project
95
91
  pfile = Gator::Project.project_file
96
92
  if pfile.nil?
@@ -101,35 +97,5 @@ module Gator
101
97
  end
102
98
  end
103
99
 
104
- # def define_project( project )
105
- # @project = project
106
- # end
107
-
108
- # def project
109
- # p "project"
110
- # load_project unless @project
111
- # p " @project=#{@project}"
112
- # if @project.nil?
113
- # Gator.shell.say "Project is not defined!\nMake sure to define a project in #{Gator::Project.project_file}",:red
114
- # raise "ProjectNotDefined"
115
- # end
116
- # p " @project=#{@project}"
117
- # @project
118
- # end
119
-
120
- # private
121
-
122
- # def load_project
123
- # load File.join(".gator","project.rb")
124
- # p 'load_project'
125
- # pfile = Gator::Project.project_file
126
- # if pfile.nil?
127
- # Gator.shell.say "This is not a project directory!\nPlease create a gator project first.", :red
128
- # raise "NotInsideProjectDirectory"
129
- # else
130
- # load pfile
131
- # end
132
- # end
133
-
134
100
  end
135
101
  end
File without changes
@@ -0,0 +1,11 @@
1
+ require "thor"
2
+ require "thor/group"
3
+ require File.dirname(__FILE__) + '/core'
4
+ require File.dirname(__FILE__) + '/default'
5
+
6
+ # This makes gator module functions locally available in config & project files
7
+ module Gator
8
+ include Gator::Project
9
+ include Gator::Configuration
10
+ end
11
+ class << self; include Gator end
@@ -1,13 +1,2 @@
1
- require "thor"
2
- require "thor/group"
3
- require File.dirname(__FILE__) + '/core'
4
- require File.dirname(__FILE__) + '/default'
5
-
6
- # This makes gator module functions locally available in config & project files
7
- module Gator
8
- include Gator::Project
9
- include Gator::Configuration
10
- end
11
- class << self;
12
- include Gator
13
- end
1
+ require File.dirname(__FILE__) + '/gator/runner'
2
+ require File.dirname(__FILE__) + '/gator/project'
File without changes
@@ -0,0 +1,36 @@
1
+ require "thor"
2
+ require "fileutils"
3
+ require File.dirname(__FILE__) + '/util'
4
+
5
+ module Gator
6
+ class Project < Thor
7
+ include Thor::Actions
8
+
9
+ def self.source_root
10
+ Gator::Util.project_template_root
11
+ end
12
+
13
+ desc "project install DIRECTORY TEMPLATE_NAME", "Install a project template."
14
+ def install( dir, template )
15
+ empty_directory template_dir(template)
16
+ FileUtils.cp_r File.expand_path( dir ), template_dir(template)
17
+ end
18
+
19
+ desc "project uninstall TEMPLATE_NAME", "Uninstall a project template."
20
+ def uninstall( template )
21
+ FileUtils.rm_r template_dir(template)
22
+ end
23
+
24
+ desc "project new DIRECTORY TEMPLATE_NAME", "Create a new project by template."
25
+ def new( dir, template )
26
+ directory template_dir(template), File.expand_path( dir )
27
+ end
28
+
29
+ private
30
+
31
+ def template_dir( template )
32
+ File.join( Gator::Util.project_template_root, template )
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,30 @@
1
+ require 'thor'
2
+ require 'thor/group'
3
+ require File.dirname(__FILE__) + '/project'
4
+
5
+ module Gator
6
+ class Runner < Thor
7
+ namespace
8
+
9
+ map "p" => :project
10
+
11
+ def initialize(args=[], options={}, config={})
12
+ super
13
+ end
14
+
15
+
16
+ # desc "project", "Project tasks"
17
+ # def project
18
+ #
19
+ # end
20
+
21
+ desc "version", "Show Gator version"
22
+
23
+ def version
24
+ say "Gator --pre"
25
+ end
26
+
27
+ end
28
+ end
29
+
30
+ Gator::Runner.register Gator::Project, "project", "project usage", "project description"
@@ -0,0 +1,14 @@
1
+ require "thor/util"
2
+ module Gator
3
+ class Util
4
+ # Returns the root where thor files are located, dependending on the OS.
5
+ #
6
+ def self.gator_root
7
+ File.join(Thor::Util.user_home, ".gator").gsub(/\\/, '/')
8
+ end
9
+
10
+ def self.project_template_root
11
+ File.join(gator_root, "templates", "projects")
12
+ end
13
+ end
14
+ end
@@ -50,11 +50,11 @@ describe Gator::Command do
50
50
  Gator::Command.has?(@test_command_a.command_alias).should == true
51
51
  end
52
52
 
53
- it "should return instance of TestCommandA by name" do
53
+ it "should return TestCommandA by name" do
54
54
  Gator::Command.get(@test_command_a.command_name).should == @test_command_a
55
55
  end
56
56
 
57
- it "should return instance of TestCommandA by alias" do
57
+ it "should return TestCommandA by alias" do
58
58
  Gator::Command.get(@test_command_a.command_alias).should == @test_command_a
59
59
  end
60
60
 
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.5.pre
4
+ version: 0.0.6.pre
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-03 00:00:00.000000000 +02:00
12
+ date: 2011-07-04 00:00:00.000000000 +02:00
13
13
  default_executable: gator
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
17
- requirement: &2152279880 !ruby/object:Gem::Requirement
17
+ requirement: &2156004360 !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: *2152279880
25
+ version_requirements: *2156004360
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &2152279400 !ruby/object:Gem::Requirement
28
+ requirement: &2156002300 !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: *2152279400
36
+ version_requirements: *2156002300
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &2152278920 !ruby/object:Gem::Requirement
39
+ requirement: &2155999100 !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: *2152278920
47
+ version_requirements: *2155999100
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: jeweler
50
- requirement: &2152278440 !ruby/object:Gem::Requirement
50
+ requirement: &2155996180 !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: *2152278440
58
+ version_requirements: *2155996180
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rcov
61
- requirement: &2152277960 !ruby/object:Gem::Requirement
61
+ requirement: &2155994220 !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: *2152277960
69
+ version_requirements: *2155994220
70
70
  description: gator - the friendly code-generator
71
71
  email: dominic.graefen@gmail.com
72
72
  executables:
@@ -85,24 +85,29 @@ files:
85
85
  - VERSION
86
86
  - bin/gator
87
87
  - gator.gemspec
88
- - lib/core.rb
89
- - lib/core/cli.rb
90
- - lib/core/cli/application.rb
91
- - lib/core/cli/shell.rb
92
- - lib/core/command.rb
93
- - lib/core/command/command.rb
94
- - lib/core/configuration.rb
95
- - lib/core/configuration/configuration.rb
96
- - lib/core/project.rb
97
- - lib/core/project/layout.rb
98
- - lib/core/project/project.rb
99
- - lib/default.rb
100
- - lib/default/commands/generator_command.rb
101
- - lib/default/commands/new_command.rb
102
- - lib/default/commands/new_template/.gator/project.rb.tt
103
- - lib/default/generators/AS3ClassTemplate.as.tt
104
- - lib/default/generators/as3_class_generator.rb
88
+ - lib/__legacy/core.rb
89
+ - lib/__legacy/core/cli.rb
90
+ - lib/__legacy/core/cli/application.rb
91
+ - lib/__legacy/core/cli/shell.rb
92
+ - lib/__legacy/core/command.rb
93
+ - lib/__legacy/core/command/command.rb
94
+ - lib/__legacy/core/configuration.rb
95
+ - lib/__legacy/core/configuration/configuration.rb
96
+ - lib/__legacy/core/project.rb
97
+ - lib/__legacy/core/project/layout.rb
98
+ - lib/__legacy/core/project/project.rb
99
+ - lib/__legacy/default.rb
100
+ - lib/__legacy/default/commands/generator_command.rb
101
+ - lib/__legacy/default/commands/new_command.rb
102
+ - lib/__legacy/default/commands/new_template/.gator/project.rb.tt
103
+ - lib/__legacy/default/generators/AS3ClassTemplate.as.tt
104
+ - lib/__legacy/default/generators/as3_class_generator.rb
105
+ - lib/__legacy/gator.rb
105
106
  - lib/gator.rb
107
+ - lib/gator/command.rb
108
+ - lib/gator/project.rb
109
+ - lib/gator/runner.rb
110
+ - lib/gator/util.rb
106
111
  - spec/core/command/command_spec.rb
107
112
  - spec/core/project/project_spec.rb
108
113
  - spec/spec_helper.rb
@@ -122,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
127
  version: '0'
123
128
  segments:
124
129
  - 0
125
- hash: -1055460137328960233
130
+ hash: 2347660495195831623
126
131
  required_rubygems_version: !ruby/object:Gem::Requirement
127
132
  none: false
128
133
  requirements: