上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页
摘要: 链接地址: http://www.cnblogs.com/nbkhic/archive/2011/10/22/2221336.html ========================================== 阅读全文
posted @ 2013-05-19 09:50 卜海清 阅读(731) 评论(0) 推荐(0)
摘要: extend = (obj, mixin) -> obj[name] = method for name, method of mixin obj include = (klass, mixin) -> extend klass.prototype, mixin CoffeeScript里kclas 阅读全文
posted @ 2013-05-16 15:54 卜海清 阅读(301) 评论(0) 推荐(0)
摘要: 除了之前提到的commander 库,还有一个optimist库可以实现命令行解析。argv = require('optimist') .usage('Usage: $0 -x [num] -y [num]') .demand('x').options('x', alias: 'X' describe:"argument x") .demand('y').options('y', alias: 'Y' describe: 'argumen 阅读全文
posted @ 2013-05-16 13:38 卜海清 阅读(2721) 评论(0) 推荐(0)
摘要: Ruby里如果要Mixin的一个Module很简单class Test include Module1end但之前没有思考过能不能Mixin一个Class的功能? 答案是:可以,使用DelegateClassrequire 'delegate'class Assistant def initialize(name) @name = name end def read_email "(#{@name}) It is mostly spam." endendclass Manager < DelegateClass(Assistant) def initi 阅读全文
posted @ 2013-05-08 14:32 卜海清 阅读(323) 评论(0) 推荐(0)
摘要: Ruby里ARGF可以将多个文件的内容合并成一个Stringputs ARGF.read // test.rb运行ruby test.rb a.txt b.txt后, a.txt和b.txt之中会被合并。更详细的讲解可以看考: http://ruby.about.com/od/tasks/ss/Argf-A-Shortcut-For-Scripts.htm 阅读全文
posted @ 2013-05-08 13:15 卜海清 阅读(732) 评论(0) 推荐(0)
摘要: 最近又在做RESTful的应用开发,自动化测试使用的Ruby写脚本。运用BDD/TDD的开发思路,希望能先从使用Mock表达行为开始这里使用如Ruby的webmock框架 (gem install webmock)来尝试require "test/unit"require "shoulda"require "webmock"include WebMock::APIinclude Test::Unit::Assertionsclass RESTfulTest < Test::Unit::TestCase context " 阅读全文
posted @ 2013-05-07 10:05 卜海清 阅读(927) 评论(0) 推荐(0)
摘要: http://www.troubleshooters.com/codecorn/ruby/symbols.htmRuby 里的Symbol概念的讲解,What are symbols?It's a string. No it's an object. No it's a name.puts :Steve.class # output : Symbol ClassSymbol can not change at runtimeWhat can symbols do for you?A symbol is a way to pass string information, 阅读全文
posted @ 2013-05-04 17:27 卜海清 阅读(206) 评论(0) 推荐(0)
摘要: 什么是Metadata Programming? 在网上看到一段挺精辟的总结主要是从三个维度来表达Metadata infoStore Application Configurations in MetadataConfiguration settings are critical to software applications and are very likely to change frequently. Storing configuration settings or any item that resembles configuration data within metadat 阅读全文
posted @ 2013-04-27 15:27 卜海清 阅读(214) 评论(0) 推荐(0)
摘要: 一直有在项目中使用Maven来编译,测试,发布Java代码。 最近一直有在学习Groovy。也有考虑使用Gradle来重写build 脚本,但后来发现了GMaven, 是一个不想大动干戈的情况下不错的选择。我已经说服Team的成员使用GMaven了,相应地我也已经把测试测框架做了小小的微调。Step by Step(修改pom.xml):1. 引入Groovy库<dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> 阅读全文
posted @ 2013-04-21 20:47 卜海清 阅读(11795) 评论(0) 推荐(1)
摘要: Maven用来管理Java类库之间的依赖已经非常普遍了。最近有一直在做JavaScript的开发,就突然想提问自己是不是也可以考虑用Maven的机制来管理JavaScript的依赖。Google了一下,发现了一篇文件覆盖了我的想法。http://ajaxian.com/archives/using-maven-to-modularize-javascript-development 有兴趣的朋友可以试一试。有问题我们交流一下。P.S.:当然如果你的开发是基于NodeJs的,完全没有必要这样(在NodeJs里只要配置package.json)就可以了。 阅读全文
posted @ 2013-04-21 20:40 卜海清 阅读(4538) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页