gator 0.0.7.pre → 0.0.8.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.7.pre
1
+ 0.0.8.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.7.pre"
8
+ s.version = "0.0.8.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"]
@@ -47,8 +47,8 @@ Gem::Specification.new do |s|
47
47
  "lib/__legacy/default/generators/as3_class_generator.rb",
48
48
  "lib/__legacy/gator.rb",
49
49
  "lib/gator.rb",
50
- "lib/gator/command.rb",
51
- "lib/gator/project.rb",
50
+ "lib/gator/commands/command.rb",
51
+ "lib/gator/commands/project_command.rb",
52
52
  "lib/gator/runner.rb",
53
53
  "lib/gator/util.rb",
54
54
  "spec/core/command/command_spec.rb",
@@ -2,7 +2,7 @@ require "thor/actions"
2
2
  module Gator
3
3
  module AS3
4
4
  class AS3ClassGenerator < Gator::Generators::Base
5
- include Gator::Project, Thor::Actions
5
+ include Gator::ProjectCommand, Thor::Actions
6
6
 
7
7
  specify "as3class", "as3c"
8
8
 
@@ -1,2 +1,3 @@
1
1
  require File.dirname(__FILE__) + '/gator/runner'
2
- require File.dirname(__FILE__) + '/gator/project'
2
+ require File.dirname(__FILE__) + '/gator/commands/command'
3
+ require File.dirname(__FILE__) + '/gator/commands/project_command'
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/runner'
1
+ require File.dirname(__FILE__) + '/../runner'
2
2
 
3
3
  module Gator
4
4
  class Command < Thor
@@ -1,14 +1,14 @@
1
1
  require "thor"
2
2
  require "thor/actions"
3
3
  require "fileutils"
4
- require File.dirname(__FILE__) + '/util'
4
+ require File.dirname(__FILE__) + '/../util'
5
5
  require File.dirname(__FILE__) + '/command'
6
6
 
7
7
  module Gator
8
- class Project < Command
8
+ class ProjectCommand < Command
9
9
  include Thor::Actions
10
10
 
11
- register_command "project", "project TASK", "Set of tasks to manage project templates.", [:p]
11
+ register_command "project", "project TASK", "Set of tasks to manage project templates.", ["p"]
12
12
 
13
13
  def self.source_root
14
14
  Gator::Util.project_template_root
@@ -20,6 +20,7 @@ module Gator
20
20
  template ||= File.expand_path( File.dirname(entries.first) ).split(File::SEPARATOR).last
21
21
  empty_directory template_dir(template)
22
22
  FileUtils.cp_r entries, template_dir(template)
23
+ create_empty_directory_files template_dir(template)
23
24
  end
24
25
 
25
26
  desc "project uninstall TEMPLATE_NAME", "Uninstall a project template."
@@ -34,7 +35,7 @@ module Gator
34
35
 
35
36
  desc "project wipe", "Delete all project templates."
36
37
  def wipe
37
- template_root_entries.each { |e| FileUtils.rm_r e }
38
+ template_root_entries(true).each { |e| FileUtils.rm_r e }
38
39
  end
39
40
 
40
41
  desc "project list [SEARCH]", "Lists project templates."
@@ -47,6 +48,12 @@ module Gator
47
48
 
48
49
  private
49
50
 
51
+ def create_empty_directory_files( dir )
52
+ Dir.glob( File.join( dir, "**", "*" ) ).each {|f|
53
+ create_file File.join(f,".empty_directory"), ".empty_directory" if File.directory?(f) && Dir.entries(f).length == 2
54
+ }
55
+ end
56
+
50
57
  def template_dir( template )
51
58
  File.join( Gator::Util.project_template_root, template )
52
59
  end
@@ -59,8 +66,8 @@ module Gator
59
66
  entries
60
67
  end
61
68
 
62
- def template_root_entries
63
- directory_entries Gator::Util.project_template_root, false
69
+ def template_root_entries( join_with_dir=false )
70
+ directory_entries Gator::Util.project_template_root, join_with_dir
64
71
  end
65
72
 
66
73
  end
@@ -3,11 +3,6 @@ require 'thor/group'
3
3
 
4
4
  module Gator
5
5
  class Runner < Thor
6
- namespace
7
-
8
- def initialize(args=[], options={}, config={})
9
- super
10
- end
11
6
 
12
7
  desc "version", "Show Gator version"
13
8
  def version
@@ -1,8 +1,6 @@
1
1
  require "thor/util"
2
2
  module Gator
3
3
  class Util
4
- # Returns the root where thor files are located, dependending on the OS.
5
- #
6
4
  def self.gator_root
7
5
  File.join(Thor::Util.user_home, ".gator").gsub(/\\/, '/')
8
6
  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.7.pre
4
+ version: 0.0.8.pre
5
5
  prerelease: 6
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: &2162001840 !ruby/object:Gem::Requirement
17
+ requirement: &2157177140 !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: *2162001840
25
+ version_requirements: *2157177140
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &2162001260 !ruby/object:Gem::Requirement
28
+ requirement: &2157176660 !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: *2162001260
36
+ version_requirements: *2157176660
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &2162000740 !ruby/object:Gem::Requirement
39
+ requirement: &2157176180 !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: *2162000740
47
+ version_requirements: *2157176180
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: jeweler
50
- requirement: &2162000060 !ruby/object:Gem::Requirement
50
+ requirement: &2157175680 !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: *2162000060
58
+ version_requirements: *2157175680
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rcov
61
- requirement: &2161999420 !ruby/object:Gem::Requirement
61
+ requirement: &2157175140 !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: *2161999420
69
+ version_requirements: *2157175140
70
70
  description: gator - the friendly code-generator
71
71
  email: dominic.graefen@gmail.com
72
72
  executables:
@@ -104,8 +104,8 @@ files:
104
104
  - lib/__legacy/default/generators/as3_class_generator.rb
105
105
  - lib/__legacy/gator.rb
106
106
  - lib/gator.rb
107
- - lib/gator/command.rb
108
- - lib/gator/project.rb
107
+ - lib/gator/commands/command.rb
108
+ - lib/gator/commands/project_command.rb
109
109
  - lib/gator/runner.rb
110
110
  - lib/gator/util.rb
111
111
  - spec/core/command/command_spec.rb
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  segments:
129
129
  - 0
130
- hash: -285001172832039557
130
+ hash: 886414708621088271
131
131
  required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  none: false
133
133
  requirements: