extjs-mvc 0.4.0.b → 0.4.0.d

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. data/Rakefile +6 -9
  2. data/VERSION +1 -1
  3. data/bin/extjs-mvc +19 -0
  4. data/lib/extjs-mvc.rb +13 -67
  5. data/lib/{js → vendor}/App.js +0 -0
  6. data/lib/{js → vendor}/MVC.js +0 -0
  7. data/lib/{js → vendor}/Presenter.js +0 -0
  8. data/lib/{js → vendor}/README.rdoc +0 -0
  9. data/lib/{js → vendor}/controller/Controller.js +0 -0
  10. data/lib/{js → vendor}/controller/CrudController.js +0 -0
  11. data/lib/{js → vendor}/lib/Array.js +0 -0
  12. data/lib/{js → vendor}/lib/Booter.js +4 -3
  13. data/lib/{js → vendor}/lib/ClassManager.js +0 -0
  14. data/lib/{js → vendor}/lib/ControllerClassManager.js +0 -0
  15. data/lib/{js → vendor}/lib/Dependencies.js +0 -0
  16. data/lib/{js → vendor}/lib/DispatchMatcher.js +0 -0
  17. data/lib/{js → vendor}/lib/Dispatcher.js +0 -0
  18. data/lib/{js → vendor}/lib/Environment.js +0 -0
  19. data/lib/{js → vendor}/lib/Inflector.js +17 -0
  20. data/lib/{js → vendor}/lib/ModelClassManager.js +0 -0
  21. data/lib/{js → vendor}/lib/Route.js +0 -0
  22. data/lib/{js → vendor}/lib/Router.js +0 -0
  23. data/lib/{js → vendor}/lib/String.js +0 -0
  24. data/lib/{js → vendor}/lib/ViewClassManager.js +0 -0
  25. data/lib/{js → vendor}/lib/notes.txt +0 -0
  26. data/lib/{js → vendor}/model/AdapterManager.js +0 -0
  27. data/lib/{js → vendor}/model/Association.js +0 -0
  28. data/lib/{js → vendor}/model/Base.js +0 -0
  29. data/lib/{js → vendor}/model/BelongsToAssociation.js +0 -0
  30. data/lib/{js → vendor}/model/Cache.js +0 -0
  31. data/lib/{js → vendor}/model/HasManyAssociation.js +0 -0
  32. data/lib/{js → vendor}/model/Model.js +0 -0
  33. data/lib/{js → vendor}/model/UrlBuilder.js +0 -0
  34. data/lib/{js → vendor}/model/adapters/AbstractAdapter.js +0 -0
  35. data/lib/{js → vendor}/model/adapters/MemoryAdapter.js +0 -0
  36. data/lib/{js → vendor}/model/adapters/RESTAdapter.js +0 -0
  37. data/lib/{js → vendor}/model/adapters/RESTJSONAdapter.js +0 -0
  38. data/lib/{js → vendor}/model/adapters/notes.txt +0 -0
  39. data/lib/{js → vendor}/model/associations/Association.js +0 -0
  40. data/lib/{js → vendor}/model/associations/notes.txt +0 -0
  41. data/lib/{js → vendor}/model/validations/Errors.js +0 -0
  42. data/lib/{js → vendor}/model/validations/Plugin.js +0 -0
  43. data/lib/{js → vendor}/model/validations/Validations.js +0 -0
  44. data/lib/{js → vendor}/notes/Charts.graffle +0 -0
  45. data/lib/{js → vendor}/overrides/Ext.Component.js +0 -0
  46. data/lib/{js → vendor}/overrides/Ext.extend.js +0 -0
  47. data/lib/{js → vendor}/spec/Array.spec.js +0 -0
  48. data/lib/{js → vendor}/spec/ExtMVC.spec.js +0 -0
  49. data/lib/{js → vendor}/spec/Model.spec.js +0 -0
  50. data/lib/{js → vendor}/spec/OS.spec.js +0 -0
  51. data/lib/{js → vendor}/spec/Router.spec.js +0 -0
  52. data/lib/{js → vendor}/spec/SpecHelper.js +0 -0
  53. data/lib/{js → vendor}/spec/String.spec.js +0 -0
  54. data/lib/{js → vendor}/spec/model/AbstractAdapter.spec.js +0 -0
  55. data/lib/{js → vendor}/spec/model/Associations.spec.js +0 -0
  56. data/lib/{js → vendor}/spec/model/Cache.spec.js +0 -0
  57. data/lib/{js → vendor}/spec/model/RESTAdapter.spec.js +0 -0
  58. data/lib/{js → vendor}/spec/model/ValidationErrors.spec.js +0 -0
  59. data/lib/{js → vendor}/spec/model/Validations.spec.js +0 -0
  60. data/lib/{js → vendor}/spec/model/ValidationsPlugin.spec.js +0 -0
  61. data/lib/{js → vendor}/spec/suite.html +0 -0
  62. data/lib/{js → vendor}/specs-old/JSSpec.css +0 -0
  63. data/lib/{js → vendor}/specs-old/JSSpec.js +0 -0
  64. data/lib/{js → vendor}/specs-old/all.html +0 -0
  65. data/lib/{js → vendor}/specs-old/base.js +0 -0
  66. data/lib/{js → vendor}/specs-old/controller.js +0 -0
  67. data/lib/{js → vendor}/specs-old/diff_match_patch.js +0 -0
  68. data/lib/{js → vendor}/specs-old/model.js +0 -0
  69. data/lib/{js → vendor}/specs-old/route.js +0 -0
  70. data/lib/{js → vendor}/specs-old/router.js +0 -0
  71. data/lib/{js → vendor}/specs-old/string.js +0 -0
  72. data/lib/{js → vendor}/testrunner/JSpecFormatter.js +0 -0
  73. data/lib/{js → vendor}/testrunner/TestClient.js +0 -0
  74. data/lib/{js → vendor}/testrunner/TestGrid.js +0 -0
  75. data/lib/{js → vendor}/testrunner/TestRunner.js +0 -0
  76. data/lib/{js → vendor}/testrunner/TestViewport.js +0 -0
  77. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/EXAMPLE.html +0 -0
  78. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/LICENSE +0 -0
  79. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/README.markdown +0 -0
  80. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/jquery-1.2.3.js +0 -0
  81. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/jquery.fn.js +0 -0
  82. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/jquery.print.js +0 -0
  83. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.assets.js +0 -0
  84. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.behaviors.js +0 -0
  85. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.builder.js +0 -0
  86. data/lib/{js → vendor}/vendor/screw-unit/lib/screw.css +0 -0
  87. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.events.js +0 -0
  88. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.matchers.js +0 -0
  89. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.server.js +0 -0
  90. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/behaviors_spec.js +0 -0
  91. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/matchers_spec.js +0 -0
  92. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/print_spec.js +0 -0
  93. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/spec_helper.js +0 -0
  94. data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/suite.html +0 -0
  95. data/lib/{js → vendor}/view/FormWindow.js +0 -0
  96. data/lib/{js → vendor}/view/HasManyEditorGridPanel.js +0 -0
  97. data/lib/{js → vendor}/view/scaffold/Edit.js +0 -0
  98. data/lib/{js → vendor}/view/scaffold/Index.js +0 -0
  99. data/lib/{js → vendor}/view/scaffold/New.js +0 -0
  100. data/lib/{js → vendor}/view/scaffold/ScaffoldFormPanel.js +0 -0
  101. data/lib/{js/build → vendor.yml} +7 -1
  102. metadata +110 -203
  103. data/bin/xmvc +0 -13
  104. data/lib/extjs-mvc/README +0 -20
  105. data/lib/extjs-mvc/builder.rb +0 -83
  106. data/lib/extjs-mvc/builders/all_builder.rb +0 -15
  107. data/lib/extjs-mvc/builders/app_builder.rb +0 -36
  108. data/lib/extjs-mvc/builders/base.rb +0 -138
  109. data/lib/extjs-mvc/builders/css_builder.rb +0 -36
  110. data/lib/extjs-mvc/builders/docs_builder.rb +0 -20
  111. data/lib/extjs-mvc/builders/mvc_builder.rb +0 -33
  112. data/lib/extjs-mvc/builders/plugin_builder.rb +0 -53
  113. data/lib/extjs-mvc/cli.rb +0 -52
  114. data/lib/extjs-mvc/generator.rb +0 -79
  115. data/lib/extjs-mvc/generators/app.rb +0 -57
  116. data/lib/extjs-mvc/generators/base.rb +0 -53
  117. data/lib/extjs-mvc/generators/controller.rb +0 -41
  118. data/lib/extjs-mvc/generators/model.rb +0 -41
  119. data/lib/extjs-mvc/generators/scaffold.rb +0 -17
  120. data/lib/extjs-mvc/generators/templates/Controller.js +0 -17
  121. data/lib/extjs-mvc/generators/templates/Model.js +0 -9
  122. data/lib/extjs-mvc/generators/templates/ModelSpec.js +0 -12
  123. data/lib/extjs-mvc/generators/templates/View.js +0 -16
  124. data/lib/extjs-mvc/generators/templates/_Action.js +0 -7
  125. data/lib/extjs-mvc/generators/templates/app/README.rdoc +0 -152
  126. data/lib/extjs-mvc/generators/templates/app/app/App.js +0 -64
  127. data/lib/extjs-mvc/generators/templates/app/app/controllers/ApplicationController.js +0 -10
  128. data/lib/extjs-mvc/generators/templates/app/app/controllers/HomeController.js +0 -10
  129. data/lib/extjs-mvc/generators/templates/app/app/views/home/Index.js +0 -17
  130. data/lib/extjs-mvc/generators/templates/app/app/views/layout/Menu.js +0 -23
  131. data/lib/extjs-mvc/generators/templates/app/config/application.js +0 -1
  132. data/lib/extjs-mvc/generators/templates/app/config/boot.js +0 -67
  133. data/lib/extjs-mvc/generators/templates/app/config/build.xml +0 -77
  134. data/lib/extjs-mvc/generators/templates/app/config/database.js +0 -4
  135. data/lib/extjs-mvc/generators/templates/app/config/environment.json +0 -58
  136. data/lib/extjs-mvc/generators/templates/app/config/environments/development.json +0 -1
  137. data/lib/extjs-mvc/generators/templates/app/config/environments/production.json +0 -4
  138. data/lib/extjs-mvc/generators/templates/app/config/routes.js +0 -27
  139. data/lib/extjs-mvc/generators/templates/app/config/settings.yml +0 -3
  140. data/lib/extjs-mvc/generators/templates/app/public/index.html +0 -19
  141. data/lib/extjs-mvc/generators/templates/app/public/stylesheets/ext-mvc-all.css +0 -49
  142. data/lib/extjs-mvc/generators/templates/app/spec/SpecHelper.js +0 -0
  143. data/lib/extjs-mvc/generators/templates/app/spec/index.html +0 -66
  144. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.css +0 -90
  145. data/lib/extjs-mvc/generators/templates/scaffold/ScaffoldController.js +0 -18
  146. data/lib/extjs-mvc/generators/view.rb +0 -29
  147. data/lib/extjs-mvc/plugin.rb +0 -105
  148. data/lib/extjs-mvc/scripts.rb +0 -15
  149. data/lib/extjs-mvc/settings.rb +0 -75
  150. data/lib/extjs-mvc/setup.rb +0 -5
  151. data/lib/extjs-mvc/stats.rb +0 -241
  152. data/lib/extjs-mvc/test.rb +0 -11
  153. data/lib/extjs-mvc/testserver.ru +0 -95
  154. data/lib/extjs-mvc/ui.rb +0 -58
  155. data/lib/extjs-mvc/update.rb +0 -73
  156. data/lib/js/vendor/screw-unit/EXAMPLE.html +0 -68
  157. data/lib/js/vendor/screw-unit/LICENSE +0 -22
  158. data/lib/js/vendor/screw-unit/README.markdown +0 -307
  159. data/lib/js/vendor/screw-unit/lib/jquery-1.2.3.js +0 -3408
  160. data/lib/js/vendor/screw-unit/lib/jquery.fn.js +0 -29
  161. data/lib/js/vendor/screw-unit/lib/jquery.print.js +0 -108
  162. data/lib/js/vendor/screw-unit/lib/screw.assets.js +0 -36
  163. data/lib/js/vendor/screw-unit/lib/screw.behaviors.js +0 -91
  164. data/lib/js/vendor/screw-unit/lib/screw.builder.js +0 -80
  165. data/lib/js/vendor/screw-unit/lib/screw.events.js +0 -42
  166. data/lib/js/vendor/screw-unit/lib/screw.matchers.js +0 -145
  167. data/lib/js/vendor/screw-unit/lib/screw.server.js +0 -21
  168. data/lib/js/vendor/screw-unit/spec/behaviors_spec.js +0 -178
  169. data/lib/js/vendor/screw-unit/spec/matchers_spec.js +0 -237
  170. data/lib/js/vendor/screw-unit/spec/print_spec.js +0 -119
  171. data/lib/js/vendor/screw-unit/spec/spec_helper.js +0 -0
  172. data/lib/js/vendor/screw-unit/spec/suite.html +0 -18
