coherent 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/LICENSE +203 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +61 -0
  4. data/VERSION +1 -0
  5. data/app_generators/coherent/USAGE +5 -0
  6. data/app_generators/coherent/coherent_generator.rb +95 -0
  7. data/app_generators/coherent/templates/distil.yml.erb +40 -0
  8. data/app_generators/coherent/templates/src/NOTICE.erb +2 -0
  9. data/app_generators/coherent/templates/src/css/@name@.css.erb +120 -0
  10. data/app_generators/coherent/templates/src/css/reset.css +70 -0
  11. data/app_generators/coherent/templates/src/js/@name@.js.erb +5 -0
  12. data/app_generators/coherent/templates/src/pages/index.html.erb +25 -0
  13. data/bin/coherent +31 -0
  14. data/coherent.gemspec +84 -0
  15. data/generators/class/USAGE +5 -0
  16. data/generators/class/class_generator.rb +56 -0
  17. data/generators/class/templates/@name@.js.erb +19 -0
  18. data/generators/coherent_library/USAGE +5 -0
  19. data/generators/coherent_library/coherent_library_generator.rb +44 -0
  20. data/generators/gallery_sample/USAGE +5 -0
  21. data/generators/gallery_sample/gallery_sample_generator.rb +48 -0
  22. data/generators/gallery_sample/templates/src/nibs/@name@/@name@.css +116 -0
  23. data/generators/gallery_sample/templates/src/nibs/@name@/@name@.html +6 -0
  24. data/generators/gallery_sample/templates/src/nibs/@name@/@name@.jsnib.erb +40 -0
  25. data/generators/gallery_sample/templates/src/nibs/@name@/@name@.json +25 -0
  26. data/generators/gallery_sample/templates/src/nibs/@name@/images/next.gif +0 -0
  27. data/generators/gallery_sample/templates/src/nibs/@name@/images/prev.gif +0 -0
  28. data/generators/gallery_sample/templates/src/nibs/@name@/photos/molly-1.jpg +0 -0
  29. data/generators/gallery_sample/templates/src/nibs/@name@/photos/molly-2.jpg +0 -0
  30. data/generators/gallery_sample/templates/src/nibs/@name@/photos/molly-3.jpg +0 -0
  31. data/generators/gallery_sample/templates/src/nibs/@name@/photos/molly-4.jpg +0 -0
  32. data/generators/gallery_sample/templates/src/nibs/@name@/photos/molly-5.jpg +0 -0
  33. data/generators/nib/USAGE +5 -0
  34. data/generators/nib/nib_generator.rb +50 -0
  35. data/generators/nib/templates/@name@.css.erb +1 -0
  36. data/generators/nib/templates/@name@.html.erb +4 -0
  37. data/generators/nib/templates/@name@.jsnib.erb +19 -0
  38. data/lib/coherent.rb +42 -0
  39. data/vendor/Makefile +4 -0
  40. data/vendor/checkout_coherent.sh +6 -0
  41. data/vendor/extconf.rb +3 -0
  42. metadata +105 -0
