小编Bre*_*din的帖子

来自日历的Google环聊链接

我已将iCal和Google日历同步,以便查看我的约会.但是,除非我转到Google日历,否则我无法看到Google环聊链接.

是否有任何原生OSX应用支持Google Hangout链接的字段?

macos google-plus hangout

16
推荐指数
2
解决办法
6054
查看次数

在一定数量的字符后自动中断注释

是否可以突出显示一个大的注释块并在一定长度后自动插入中断?

简单的例子

# This is a super long message that has too much information in it. Although inline comments are cool, this sentence should not be this long.
Run Code Online (Sandbox Code Playgroud)

# This is a super long message that has too much information in it.
# Although inline comments are  cool, this sentence should not be this
# long.
Run Code Online (Sandbox Code Playgroud)

sublimetext2

15
推荐指数
1
解决办法
5106
查看次数

使用Cookies与Rack :: Test

我正在尝试使用Rack :: Test为我的Sinatra应用程序编写RSpec测试.我无法理解如何使用cookies.例如,如果我的应用程序设置了cookie(不是通过:session),我该如何检查该cookie是否正确设置?

另外,如何使用该cookie发送请求?

ruby cookies rack rspec sinatra

13
推荐指数
1
解决办法
6366
查看次数

重构.用大方法降低大类代码复杂性的方法

我有一个维护相当复杂的遗留类:

class OldClass {
  method1(arg1, arg2) {
      ... 200 lines of code ... 
  }

  method2(arg1) {
      ... 200 lines of code ... 
  }

  ...

  method20(arg1, arg2, arg3) {
      ... 200 lines of code ... 
  }    
}
Run Code Online (Sandbox Code Playgroud)

这些方法非常庞大,非结构化和重复性(开发人员喜欢复制/粘贴aprroach).我想将每个方法分成3-5个小函数,使用一个pulic方法和几个帮助器.

你会建议什么?我想到了几个想法:

  • 为每个方法添加几个私有帮助器方法,并将它们连接到#region(直接重构)

  • 使用命令模式(每个OldClass方法在一个单独的文件中使用一个命令类).

  • 使用一个公共方法和几个私有帮助器方法为每个方法创建辅助静态类.OldClass方法将实现委托给适当的静态类(非常类似于命令).

先感谢您!

c# refactoring

8
推荐指数
1
解决办法
1664
查看次数

将ruby项目从1.8.6升级到1.8.7

我应该采取哪些步骤将Ruby项目从1.8.6升级到1.8.7?

ruby

4
推荐指数
1
解决办法
662
查看次数

使用RSpec测试HTTPS(SSL)请求的简单方法

我希望Rspec使用https请求root.这就是我目前拥有的:

it "requesting root (/) with HTTPS should return 200" do
  get "https://test.host/"
  last_response.should be_ok
end
Run Code Online (Sandbox Code Playgroud)

尝试在RSpec Rails测试HTTPS(SSL)请求中提出的解决方案会返回以下错误:

wrong number of arguments (0 for 1)
Run Code Online (Sandbox Code Playgroud)

我想我可以这样做:

get "/", :https => "on"
Run Code Online (Sandbox Code Playgroud)

有没有办法在不指定主机的情况下请求root用户?

ruby rspec sinatra

2
推荐指数
1
解决办法
2010
查看次数

标签 统计

ruby ×3

rspec ×2

sinatra ×2

c# ×1

cookies ×1

google-plus ×1

hangout ×1

macos ×1

rack ×1

refactoring ×1

sublimetext2 ×1