data/Rakefile CHANGED
@@ -5,20 +5,17 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "extjs-mvc"
8
- gem.summary = %Q{A Rails-like MVC for the Ext JS javascript framework}
8
+ gem.summary = %Q{A Rails-like, full-stack MVC framework for the Ext JS javascript framework}
9
9
  gem.description = %Q{A full-stack, Rails-like MVC for the Ext JS javascript framework (originally known as extmvc/extmvc)}
10
10
  gem.email = "christocracy@gmail.com"
11
- gem.homepage = "http://github.com/christocracy/extjs-mvc-gem"
11
+ gem.homepage = "http://github.com/christocracy/extjs-mvc"
12
12
  gem.authors = ["Ed Spencer and Chris Scott"]
13
- gem.add_dependency "extlib"
14
- gem.add_dependency "json"
15
- gem.add_dependency "thor"
16
- gem.add_dependency "jammit-core"
17
- gem.add_dependency "hpricot"
18
-
13
+ gem.add_dependency "xmvc"
14
+ gem.add_dependency "extjs"
15
+ gem.add_dependency "thor-cheese"
19
16
 
20
17
  gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
21
- gem.files = FileList["[A-Z]*", "{bin,generators,lib,test,js}/**/*", 'lib/jeweler/templates/.gitignore']
18
+ gem.files = FileList["[A-Z]*", "{bin,lib,test,config}/**/*"]
22
19
 
