-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO.txt
257 lines (227 loc) · 8.76 KB
/
TODO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
SOON
====
* Add a RuboCop config file.
* Add SimpleForm.
* Add basic Procfile (with some things commented out) and Foreman.
* Disable Turbolinks. (See http://blog.steveklabnik.com/posts/2013-06-25-removing-turbolinks-from-rails-4)
* Add JS classes to HTML tag.
* Include 'no-js' class in the markup.
* Have JavaScript remove the 'no-js' class and add a 'js' class.
* Modernizr (and hence HTML5 Boilerplate) does this already.
* Modernizr also adds a ton of other classes, 1 for each feature it detects.
* Also consider having JavaScript add ie7 and ie8 tags if CSS requires them.
* Better to use Modernizr to detect features instead of browsers though.
* Use Bower (or something similar) to manage JS (and CSS) assets.
* Consider rails-assets.org method.
* Tricks Bundler into pulling from NPM.
* Include these components (if not already included):
* normalize-css
* See these links for more info:
* http://www.iconoclastlabs.com/blog/bower-and-rails-4
* https://coderwall.com/p/hhaxlg
* http://kaeff.net/posts/sprockets-bower-better-component-packaging-for-rails-asset-pipeline.html
* https://github.com/42dev/bower-rails
* http://stackoverflow.com/questions/16266528/how-to-manage-javascript-dependencies-with-bower-in-rails-apps
* https://shellycloud.com/blog/2013/09/how-to-manage-front-end-packages-in-rails-with-bower
* Updates to HTML template. (Look to see what HTML5 Boilerplate looks like these days.)
* Add viewport meta tag.
* <meta name="viewport" content="width=device-width, initial-scale=1">
* Add apple-touch-icon.
* Use better_errors, if they come out with a Rails 4.2 version.
* Rails 4.2 includes Web Console, which does what the REPL part of better_errors does.
* Use Sequel ORM.
* Consider using Puma instead of Unicorn.
* Ask which DB to use.
* For PROD and non-PROD.
Later
=====
* Split into separate files within recipes directory.
* Use Thor's apply() action.
* Use Sneakers (and RabbitMQ) instead of Sidekiq (and Redis).
* Use Perpetuity / Virtus::Perpetuity when it's ready.
* Use Virtus::ActiveRecord when it's ready.
* Use ROM when it's ready.
BUGS
====
Getting an error when we call 'generate controller':
/Users/booch/Work/Projects/rails-template/name_of_your_new_rails_app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require':
cannot load such file -- rails_generator/generators/components/controller/controller_generator (LoadError)
Ideas
=====
Add show_for >= 0.2.0.
Add hobofields >= 1.0.0.
Will want to use --skip-migration when using model or scaffold generators.
Make models look like this:
class BlogPost < ActiveRecord::Base
fields do
title :string # Other types: password, email_address, html, textile, markdown, boolean, date, datetime, float, integer, big_integer, decimal
body :text, :default => ''
name :string, :unique, :required
price :decimal, :scale => 4, :precision => 4
quantity :integer, :limit => 4
timestamps
end
end
Run ./script/genearte hobo_migration.
NOTE: It may ask you to verify if something was renamed.
Check/edit the migration.
Run rake db:migrate.
Add some CSS.
Make formtastic stuff look presentable.
form.formtastic fieldset ol li {display: block}
li.string input is set to width:74%, but li.password input is not.
remove (most padding-left from fieldset.buttons)
Use Warden and Devise for authentication.
Add include Devise::TestHelpers to Controller and View specs (but not integration specs).
Work on CrudViews:
Create simple show_for, index_for.
Improve initial deployment.
Have cap deploy:setup prompt for database name/user/password, and build the shared database.yml instead of just leaving a blank one.
Flesh out generators; use Shoulda and RSpec 'it' syntax.
Name the generator "crud_resource", have it do model, controller, route.
Also "crud_controller" (no model), "crud_model", "crud_route".
Test/refactor my custom RSpec stuff.
Delete the default routes in config/routes.rb file.
Semi-manual testing. (Make this a rake task, to augment the default test.)
rm -rf test/rails_site
rails -m ./rails-template.rb test/rails_site
# Answer prompts.
cd test/rails_site
./script/server -p 9070 &
open http://127.0.0.1:9070
# Test the site functionality.
kill %
./script/generate rspec_model thing name:string age:integer admin:boolean
rake db:migrate
./script/generate rspec_controller things
# Add to config/routes.rb: map.resources 'things', :member => { :delete => :get }
# Edit app/controllers/things_controller.rb, to add crud_actions.
mkdir app/views/default
echo > app/views/default/index.html.erb '<pre><%= crud.items.to_yaml %></pre>'
echo > app/views/default/new.html.erb '<% semantic_form_for crud.item do |form| %><%= form.inputs + form.buttons %><% end %>'
echo > app/views/default/show.html.erb '<pre><%= crud.item.to_yaml %></pre>'
./script/server -p 9070 &
open http://localhost:9070/things
open http://localhost:9070/things/new
# Test the site functionality.
kill %
Pull in BaseHTML stuff.
HTML fragments
Tables
Forms
CSS fragment
Tables
Forms
Pagination
Upgrade to hoptoad_notifier gem.
generate hoptoad --api-key your_key_here
HoptoadNotifier.configure do |config|
config.api_key 'your_key_here'
end
jQuery functionality
Polyfills.
Auto-focus.
Placeholder.
Autogrow all TEXTAREAs.
Git clone the github repo (http://github.com/akaihola/jquery-autogrow).
Note that the code has not been updated in well over a year.
Despite bug reports and patches at http://plugins.jquery.com/project/issues/autogrow?categories=support&states=all.
Include the following in application.js:
if ( jQuery.fn['autogrow'] ) jQuery('textarea').autogrow();
Extract my BoochTek jQuery extensions into a separate repository.
Pagination.
Including CSS.
Validation.
How do we tell the view to add required and data-type attributes to INPUT elements?
Column sorting.
Look into jqGrid or dataTables.
Add more plugins:
Automated validations, pulled from DB (DrySQL, Magic???, validation_reflection (valirefl), ???)
Annotate-models, ColumnComments, or my own annotation/labeling system. (Only if AR is enabled.)
Auto-migrations? Hobo_Fields does this for us.
Machinist (fork that handles DM) instead of FactoryGirl (which already handles DataMapper, as long as you require dm-validations)?
Exceptional (in addition to Airbrake and ExceptionNotifier).
http://github.com/engineyard/rails_metrics - metrics pulled from ActiveSupport notifications.
Add custom generator for Blue Ridge javascript_specs.
What's wrong with the ones that come with Blue Ridge?
I probably wanted to include more default functionality -- just not sure what I could add that would be pertinent for all tests.
Might want to add jQuery.
More rake tasks.
git:pre_commit
spec:javascripts - blue-ridge says it adds it, but only adds test:javascripts
jquery:download
jquery:update
css:compress (asset:packager:build_all should cover this)
javascript:compress (asset:packager:build_all should cover this)
Grab some more ideas from BigOldRailsTemplate.
Consider adding RailRoad (http://railroad.rubyforge.org/) to generate model diagrams.
Requires GraphViz.
Perhaps just create a doc:diagram:model rake task that looks for it.
From DataMapper/extlib
======================
# Methods I like, pulled from http://github.com/datamapper/extlib/.
# TODO/FIXME: Need to guard against redefining these.
# NOTE: If we define in?, we can get rid of the RSpec be_in matcher.
class Object
def meta_class() class << self; self end end
def in?(arrayish,*more)
arrayish = more.unshift(arrayish) unless more.empty?
arrayish.include?(self)
end
def blank?
nil? || (respond_to?(:empty?) && empty?)
end
end
module ObjectSpace
class << self
def classes
klasses = []
ObjectSpace.each_object(Class) {|o| klasses << o}
klasses
end
end
end
class NilClass
def blank?
true
end
end
class TrueClass
def blank?
false
end
end
class FalseClass
def blank?
true
end
end
class Numeric
def blank?
false
end
end
class Pathname
def /(path)
(self + path).expand_path
end
end
class String
def blank?
strip.empty?
end
def /(o)
File.join(self, o.to_s)
end
end
require 'date'
class DateTime
def to_time
Time.parse self.to_s
end
end
class Time
def to_datetime
DateTime.new(year, month, day, hour, min, sec, Rational(gmt_offset, 24 * 3600))
end
end