data/LICENSE ADDED
@@ -0,0 +1,203 @@
1
+ Copyright (c) 2009 Jeff Watkins
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright [yyyy] [name of copyright owner]
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ == Copyright
2
+
3
+ Copyright (c) 2009 Jeff Watkins. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,61 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "coherent"
8
+ gem.summary = "Tools for building Coherent application or modules."
9
+ gem.description = gem.summary
10
+ gem.email = "jeff@metrocat.org"
11
+ gem.homepage = "http://coherentjs.org"
12
+ gem.authors = ["Jeff Watkins"]
13
+ gem.files= Dir['lib/**/*', 'app_generators/**/*', 'generators/**/*', 'bin/*', '[A-Za-z]*', 'vendor/**/*']
14
+ gem.files.reject! { |f| File.directory?(f) }
15
+ gem.add_dependency('distil', '>= 0.7.0')
16
+ gem.extensions= ['vendor/extconf.rb']
17
+
18
+ # gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
19
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
20
+ end
21
+ Jeweler::GemcutterTasks.new
22
+
23
+ task :push => "gemcutter:release"
24
+
25
+ rescue LoadError
26
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
27
+ end
28
+
29
+ require 'rake/testtask'
30
+ Rake::TestTask.new(:test) do |test|
31
+ test.libs << 'lib' << 'test'
32
+ test.pattern = 'test/**/test_*.rb'
33
+ test.verbose = true
34
+ end
35
+
36
+ begin
37
+ require 'rcov/rcovtask'
38
+ Rcov::RcovTask.new do |test|
39
+ test.libs << 'test'
40
+ test.pattern = 'test/**/test_*.rb'
41
+ test.verbose = true
42
+ end
43
+ rescue LoadError
44
+ task :rcov do
45
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
46
+ end
47
+ end
48
+
49
+ task :test => :check_dependencies
50
+
51
+ task :default => :test
52
+
53
+ require 'rake/rdoctask'
54
+ Rake::RDocTask.new do |rdoc|
55
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
56
+
57
+ rdoc.rdoc_dir = 'rdoc'
58
+ rdoc.title = "coherent #{version}"
59
+ rdoc.rdoc_files.include('README*')
60
+ rdoc.rdoc_files.include('lib/**/*.rb')
61
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,5 @@
1
+ Description:
2
+
3
+
4
+ Usage:
5
+
@@ -0,0 +1,95 @@
1
+ require "#{File.dirname(__FILE__)}/../../lib/coherent"
2
+
3
+ class CoherentGenerator < CoherentBaseGenerator
4
+
5
+ DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
6
+ Config::CONFIG['ruby_install_name'])
7
+
8
+ COHERENT_SOURCE = File.expand_path(File.join(File.dirname(__FILE__), "../../vendor/coherent"))
9
+
10
+ default_options :author => nil,
11
+ :coherent_project => COHERENT_SOURCE,
12
+ :copy_coherent => true,
13
+ :nib_name => 'main'
14
+
15
+
16
+ attr_reader :name, :coherent_project, :copy_coherent, :nib_name
17
+
18
+ def initialize(runtime_args, runtime_options = {})
19
+ super
20
+ usage if args.empty?
21
+ @destination_root = File.expand_path(args.shift)
22
+ @name = base_name
23
+ extract_options
24
+ end
25
+
26
+ def manifest
27
+ record do |m|
28
+ # Ensure appropriate folder(s) exists
29
+ m.directory ''
30
+ BASEDIRS.each { |path| m.directory path }
31
+
32
+ copy_template_folder m
33
+ m.dependency "nib", [nib_name], :destination=>destination_root
34
+
35
+ if (copy_coherent)
36
+ m.dependency "coherent_library", [], :source=>COHERENT_SOURCE,
37
+ :destination=>destination_path(coherent_project)
38
+ end
39
+ end
40
+ end
41
+
42
+ protected
43
+ def banner
44
+ <<-EOS
45
+ Creates a ...
46
+
47
+ USAGE: #{spec.name} name
48
+ EOS
49
+ end
50
+
51
+ def add_options!(opts)
52
+ opts.separator ''
53
+ opts.separator 'Options:'
54
+ # For each option below, place the default
55
+ # at the top of the file next to "default_options"
56
+ # opts.on("-a", "--author=\"Your Name\"", String,
57
+ # "Some comment about this option",
58
+ # "Default: none") { |o| options[:author] = o }
59
+ opts.on("-lib", "--lib=\"Location of Coherent Project\"", String,
60
+ "This is where the Coherent project folder lives",
61
+ "Default: source from the tools gem") { |o|
62
+ options[:coherent_project] = o
63
+ }
64
+ opts.on("-nib", "--nib=\"Name of the Primary NIB\"", String,
65
+ "The name used for the primary NIB for the app.",
66
+ "Default: main") { |o|
67
+ options[:nib_name] = o
68
+ }
69
+ opts.on("-copy", "--[no-]copy", "Copy the coherent library") { |o|
70
+ options[:copy_coherent]= o
71
+ }
72
+ opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
73
+ end
74
+
75
+ def extract_options
76
+ # for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
77
+ # Templates can access these value via the attr_reader-generated methods, but not the
78
+ # raw instance variable value.
79
+ # @author = options[:author]
80
+ @copy_coherent= options[:copy_coherent]
81
+ @nib_name= options[:nib_name]
82
+ if (@copy_coherent)
83
+ @coherent_project= "ext/coherent"
84
+ else
85
+ @coherent_project= options[:coherent_project]
86
+ end
87
+ end
88
+
89
+ # Installation skeleton. Intermediate directories are automatically
90
+ # created so don't sweat their absence here.
91
+ BASEDIRS = %w(
92
+ src
93
+ test
94
+ )
95
+ end
@@ -0,0 +1,40 @@
1
+ name: <%=name%>
2
+ version: 1.0.0
3
+ notice: src/NOTICE
4
+ output folder: build/res/latest
5
+ remove prefix: src
6
+ external projects: <%=coherent_project%>
7
+
8
+ # This is the main target for your application. This target will yield optimised
9
+ # CSS and Javascript files for all of your assets. In addition, it will emit
10
+ # uncompressed and debug versions which are useful during development.
11
+ all:
12
+ js:
13
+ # Your main Javascript assets, specified in order they should be loaded.
14
+ # The final entry loads all Javascript assets in the src/js folder and
15
+ # uses the import statements to compute the dependency order.
16
+ - coherent-uncompressed.js
17
+ - src/js/<%=name%>.js
18
+ - src/js
19
+
20
+ css:
21
+ # Your CSS files. You may include all CSS files in the src/css folder,
22
+ # but they may be included in the wrong order. So it's usually best to
23
+ # specify them explicitly
24
+ - src/css/reset.css
25
+ - src/css/<%=name%>.js
26
+
27
+ jsnib:
28
+ # Create a JSNIB package file for each folder in the src/nibs folder.
29
+ # A JSNIB package is a self contained group of Javascript, CSS and HTML
30
+ # that is used to provide loadable UI modules.
31
+ remove prefix: src/nibs
32
+ include: src/nibs
33
+
34
+ pages:
35
+ # Copy any HTML assets from the src/pages folder over to the build folder.
36
+ # If you're using a server framework, you should consider simply deleting
37
+ # this target.
38
+ output folder: build
39
+ remove prefix: src/pages
40
+ copy: src/pages
@@ -0,0 +1,2 @@
1
+ Copyright <%=Date.today.year%> You.
2
+ All rights reserved.
@@ -0,0 +1,120 @@
1
+ /* This is the primary CSS file for the <%=name.titlecase%> application. */
2
+
3
+ /* Styles for UI elements that have been selected.
4
+ */
5
+ .selected
6
+ {
7
+ }
8
+
9
+ /* Styles applied to views that are disabled. Not all browsers support the
10
+ disabled pseudo selector, so Coherent applies the disabled class instead.
11
+ */
12
+ .disabled
13
+ {
14
+ }
15
+
16
+ /* Views that are read-only will have these styles.
17
+ */
18
+ .read-only
19
+ {
20
+ }
21
+
22
+ /* When a view is displaying the placeholder value for a null value, the view
23
+ will have this class name.
24
+ */
25
+ .nullValue
26
+ {
27
+ }
28
+
29
+ /* Since not all browsers support the focus pseudo selector, Coherent applies
30
+ the focused class to all views that accept first responder status.
31
+ */
32
+ .focused
33
+ {
34
+ }
35
+
36
+ .hover
37
+ {
38
+ }
39
+
40
+ .asc
41
+ {
42
+ }
43
+
44
+ .desc
45
+ {
46
+ }
47
+
48
+ .active
49
+ {
50
+ }
51
+
52
+ .updating
53
+ {
54
+ }
55
+
56
+ .invisible
57
+ {
58
+ }
59
+
60
+ .invalid
61
+ {
62
+ }
63
+
64
+ .inserted
65
+ {
66
+ }
67
+
68
+ .deleted
69
+ {
70
+ }
71
+
72
+ .replacing
73
+ {
74
+ }
75
+
76
+ .loading
77
+ {
78
+ }
79
+
80
+ .first
81
+ {
82
+ }
83
+
84
+ .last
85
+ {
86
+ }
87
+
88
+ .drag-and-drop-copy
89
+ {
90
+ }
91
+
92
+ .drag-and-drop-move
93
+ {
94
+ }
95
+
96
+ .drag-and-drop-link
97
+ {
98
+ }
99
+
100
+ .drag-and-drop-no
101
+ {
102
+ }
103
+
104
+ .coherent_windowInactive
105
+ {
106
+ }
107
+
108
+ .outline-expanded
109
+ {
110
+ }
111
+
112
+ .outline-leaf
113
+ {
114
+ }
115
+
116
+ .outline-disclosure-button
117
+ {
118
+ }
119
+
120
+
@@ -0,0 +1,70 @@
1
+ /* http://meyerweb.com/eric/tools/css/reset/ */
2
+ /* v1.0 | 20080212 */
3
+
4
+ html, body, div, span, applet, object, iframe,
5
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
6
+ a, abbr, acronym, address, big, cite, code,
7
+ del, dfn, em, font, img, ins, kbd, q, s, samp,
8
+ small, strike, strong, sub, sup, tt, var,
9
+ b, u, i, center,
10
+ dl, dt, dd, ol, ul, li,
11
+ fieldset, form, label, legend,
12
+ table, caption, tbody, tfoot, thead, tr, th, td {
13
+ margin: 0;
14
+ padding: 0;
15
+ border: 0;
16
+ outline: 0;
17
+ font-size: 100%;
18
+ vertical-align: baseline;
19
+ background: transparent;
20
+ font-weight: normal;
21
+ font-style: normal;
22
+ }
23
+ em, i
24
+ {
25
+ font-style: normal;
26
+ }
27
+ b, strong
28
+ {
29
+ font-weight: normal;
30
+ }
31
+
32
+ a:focus, a:active, button:focus, button:active
33
+ {
34
+ outline: 0;
35
+ }
36
+ button::-moz-focus-inner { border: 0; }
37
+
38
+ body {
39
+ line-height: 1;
40
+ }
41
+ ol, ul {
42
+ list-style: none;
43
+ }
44
+ blockquote, q {
45
+ quotes: none;
46
+ }
47
+ blockquote:before, blockquote:after,
48
+ q:before, q:after {
49
+ content: '';
50
+ content: none;
51
+ }
52
+
53
+ /* remember to define focus styles! */
54
+ /*:focus {
55
+ outline: 0;
56
+ }
57
+ */
58
+ /* remember to highlight inserts somehow! */
59
+ ins {
60
+ text-decoration: none;
61
+ }
62
+ del {
63
+ text-decoration: line-through;
64
+ }
65
+
66
+ /* tables still need 'cellspacing="0"' in the markup */
67
+ table {
68
+ border-collapse: collapse;
69
+ border-spacing: 0;
70
+ }
@@ -0,0 +1,5 @@
1
+ /*jsl:import coherent-uncompressed.js*/
2
+
3
+ /**
4
+ Core JS file file for the <%=name.titlecase%> application.
5
+ */
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="X-UA-Compatible" content="IE=8">
5
+ <title><%=name.titlecase%></title>
6
+
7
+ <link rel="stylesheet" href="res/latest/<%=name%>-debug.css" type="text/css" charset="utf-8">
8
+
9
+ <script src="res/latest/<%=name%>-debug.js" type="text/javascript" charset="utf-8"></script>
10
+ </head>
11
+ <body>
12
+ <script>
13
+ var viewController= new coherent.ViewController({
14
+ nibUrl: "res/latest/<%=nib_name%>.jsnib"
15
+ });
16
+ var d= viewController.loadView();
17
+
18
+ function viewLoaded(whatever)
19
+ {
20
+ document.body.appendChild(viewController.view().node);
21
+ }
22
+ d.addCallback(viewLoaded);
23
+ </script>
24
+ </body>
25
+ </html>
data/bin/coherent ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'rubigen'
5
+
6
+ require 'rubigen/scripts/generate'
7
+
8
+ def find_app_root
9
+ path= Dir.pwd
10
+ while '/'!=path
11
+ return path if File.exists?(File.join(path, "distil.yml"))
12
+ path = File.expand_path(File.join(path, ".."))
13
+ end
14
+ end
15
+
16
+ if ('app'==ARGV[0])
17
+ # pull off app "command"
18
+ ARGV.shift
19
+
20
+ source = RubiGen::PathSource.new(:application,
21
+ File.join(File.dirname(__FILE__), "../app_generators"))
22
+ RubiGen::Base.reset_sources
23
+ RubiGen::Base.append_sources source
24
+
25
+ RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'coherent')
26
+ else
27
+ APP_ROOT= find_app_root || Dir.pwd
28
+
29
+ RubiGen::Base.use_component_sources! [:coherent, :test_unit]
30
+ RubiGen::Scripts::Generate.new.run(ARGV)
31
+ end