23
20
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
24
21
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0.b
1
+ 0.4.0.d
data/bin/extjs-mvc ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/local/bin/ruby
2
+
3
+ # Check if an older version of extjs-mvc is installed
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
5
+ $LOAD_PATH.unshift('/Users/chris/workspace/extjs/xmvc/lib')
6
+ require 'xmvc'
7
+ require 'xmvc/cli'
8
+
9
+ require 'extjs-mvc'
10
+
11
+ # Boot Xmvc CLI listener feeding it an instance of ExtJS::MVC::CLI
12
+ begin
13
+ Xmvc::CLI.start(ARGV, {
14
+ :host => ExtJS::MVC # <-- Supplied module must contain a CLI Thor task extension
15
+ })
16
+ rescue Xmvc::Error => e
17
+ Xmvc.ui.error(e.message)
18
+ exit e.status_code
19
+ end
data/lib/extjs-mvc.rb CHANGED
@@ -1,80 +1,26 @@
1
- require 'fileutils'
2
- require 'pathname'
3
- require 'yaml'
4
- require 'json'
5
- require 'extlib/inflection'
6
-
7
1
  module ExtJS
8
2
  module MVC
9
- VERSION = "0.4.0"
10
-
11
- ROOT = File.dirname(__FILE__)
12
-
13
- ##
14
- # Do autoloads here
15
- #
16
- require 'extjs-mvc/settings'
17
-
18
- autoload :UI, 'extjs-mvc/ui'
19
- autoload :Generator, 'extjs-mvc/generator'
20
- autoload :BuilderManager, 'extjs-mvc/builder'
21
- autoload :Plugin, 'extjs-mvc/plugin'
22
- autoload :Stats, 'extjs-mvc/stats'
23
- autoload :Update, 'extjs-mvc/update'
24
- autoload :Text, 'extjs-mvc/test'
25
3
 
