Ruby设计哲学
来源:互联网 发布:java切面编程 编辑:程序博客网 时间:2024/05/21 11:36
Ruby设计哲学
- Follow web standards and HTTP 遵循Web标准和HTTP
- CoC (Convention over Configuration) 约定大于配置
- MVC (Model-View-Controller)
- DRY 不要重复造轮子(如:gems )
- Software Engineering Patterns
- Assets 静态资源
- Restful API
- Testing 测试
- Deployment 部署
- Automation 自动化(数据修改,移植)
Agile Development 敏捷开发
- Philosophy
- DRY
- Ecosystem: Gems / Community
从本地开发到线上
- Development Environments: Development / Test / Production / Staging(自定义模拟线上环境)
- Test
- Configurations 配置
- Deployment 部署
Pages & Assets
- Dynamic pages: Routes / Restful / Inheritance(继承)
- Assets: Asset Pipeline / Minify / Combine / Webpack / babel etc.
Dynamic Pages
- Routes 路由
- HTTP GET/POST/PUT/DELETE
- Custom routes
- Easy to refactor
- Filter 过滤器
- before_filter
- around_filter
- after_filter
- Cache 缓存
- Page Cache
- Fragment Cache
- Response
- HTML
- JSON
- XML
- etc.
ActiveRecord
- Powerful ORM
User.find(2) User.find_by(email: 'service@abc.com') User.where(membership: 'gold').page(2) .per_page(10).order("id desc").limit(10) user.blogs
- Triggers 回调
- before_save
- after_save
- after_destroy
- after_create
- etc.
Assets
- Javascript/CSS minify and combine
- Assets URL
- ETag
- SASS
- CoffeeScript
从开发到测试
- Unit Test: rspec / minitest
- Smoke Test / Continuous Integration: cucumber / selenium
脚本和自动化
- rails c
- rails g
- rails s
- etc.
- rake task
- rake routes
- rake db:create
- rake db:migrate
- etc.
自定义rake任务
Libraries
- gem
- bundle
- rails是很多gems的组合
- 创建自己的gem
0 0
- Ruby设计哲学
- Ruby的哲学
- Unix设计哲学
- 设计的哲学
- unix设计哲学
- unix设计哲学
- android 设计哲学
- ActivityTask的设计哲学
- go语言设计哲学
- appium的设计哲学
- Fragment的设计哲学
- Docker 网络设计哲学
- go语言 - 设计哲学
- UNIX设计哲学概要
- Unix设计的哲学
- python与ruby的不同哲学观
- iPhone 可有设计哲学?
- 理想的身份证设计哲学
- Pycharm+Spark开发配置
- linux下mysql的远程连接
- Java泛型限制
- Linux中QT编译遇到cannot find -lGL问题的解决方案
- poj1190 生日蛋糕 dfs
- Ruby设计哲学
- 刚创建了ubuntu虚拟机便忘记密码了
- Partical System
- ORACLE游标概念讲解
- Crontab: command not found
- MD5算法原理
- 昨天的问题解决
- socket 内聊工具另一个版本
- html+jsp(表单示例)