chester 0.3.1 → 0.4.0
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.
- data/VERSION +1 -1
- data/chester.gemspec +29 -37
- data/lib/chester/templates/chester.coffee +12 -15
- data/lib/chester/templates/chester.js +67 -0
- data/lib/chester/templates/controller.coffee.erb +0 -3
- data/lib/chester/templates/helper.coffee.erb +2 -4
- data/lib/chester/templates/model.coffee.erb +2 -4
- data/readme.md +5 -1
- metadata +52 -25
- data/.gitignore +0 -21
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/chester.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{chester}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tom Wilson", "Andrew Kennedy", "Nick Bucciarelli"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-08-19}
|
13
13
|
s.default_executable = %q{chester}
|
14
14
|
s.description = %q{This project use coffeescript and MVC to create an awesome framework for the Titanium system!}
|
15
15
|
s.email = %q{tom@jackhq.com}
|
@@ -19,48 +19,40 @@ Gem::Specification.new do |s|
|
|
19
19
|
]
|
20
20
|
s.files = [
|
21
21
|
".document",
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
22
|
+
"LICENSE",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"bin/chester",
|
26
|
+
"chester.gemspec",
|
27
|
+
"lib/chester.rb",
|
28
|
+
"lib/chester/command.rb",
|
29
|
+
"lib/chester/commands/base.rb",
|
30
|
+
"lib/chester/commands/brew.rb",
|
31
|
+
"lib/chester/commands/generate.rb",
|
32
|
+
"lib/chester/commands/install.rb",
|
33
|
+
"lib/chester/helpers.rb",
|
34
|
+
"lib/chester/templates/chester.coffee",
|
35
|
+
"lib/chester/templates/chester.js",
|
36
|
+
"lib/chester/templates/controller.coffee.erb",
|
37
|
+
"lib/chester/templates/helper.coffee.erb",
|
38
|
+
"lib/chester/templates/model.coffee.erb",
|
39
|
+
"lib/chester/templates/view.coffee.erb",
|
40
|
+
"readme.md",
|
41
|
+
"spec/base.rb",
|
42
|
+
"spec/commands/brew_spec.rb",
|
43
|
+
"spec/commands/generate_spec.rb",
|
44
|
+
"spec/commands/install_spec.rb",
|
45
|
+
"spec/spec.opts"
|
46
46
|
]
|
47
47
|
s.homepage = %q{http://github.com/twilson63/chester}
|
48
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
49
48
|
s.require_paths = ["lib"]
|
50
|
-
s.rubygems_version = %q{1.
|
49
|
+
s.rubygems_version = %q{1.6.2}
|
51
50
|
s.summary = %q{MVC for Titanium Developer}
|
52
|
-
s.test_files = [
|
53
|
-
"spec/base.rb",
|
54
|
-
"spec/commands/brew_spec.rb",
|
55
|
-
"spec/commands/generate_spec.rb",
|
56
|
-
"spec/commands/install_spec.rb"
|
57
|
-
]
|
58
51
|
|
59
52
|
if s.respond_to? :specification_version then
|
60
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
61
53
|
s.specification_version = 3
|
62
54
|
|
63
|
-
if Gem::Version.new(Gem::
|
55
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
64
56
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
65
57
|
s.add_runtime_dependency(%q<erubis>, [">= 2.6.5"])
|
66
58
|
s.add_runtime_dependency(%q<activesupport>, [">= 2.3.5"])
|
@@ -11,19 +11,18 @@
|
|
11
11
|
|
12
12
|
class Base
|
13
13
|
constructor: (name) ->
|
14
|
-
@name
|
14
|
+
@name = name
|
15
15
|
children: []
|
16
16
|
names: []
|
17
17
|
find: (name) ->
|
18
18
|
@children[@names.indexOf(name)]
|
19
19
|
_: (name) ->
|
20
20
|
@find(name)
|
21
|
-
|
22
21
|
add: (child) ->
|
23
|
-
child.parent
|
24
|
-
@children[@children.length]
|
25
|
-
@names[@names.length]
|
26
|
-
|
22
|
+
child.parent = this
|
23
|
+
@children[@children.length] = child
|
24
|
+
@names[@names.length] = child.name
|
25
|
+
|
27
26
|
class Application extends Base
|
28
27
|
version: "0.3.0"
|
29
28
|
run: (options) ->
|
@@ -35,15 +34,13 @@ class View extends Base
|
|
35
34
|
render: ->
|
36
35
|
print "Not Implemented"
|
37
36
|
|
38
|
-
Chester
|
39
|
-
Chester.View
|
40
|
-
Chester.Controller
|
37
|
+
Chester = new Base()
|
38
|
+
Chester.View = View
|
39
|
+
Chester.Controller = Controller
|
41
40
|
|
42
41
|
Chester.add(new Application('app'))
|
43
|
-
Chester._('app').Models
|
44
|
-
Chester._('app').Helpers
|
45
|
-
|
46
|
-
|
47
|
-
root: exports ? this
|
48
|
-
root.Chester: Chester
|
42
|
+
Chester._('app').Models = new Base('Models')
|
43
|
+
Chester._('app').Helpers = new Base('Helpers')
|
49
44
|
|
45
|
+
root = exports ? this
|
46
|
+
root.Chester = Chester
|
@@ -0,0 +1,67 @@
|
|
1
|
+
(function() {
|
2
|
+
var Application, Base, Chester, Controller, View, root;
|
3
|
+
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
|
4
|
+
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
|
5
|
+
function ctor() { this.constructor = child; }
|
6
|
+
ctor.prototype = parent.prototype;
|
7
|
+
child.prototype = new ctor;
|
8
|
+
child.__super__ = parent.prototype;
|
9
|
+
return child;
|
10
|
+
};
|
11
|
+
Base = (function() {
|
12
|
+
function Base(name) {
|
13
|
+
this.name = name;
|
14
|
+
}
|
15
|
+
Base.prototype.children = [];
|
16
|
+
Base.prototype.names = [];
|
17
|
+
Base.prototype.find = function(name) {
|
18
|
+
return this.children[this.names.indexOf(name)];
|
19
|
+
};
|
20
|
+
Base.prototype._ = function(name) {
|
21
|
+
return this.find(name);
|
22
|
+
};
|
23
|
+
Base.prototype.add = function(child) {
|
24
|
+
child.parent = this;
|
25
|
+
this.children[this.children.length] = child;
|
26
|
+
return this.names[this.names.length] = child.name;
|
27
|
+
};
|
28
|
+
return Base;
|
29
|
+
})();
|
30
|
+
Application = (function() {
|
31
|
+
__extends(Application, Base);
|
32
|
+
function Application() {
|
33
|
+
Application.__super__.constructor.apply(this, arguments);
|
34
|
+
}
|
35
|
+
Application.prototype.version = "0.3.0";
|
36
|
+
Application.prototype.run = function(options) {
|
37
|
+
var _ref, _ref2;
|
38
|
+
return this.find(options.controller)[(_ref2 = options.action) != null ? _ref2 : options.action = '_index']((_ref = options.params) != null ? _ref : options.params = {});
|
39
|
+
};
|
40
|
+
return Application;
|
41
|
+
})();
|
42
|
+
Controller = (function() {
|
43
|
+
__extends(Controller, Base);
|
44
|
+
function Controller() {
|
45
|
+
Controller.__super__.constructor.apply(this, arguments);
|
46
|
+
}
|
47
|
+
return Controller;
|
48
|
+
})();
|
49
|
+
View = (function() {
|
50
|
+
__extends(View, Base);
|
51
|
+
function View() {
|
52
|
+
View.__super__.constructor.apply(this, arguments);
|
53
|
+
}
|
54
|
+
View.prototype.render = function() {
|
55
|
+
return print("Not Implemented");
|
56
|
+
};
|
57
|
+
return View;
|
58
|
+
})();
|
59
|
+
Chester = new Base();
|
60
|
+
Chester.View = View;
|
61
|
+
Chester.Controller = Controller;
|
62
|
+
Chester.add(new Application('app'));
|
63
|
+
Chester._('app').Models = new Base('Models');
|
64
|
+
Chester._('app').Helpers = new Base('Helpers');
|
65
|
+
root = typeof exports !== "undefined" && exports !== null ? exports : this;
|
66
|
+
root.Chester = Chester;
|
67
|
+
}).call(this);
|
@@ -1,13 +1,10 @@
|
|
1
1
|
class <%= name %>Controller extends Chester.Controller
|
2
2
|
_index: (params) ->
|
3
3
|
#TODO INDEX VIEW
|
4
|
-
|
5
4
|
_new: (params) ->
|
6
5
|
#TODO NEW VIEW
|
7
|
-
|
8
6
|
_create: (params) ->
|
9
7
|
#TODO NEW VIEW
|
10
|
-
|
11
8
|
|
12
9
|
# Register Controller to application
|
13
10
|
Chester._('app').add(new <%= name %>Controller('<%= name %>Controller'))
|
@@ -1,14 +1,12 @@
|
|
1
1
|
class <%= name %>
|
2
2
|
constructor: (name) ->
|
3
|
-
@name
|
4
|
-
|
3
|
+
@name = name
|
5
4
|
_all: ->
|
6
5
|
# Get All Records
|
7
6
|
_find_by_id: (id) ->
|
8
7
|
# Get model record by id
|
9
8
|
_create: (<%= name.downcase %>) ->
|
10
9
|
# create Record
|
11
|
-
|
12
10
|
# Insert your code here
|
13
|
-
|
11
|
+
|
14
12
|
Chester._('app').Models.add(new <%= name %>('<%= name %>'))
|
data/readme.md
CHANGED
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chester
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Tom Wilson
|
@@ -11,39 +17,57 @@ autorequire:
|
|
11
17
|
bindir: bin
|
12
18
|
cert_chain: []
|
13
19
|
|
14
|
-
date:
|
20
|
+
date: 2011-08-19 00:00:00 -04:00
|
15
21
|
default_executable: chester
|
16
22
|
dependencies:
|
17
23
|
- !ruby/object:Gem::Dependency
|
18
24
|
name: rspec
|
19
|
-
|
20
|
-
|
21
|
-
|
25
|
+
prerelease: false
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
22
28
|
requirements:
|
23
29
|
- - ">="
|
24
30
|
- !ruby/object:Gem::Version
|
31
|
+
hash: 13
|
32
|
+
segments:
|
33
|
+
- 1
|
34
|
+
- 2
|
35
|
+
- 9
|
25
36
|
version: 1.2.9
|
26
|
-
|
37
|
+
type: :development
|
38
|
+
version_requirements: *id001
|
27
39
|
- !ruby/object:Gem::Dependency
|
28
40
|
name: erubis
|
29
|
-
|
30
|
-
|
31
|
-
|
41
|
+
prerelease: false
|
42
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
32
44
|
requirements:
|
33
45
|
- - ">="
|
34
46
|
- !ruby/object:Gem::Version
|
47
|
+
hash: 29
|
48
|
+
segments:
|
49
|
+
- 2
|
50
|
+
- 6
|
51
|
+
- 5
|
35
52
|
version: 2.6.5
|
36
|
-
|
53
|
+
type: :runtime
|
54
|
+
version_requirements: *id002
|
37
55
|
- !ruby/object:Gem::Dependency
|
38
56
|
name: activesupport
|
39
|
-
|
40
|
-
|
41
|
-
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
42
60
|
requirements:
|
43
61
|
- - ">="
|
44
62
|
- !ruby/object:Gem::Version
|
63
|
+
hash: 9
|
64
|
+
segments:
|
65
|
+
- 2
|
66
|
+
- 3
|
67
|
+
- 5
|
45
68
|
version: 2.3.5
|
46
|
-
|
69
|
+
type: :runtime
|
70
|
+
version_requirements: *id003
|
47
71
|
description: This project use coffeescript and MVC to create an awesome framework for the Titanium system!
|
48
72
|
email: tom@jackhq.com
|
49
73
|
executables:
|
@@ -54,7 +78,6 @@ extra_rdoc_files:
|
|
54
78
|
- LICENSE
|
55
79
|
files:
|
56
80
|
- .document
|
57
|
-
- .gitignore
|
58
81
|
- LICENSE
|
59
82
|
- Rakefile
|
60
83
|
- VERSION
|
@@ -68,6 +91,7 @@ files:
|
|
68
91
|
- lib/chester/commands/install.rb
|
69
92
|
- lib/chester/helpers.rb
|
70
93
|
- lib/chester/templates/chester.coffee
|
94
|
+
- lib/chester/templates/chester.js
|
71
95
|
- lib/chester/templates/controller.coffee.erb
|
72
96
|
- lib/chester/templates/helper.coffee.erb
|
73
97
|
- lib/chester/templates/model.coffee.erb
|
@@ -83,31 +107,34 @@ homepage: http://github.com/twilson63/chester
|
|
83
107
|
licenses: []
|
84
108
|
|
85
109
|
post_install_message:
|
86
|
-
rdoc_options:
|
87
|
-
|
110
|
+
rdoc_options: []
|
111
|
+
|
88
112
|
require_paths:
|
89
113
|
- lib
|
90
114
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
91
116
|
requirements:
|
92
117
|
- - ">="
|
93
118
|
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
94
122
|
version: "0"
|
95
|
-
version:
|
96
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
97
125
|
requirements:
|
98
126
|
- - ">="
|
99
127
|
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
100
131
|
version: "0"
|
101
|
-
version:
|
102
132
|
requirements: []
|
103
133
|
|
104
134
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.
|
135
|
+
rubygems_version: 1.6.2
|
106
136
|
signing_key:
|
107
137
|
specification_version: 3
|
108
138
|
summary: MVC for Titanium Developer
|
109
|
-
test_files:
|
110
|
-
|
111
|
-
- spec/commands/brew_spec.rb
|
112
|
-
- spec/commands/generate_spec.rb
|
113
|
-
- spec/commands/install_spec.rb
|
139
|
+
test_files: []
|
140
|
+
|