26
- class Error < StandardError
27
- def self.status_code(code = nil)
28
- return @code unless code
29
- @code = code
30
- end
4
+ VERSION = "0.4.0.a"
5
+
6
+ ROOT = File.dirname(__FILE__)
31
7
 
32
- def status_code
33
- self.class.status_code
34
- end
35
- end
36
-
37
- class ArgumentError < Error; status_code(1) ; end
38
- class AppNotFound < Error; status_code(2) ; end
39
- class AppAlreadyExists < Error; status_code(3) ; end
40
- class FileExists < Error; status_code(4) ; end
41
- class BuilderError < Error; status_code(5) ; end
8
+ VENDOR_NAME = 'extjs-mvc'
42
9
 
43
-
44
-
45
-
46
- ##
47
- # Add more error classes here
48
- #
49
- #class GemfileNotFound < BundlerError; status_code(10) ; end
50
- #class GemNotFound < BundlerError; status_code(7) ; end
10
+ VENDOR_PATH = File.join(ROOT, "vendor")
51
11
 
12
+ CONFIG_PATH = File.join(ROOT, "vendor.yml")
13
+
52
14
  class << self
53
- attr_writer :ui
54
-
55
- def configure
56
- @configured ||= begin
57
- ##
58
- # perform some config here?
59
- #
60
- #configure_gem_home_and_path
61
- true
62
- end
15
+
16
+ def config
17
+ @config ||= YAML.load(File.read(CONFIG_PATH)).to_mash
63
18
  end
