puremvc-gen 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,9 @@
1
- === 1.0.0 / 2008-12-02
1
+ === 0.1.1 / 2008-12-18
2
+
3
+ * Working on Windows!
4
+ * Moved events directory into view folder
5
+
6
+ === 0.1.0 / 2008-12-02
2
7
 
3
8
  * 1 major enhancement
4
9
 
data/README.txt CHANGED
@@ -1,26 +1,82 @@
1
1
  = PureMVCGen
2
2
 
3
- * FIX (url)
3
+ * http://bit.ly/puremvc-gen
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- FIX (describe your package)
7
+ PureMVCGen is a ruby gem which wraps an ANT-based code generation
8
+ utility for generating PureMVC ActionScript code.
8
9
 
9
10
  == FEATURES/PROBLEMS:
10
11
 
11
- * FIX (list of features or problems)
12
+ -Features-
13
+
14
+ * Validates project property settings
15
+ * Generates the skeleton of a new Flex PureMVC project including:
16
+ - appropriate PureMVC folders
17
+ - Facade class
18
+ - StartupCommand and PrepareActorsCommand classes
19
+ * Generates skeleton PureMVC clases:
20
+ - SimpleCommand
21
+ - MacroCommand
22
+ _ Proxy
23
+ - Mediator
24
+
25
+ -Problems-
26
+
27
+ * MultiCore templates not yet created
12
28
 
13
29
  == SYNOPSIS:
14
-
15
- FIX (code sample of usage)
30
+ Lines starting with a $ denote the following command should
31
+ be run on the command line.
32
+
33
+ 1. Create a proj.properties file in the directory you wish to begin
34
+ your project
35
+
36
+ 2. $ puremvc-gen check
37
+
38
+ The check command will check if the required properties for a
39
+ project have been set. If they have not it will denote what
40
+ the required properties are. Refer to the example settings at
41
+ the blog post at http://bit.ly/puremvc-gen
42
+
43
+ 3. Set the required properties in proj.properties
44
+
45
+ 4. $ puremvc-gen init
46
+
47
+ The init command will create the skeleton of a new Flex PureMVC project.
48
+
49
+ If you want to create a new command:
50
+
51
+ $ puremvc-gen new command -n Example
52
+
53
+ which would generate a new SimpleCommand named ExampleCommand.
54
+
55
+ For help using puremvc-gen:
56
+
57
+ $ puremvc-gen help
58
+
59
+ which will output the usage:
60
+
61
+ Usage: puremvc-gen [options] COMMAND [options] [COMMAND [options] ...] [args]
62
+
63
+ Available commands:
64
+ check Validates that all required property settings are current detected
65
+ help Provide help for individual commands
66
+ init Initializes the current working directory with a new PureMVC project
67
+ new Command to generate PureMVC classes
68
+ command Creates a simple or macro command (defaults to simple).
69
+ mediator Creates a new mediator.
70
+ proxy Creates a new proxy.
71
+ version Show the version of the program
16
72
 
17
73
  == REQUIREMENTS:
18
74
 
19
- * FIX (list of requirements)
75
+ * Apache ANT: http://ant.apache.org
20
76
 
21
77
  == INSTALL:
22
78
 
23
- * FIX (sudo gem install, anything else)
79
+ * sudo gem install puremvc-gen
24
80
 
25
81
  == LICENSE:
26
82
 
data/bin/puremvc-gen CHANGED
@@ -7,7 +7,7 @@ PMVC_GEN_HOME = File.join(File.dirname(__FILE__), '..', 'conf')
7
7
  BUILDFILE = File.join(PMVC_GEN_HOME, 'build.xml')
8
8
 
9
9
  def call_ant(args='')
10
- system "ant -f #{BUILDFILE} -Dpmvcgen.dir=#{PMVC_GEN_HOME} -Dbasedir=#{Dir.pwd} #{args}"
10
+ system "#{ANT_BIN} -f #{File.expand_path BUILDFILE} -Dpmvcgen.dir=#{File.expand_path PMVC_GEN_HOME} -Dbasedir=#{Dir.pwd} #{args}"
11
11
  end
12
12
 
13
13
  cmd = CmdParse::CommandParser.new(true, true)
data/conf/build.xml CHANGED
@@ -183,7 +183,7 @@
183
183
  <mkdir dir="${core.dir}/${model.dir}" />
184
184
  <mkdir dir="${core.dir}/${view.dir}" />
185
185
  <mkdir dir="${core.dir}/${controller.dir}/components" />
186
- <mkdir dir="${core.dir}/${events.dir}" />
186
+ <mkdir dir="${core.dir}/${view.dir}/${events.dir}" />
187
187
  </target>
188
188
 
189
189
  <target name="set-filters">
@@ -217,7 +217,7 @@
217
217
  <echo>${log.gen.event}</echo>
218
218
  <input message="Specify the name of the new event class you wish to create:" addproperty="event.class.name" />
219
219
  <copy file="${event.template}"
220
- toFile="${core.dir}/${events.dir}/${event.class.name}.as">
220
+ toFile="${core.dir}/${view.dir}/${events.dir}/${event.class.name}.as">
221
221
  <filterset refid="common.filters" />
222
222
  <filterset>
223
223
  <filter token="event.name" value="${event.class.name}" />
@@ -9,7 +9,7 @@ module PureMVCGen
9
9
  # Searches the path, looking for the given utility. If an executable
10
10
  # file is found that matches the parameter, this returns true.
11
11
  def self.find_in_path(utility)
12
- path = (ENV['PATH'] || "").split(File::PATH_SEPARATOR)
12
+ path = self.get_path
13
13
  suffixes = self.on_windows? ? self.windows_executable_extensions : [""]
14
14
 
15
15
  path.each do |dir|
@@ -22,6 +22,25 @@ module PureMVCGen
22
22
  false
23
23
  end
24
24
 
25
+ def self.get_path
26
+ (ENV['PATH'] || "").split(File::PATH_SEPARATOR)
27
+ end
28
+
29
+ # Locates the ant executable or BAT file and returns the full path to it
30
+ def self.get_windows_ant
31
+ ext = %w(.exe .bat)
32
+ path = self.get_path
33
+
34
+ path.each do |dir|
35
+ ext.each do |sfx|
36
+ file = File.join(dir, "ant" + sfx)
37
+ return File.expand_path(file) if File.executable?(file)
38
+ end
39
+ end
40
+
41
+ nil
42
+ end
43
+
25
44
  def self.on_windows?
26
45
  RUBY_PLATFORM =~ /mswin|mingw/
27
46
  end
@@ -12,7 +12,7 @@ module PureMVCGen
12
12
 
13
13
  MAJOR = 0
14
14
  MINOR = 1
15
- TINY = 0
15
+ TINY = 1
16
16
 
17
17
  ARRAY = [MAJOR, MINOR, TINY]
18
18
  STRING = ARRAY.join(".")
@@ -15,6 +15,8 @@ unless PureMVCGen::AntChecker.has_ant_installed?
15
15
  exit 1
16
16
  end
17
17
 
18
+ ANT_BIN = PureMVCGen::AntChecker.on_windows? ? PureMVCGen::AntChecker.get_windows_ant : "ant"
19
+
18
20
  CMD_PATH = File.join(PMVC_GEN_LIB, 'commands')
19
21
 
20
22
  require File.join(CMD_PATH, 'command_extensions')
data/puremvc-gen.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{puremvc-gen}
5
- s.version = "0.1.0"
5
+ s.version = "0.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Greg Jastrab"]
9
- s.date = %q{2008-12-05}
9
+ s.date = %q{2008-12-18}
10
10
  s.default_executable = %q{puremvc-gen}
11
11
  s.description = %q{An ANT-based PureMVC generator.}
12
12
  s.email = %q{gjastrab.dev@gmail.com}
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
15
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
16
  s.has_rdoc = true
17
- s.homepage = %q{FIX (url)}
17
+ s.homepage = %q{http://bit.ly/puremvc-gen}
18
18
  s.rdoc_options = ["--main", "README.txt"]
19
19
  s.require_paths = ["lib"]
20
20
  s.rubyforge_project = %q{gjastrab}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puremvc-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Jastrab
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-05 00:00:00 -05:00
12
+ date: 2008-12-18 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -71,7 +71,7 @@ files:
71
71
  - puremvc-gen.gemspec
72
72
  - test/test_pure_m_v_c_gen.rb
73
73
  has_rdoc: true
74
- homepage: FIX (url)
74
+ homepage: http://bit.ly/puremvc-gen
75
75
  post_install_message:
76
76
  rdoc_options:
77
77
  - --main