gjastrab-puremvc-gen 0.1.1

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.
@@ -0,0 +1,16 @@
1
+ module PureMVCGen
2
+ module Commands
3
+ class InitializeCommand < CmdParse::Command
4
+
5
+ def initialize
6
+ super('init', false)
7
+ self.short_desc = "Initializes the current working directory with a new PureMVC project"
8
+ end
9
+
10
+ def execute(args)
11
+ call_ant "new-pmvc"
12
+ end
13
+
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,86 @@
1
+ module PureMVCGen
2
+ module Commands
3
+ class NewCommand < CmdParse::Command
4
+
5
+ def initialize
6
+ super('new', true)
7
+ self.short_desc = "Command to generate PureMVC classes"
8
+
9
+ # add sub commands
10
+ self.add_command(CreateCommand.new)
11
+ self.add_command(CreateMediator.new)
12
+ self.add_command(CreateProxy.new)
13
+ end
14
+
15
+ class CreateCommand < CmdParse::Command
16
+
17
+ def initialize
18
+ super('command', false)
19
+ @type = :simple
20
+ self.short_desc = "Creates a simple or macro command (defaults to simple)."
21
+ self.description = <<-EOL
22
+ Generates a simple or macro command.
23
+ Generating a simple command is the default behavior, unless the macro switch is passed:
24
+ -m or --macro
25
+
26
+ If no other switches are passed, the ANT script will prompt for a command name and constant,
27
+ however these may be passed on the command line with the -n (or --name) and -c (or --const) switches.
28
+ EOL
29
+ self.options = default_options do |opt|
30
+ opt.on("-m", "--macro", "Specifies the command is a MacroCommand") { @type = :macro }
31
+ opt.on("-n", "--name COMMAND_NAME", "Specifies the name for the command") { |name| @command_name = name }
32
+ opt.on("-c", "--const COMMAND_CONSTANT", "Specifies the constant to use for the command") { |const| @command_const = const }
33
+ end
34
+ end
35
+
36
+ def execute(args)
37
+ cmd = ""
38
+ cmd << "-Dcmd.name=#{@command_name} " unless @command_name.nil?
39
+ cmd << "-Dcmd.const=#{@command_const} " unless @command_const.nil?
40
+ cmd << "#{@type == :simple ? "create-simple-command" : "create-macro-command"}"
41
+ call_ant cmd
42
+ end
43
+
44
+ end
45
+
46
+ class CreateMediator < CmdParse::Command
47
+
48
+ def initialize
49
+ super('mediator', false)
50
+ self.short_desc = "Creates a new mediator."
51
+ self.options = default_options do |opt|
52
+ opt.on("-n", "--name MEDIATOR_NAME", "Specifies the name for the mediator") { |name| @mediator_name = name }
53
+ end
54
+ end
55
+
56
+ def execute(args)
57
+ cmd = ""
58
+ cmd << "-Dmediator.name=#{@mediator_name} " unless @mediator_name.nil?
59
+ cmd << "create-mediator"
60
+ call_ant cmd
61
+ end
62
+
63
+ end
64
+
65
+ class CreateProxy < CmdParse::Command
66
+
67
+ def initialize
68
+ super('proxy', false)
69
+ self.short_desc = "Creates a new proxy."
70
+ self.options = default_options do |opt|
71
+ opt.on("-n", "--name PROXY_NAME", "Specifies the name for the proxy") { |name| @proxy_name = name }
72
+ end
73
+ end
74
+
75
+ def execute(args)
76
+ cmd = ""
77
+ cmd << "-Dproxy.name=#{@proxy_name} " unless @proxy_name.nil?
78
+ cmd << "create-proxy"
79
+ call_ant cmd
80
+ end
81
+
82
+ end
83
+
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,21 @@
1
+ module PureMVCGen
2
+ module Version #:nodoc:
3
+ # A method for comparing versions of required modules. It expects two
4
+ # arrays of integers as parameters, the first being the minimum version
5
+ # required, and the second being the actual version available. It returns
6
+ # true if the actual version is at least equal to the required version.
7
+ def self.check(required, actual) #:nodoc:
8
+ required = required.map { |v| "%06d" % v }.join(".")
9
+ actual = actual.map { |v| "%06d" % v }.join(".")
10
+ return actual >= required
11
+ end
12
+
13
+ MAJOR = 0
14
+ MINOR = 1
15
+ TINY = 1
16
+
17
+ ARRAY = [MAJOR, MINOR, TINY]
18
+ STRING = ARRAY.join(".")
19
+ end
20
+ end
21
+
@@ -0,0 +1,40 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{puremvc-gen}
5
+ s.version = "0.1.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Greg Jastrab"]
9
+ s.date = %q{2008-12-18}
10
+ s.default_executable = %q{puremvc-gen}
11
+ s.description = %q{An ANT-based PureMVC generator.}
12
+ s.email = %q{gjastrab.dev@gmail.com}
13
+ s.executables = ["puremvc-gen"]
14
+ s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
15
+ s.files = ["History.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/puremvc-gen", "conf/build.xml", "conf/config/pmvcgen.log.properties", "conf/config/pmvcgen.properties", "conf/example/author.properties", "conf/example/proj.properties", "conf/templates/.DS_Store", "conf/templates/Event.tpl", "conf/templates/standard/Application.tpl", "conf/templates/standard/Facade.tpl", "conf/templates/standard/MacroCommand.tpl", "conf/templates/standard/Mediator.tpl", "conf/templates/standard/Proxy.tpl", "conf/templates/standard/SimpleCommand.tpl", "lib/pure_m_v_c_gen.rb", "lib/pure_m_v_c_gen/ant_checker.rb", "lib/pure_m_v_c_gen/commands/check_command.rb", "lib/pure_m_v_c_gen/commands/command_extensions.rb", "lib/pure_m_v_c_gen/commands/initialize_command.rb", "lib/pure_m_v_c_gen/commands/new_command.rb", "lib/pure_m_v_c_gen/version.rb", "puremvc-gen.gemspec", "test/test_pure_m_v_c_gen.rb"]
16
+ s.has_rdoc = true
17
+ s.homepage = %q{http://bit.ly/puremvc-gen}
18
+ s.rdoc_options = ["--main", "README.txt"]
19
+ s.require_paths = ["lib"]
20
+ s.rubyforge_project = %q{gjastrab}
21
+ s.rubygems_version = %q{1.3.1}
22
+ s.summary = %q{An ANT-based PureMVC generator.}
23
+ s.test_files = ["test/test_pure_m_v_c_gen.rb"]
24
+
25
+ if s.respond_to? :specification_version then
26
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
+ s.specification_version = 2
28
+
29
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
+ s.add_runtime_dependency(%q<cmdparse>, [">= 2.0.2"])
31
+ s.add_development_dependency(%q<hoe>, [">= 1.8.2"])
32
+ else
33
+ s.add_dependency(%q<cmdparse>, [">= 2.0.2"])
34
+ s.add_dependency(%q<hoe>, [">= 1.8.2"])
35
+ end
36
+ else
37
+ s.add_dependency(%q<cmdparse>, [">= 2.0.2"])
38
+ s.add_dependency(%q<hoe>, [">= 1.8.2"])
39
+ end
40
+ end
File without changes
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gjastrab-puremvc-gen
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Greg Jastrab
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-18 00:00:00 -08:00
13
+ default_executable: puremvc-gen
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: cmdparse
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.2
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: hoe
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 1.8.2
32
+ version:
33
+ description: An ANT-based PureMVC generator.
34
+ email: gjastrab.dev@gmail.com
35
+ executables:
36
+ - puremvc-gen
37
+ extensions: []
38
+
39
+ extra_rdoc_files:
40
+ - History.txt
41
+ - Manifest.txt
42
+ - README.txt
43
+ files:
44
+ - History.txt
45
+ - Manifest.txt
46
+ - README.txt
47
+ - Rakefile
48
+ - bin/puremvc-gen
49
+ - conf/build.xml
50
+ - conf/config/pmvcgen.log.properties
51
+ - conf/config/pmvcgen.properties
52
+ - conf/example/author.properties
53
+ - conf/example/proj.properties
54
+ - conf/templates/.DS_Store
55
+ - conf/templates/Event.tpl
56
+ - conf/templates/standard/Application.tpl
57
+ - conf/templates/standard/Facade.tpl
58
+ - conf/templates/standard/MacroCommand.tpl
59
+ - conf/templates/standard/Mediator.tpl
60
+ - conf/templates/standard/Proxy.tpl
61
+ - conf/templates/standard/SimpleCommand.tpl
62
+ - lib/pure_m_v_c_gen.rb
63
+ - lib/pure_m_v_c_gen/ant_checker.rb
64
+ - lib/pure_m_v_c_gen/commands/check_command.rb
65
+ - lib/pure_m_v_c_gen/commands/command_extensions.rb
66
+ - lib/pure_m_v_c_gen/commands/initialize_command.rb
67
+ - lib/pure_m_v_c_gen/commands/new_command.rb
68
+ - lib/pure_m_v_c_gen/version.rb
69
+ - puremvc-gen.gemspec
70
+ - test/test_pure_m_v_c_gen.rb
71
+ has_rdoc: true
72
+ homepage: http://bit.ly/puremvc-gen
73
+ post_install_message:
74
+ rdoc_options:
75
+ - --main
76
+ - README.txt
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: "0"
84
+ version:
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: "0"
90
+ version:
91
+ requirements: []
92
+
93
+ rubyforge_project: gjastrab
94
+ rubygems_version: 1.2.0
95
+ signing_key:
96
+ specification_version: 2
97
+ summary: An ANT-based PureMVC generator.
98
+ test_files:
99
+ - test/test_pure_m_v_c_gen.rb