64
19
 
65
- ##
66
- # Ensure we're running within a rails app unless generating a new app ($ xmvc generate app foo)
67
- #
68
- def ensure_in_app
69
- unless ARGV.empty? || ARGV.first == 'help' || (File.exists?('app') && File.exists?('config') && File.exists?('config/environment.json'))
70
- raise ExtJS::MVC::AppNotFound.new("This command must be executed from the root of an extjs-mvc application")
71
- end
20
+ def install(dest)
21
+ FileUtils.cp_r(VENDOR_PATH, File.join(dest, config["name"]))
72
22
  end
73
23
 
74
- def ui
75
- @ui ||= UI.new
76
- end
77
- end
24
+ end
78
25
  end
79
26
  end
80
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -157,7 +157,8 @@ ExtMVC.lib.Booter = Ext.extend(Ext.util.Observable, {
157
157
  // 'base': {preserveOrder: false, }
158
158
  // };
159
159
 
160
-
160
+ var underscore = ExtMVC.Inflector.underscore;
161
+
161
162
  Ext.each(env.config, function(file) {
162
163
  baseFiles.push(String.format("../{0}.js", file));
163
164
  }, this);
@@ -171,11 +172,11 @@ ExtMVC.lib.Booter = Ext.extend(Ext.util.Observable, {
171
172
  }, this);
172
173
 
173
174
  Ext.each(env.models, function(file) {
174
- modelFiles.push(String.format("{0}/models/{1}.js", env.appDir, file));
175
+ modelFiles.push(String.format("{0}/models/{1}.js", env.appDir, underscore(file)));
175
176
  }, this);
176
177
 
177
178
  Ext.each(env.controllers, function(file) {
178
- controllerFiles.push(String.format("{0}/controllers/{1}Controller.js", env.appDir, file));
179
+ controllerFiles.push(String.format("{0}/controllers/{1}_controller.js", env.appDir, underscore(file)));
179
180
  }, this);
180
181
 
181
182
  Ext.each(env.views, function(viewObj) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -85,6 +85,23 @@ ExtMVC.Inflector = {
85
85
  }
86
86
  },
87
87
 
88
+ camelize: function(str) {
89
+ return (str.charAt(0).toUpperCase()+str.slice(1)).replace(/[\-_]+(\S)?/g, function(match, chr) {
90
+ return chr ? chr.toUpperCase() : '';
91
+ });
92
+ },
93
+
94
+ // From http://code.google.com/p/inflection-js/source/browse/trunk/inflection.js
95
+ underscore: function(str) {
96
+ var str_path=str.split('::');
97
+ var upCase=new RegExp('([A-Z])','g');
98
+ var fb=new RegExp('^_');
99
+ for(var i=0;i<str_path.length;i++)
100
+ str_path[i]=str_path[i].replace(upCase,'_$1').replace(fb,'');
101
+ str=str_path.join('/').toLowerCase();
102
+ return str;
103
+ },
104
+
88
105
  pluralize: function(word) {
89
106
  var unusual = ExtMVC.Inflector.uncountableOrIrregular(word);
90
107
  if (unusual) { return unusual; }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,12 @@
1
1
  # Defines the build order of Ext MVC. Comments indicated with a hash.
2
2
  # Each line denotes either a single file, or a directory glob. If a glob, all matching files are included
3
3
  # (unless they have already been defined)
4
+ name: extjs-mvc
4
5
 
6
+ dependencies:
7
+ - extjs
8
+
9
+ javascripts:
5
10
  - MVC.js
6
11
  - App.js
7
12
  - lib/ClassManager.js
@@ -18,4 +23,5 @@
18
23
  - view/scaffold/ScaffoldFormPanel.js
19
24
  - view/scaffold/*.js
20
25
  - testrunner/TestRunner.js
21
- - testrunner/*.js
26
+ - testrunner/*.js
27
+ stylesheets: