Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Eric-Guo
@ericguo
VIP
NO. 1665 / 2012-03-31

[email protected]
天华建筑设计
上海
46 Topics / 1382 Replies
181 Followers
245 Following
75 Favorites
选Ruby是符合我爱钱爱金爱宝石气质的…
GitHub Public Repos
  • wechat 1331

    API, command and message handling for WeChat in Rails

  • wechat-starter 351

    WeChat web app with wx_pay in rails

  • tailwindcss-jit-stimulus 19

    A template with Rails 7.1, Shakapacker 7.2, TailwindCSS 3 and Stimulus 3.0

  • pgac_demo 13

    Rails 7.2 Action Cable chat room using AnyCable as backend

  • coreui4-rails-starter 12

    The CoreUI 4 Rails starter

  • product_hunt 5

    Demonstrate new Rails 5.1 feature: Assets on Yarn, System tests with Capybara and unified form_wi...

  • openproject 2

    OpenProject is the leading open source project management software.

  • dify-ruby-sdk 2

  • homeland 1

    :circus_tent: An open source forum/community system based on Rails, developed based on Ruby China.

  • ruby 1

    The Ruby Programming Language [mirror]

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Rails 如何调用.NET 的 WCF 接口 at October 13, 2015

    #8 楼 @psvr grape好像有人说过单单 host 比和 rails 还慢,还有目前 intridea 又不维护,看来看去还是 AMS 靠谱点,不知道你怎么看。 #14 楼 @mumu 你也问得太 general 了吧,这样的问题感觉就是伸手党,ruby 社区不欢迎这样的提问方式。

  • Rails 如何调用.NET 的 WCF 接口 at October 13, 2015

    #12 楼 @mumu jbuilder是 gem,Borland JBuilder 都不知道死了多少年了。。

  • Rails 如何创建 WebService 接口,提供给 .NET 程序调用 at October 13, 2015

    另外现在语言和平台之间的互操作协议,json 相比 SOAP 早就一统江湖啦,唯一的争议是到底 json 格式语义如何定义,GraphQL/jsonapi,其实就是选 react 还是 ember.js,但无论如何前后端分离肯定是趋势,如果喜欢 Rails 的话 Rails 5 API 里面推荐的官方 gem 是AWS,其实换句话说,Rails 官方也给你选了,就是 jsonapi+ember.js 的方案。

    所以我现在 focus 这两个技术,一个就是 ember.js,另外就是 rails 5。其他 wdsl, Thrift, Protobuf 特定场合特定技术吧,未来 Rails 主流应该还是 jsonapi。

  • Rails 如何创建 WebService 接口,提供给 .NET 程序调用 at October 13, 2015

    #9 楼 @jimrokliu 同意,如果是 rails 的话,应该提供 json 格式的 restful 风格的 API 给其他平台调用,提供 web service 简直是扬短避长,.NET 这边调用 json 的话,虽然麻烦点,但也能接受,比如这样:

    using (WebClient client = new WebClient())
    {
        string url = string.Format("http://10.71.5.88/forms/real_time_broadcasts/{0}/confirm_speaked.json", say.confirm_speaked_id);
    
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
    
        request.Method = "POST";
        request.Timeout = 5000;
        request.ReadWriteTimeout = 10000;
    
        request.Accept = "application/json";
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        StreamReader reader = new StreamReader(response.GetResponseStream());
        string htmldoc = reader.ReadToEnd();
        response.Close();
    }
    
  • Rails 如何调用.NET 的 WCF 接口 at October 12, 2015

    #6 楼 @mumu 最官方的是用 jbuilder,返回 json 对象给.NET/Java 使用。

    using Newtonsoft.Json;
    
    string strlot = jsonLotInfo("M1516M8177");
    var lot = JsonConvert.DeserializeObject<dynamic>(strlot);
    Console.WriteLine(string.Format("Product: {0}", lot.product.product_name));
    Console.WriteLine(string.Format("POD: {0}", lot.product.package_of_drawing.name));
    foreach (var wfs in lot.workflow.workflowsteps)
    {
        Console.WriteLine(string.Format("  Step: {0}", wfs.workflowstepname));
    }
    
    private static string jsonLotInfo(string lot_no)
    {
        String ret = String.Empty;
    
        HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(new Uri(string.Format("http://mesview.sandisk.com/lots/{0}.json", lot_no)));
        webReq.ContentType = "application/json; charset=UTF-8";
        webReq.Accept = "application/json";
        webReq.Timeout = 30000;
        HttpWebResponse response = (HttpWebResponse)webReq.GetResponse();
        StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.Default);
        ret = sr.ReadToEnd();
        sr.Close();
        response.Close();
    
        return ret;
    }
    
  • 為什麼要 Bundle Update? at October 12, 2015

    #5 楼 @billy 这太夸张了,我和你完全相反,每天都做 bundle update,因为应用始终跑在最新版。。

  • Rails 如何调用.NET 的 WCF 接口 at October 08, 2015

    用 savon,别用内置的 soap/wsdlDriver,这个在 Ruby 新版本已经去除了

  • 使用 RubyGems 安装 DBI 问题 at October 06, 2015

    现在一般都用 mysql2 了。

  • Spree 扩展机制分析 at October 05, 2015

    virtual_path 概念能具体说一下么,这个和i18n里面的有关联么?

  • 有用 Spree Commerce 的吗?真心慢啊 at October 05, 2015

    #5 楼 @tini8 #6 楼 @beiersi 生产模式可以跑下面命令预编译 deface 替换的模板,这个才是提速的关键。

    rake deface:precompile
    
  • - at October 04, 2015

    可以参考这个帖

  • 。。。这算黑吗??? at October 02, 2015

    varchar255 性能和 varchar10 性能几乎是一样的,和线上系统因为用户名字大于预期,造成错误和商业损失相比,简直不值一提。

    注意过多细节会导致重要事项的注意力缺失,这正是诸如 Rails 这样的框架的核心价值所在。

  • [上海] 噗印--个性化电商团队招聘 Ruby 开发工程师 (薪酬、福利优厚) at September 30, 2015

    React-native 写错了

  • 有一个似乎是很常见的需求,但是没发现简洁优雅的实现方式:如何结束 ping x.x.x.x -t 命令? at September 28, 2015

    用net-ping,还需要装一下win32-security

    测试可用。

    c:\git>irb
    irb(main):001:0> require 'net/ping'
    => true
    irb(main):002:0> pt = Net::Ping::TCP.new('cvpmesip01')
    => #<Net::Ping::TCP:0x193eee8 @host="cvpmesip01", @port=7, @timeout=5, @exception=nil, @warning=nil, @duration=nil>
    irb(main):003:0> pt.ping
    => false
    irb(main):004:0> pt = Net::Ping::TCP.new('cvpmesip01',2881)
    => #<Net::Ping::TCP:0x2a798f0 @host="cvpmesip01", @port=2881, @timeout=5, @exception=nil, @warning=nil, @duration=nil>
    irb(main):005:0> pt.ping
    => true
    irb(main):006:0> pt = Net::Ping::TCP.new('cvpmesip01',80)
    => #<Net::Ping::TCP:0x2b18b90 @host="cvpmesip01", @port=80, @timeout=5, @exception=nil, @warning=nil, @duration=nil>
    irb(main):007:0> pt.ping
    => true
    
  • Rails 里微信公众号相关开发能本地测试吗? at September 22, 2015

    其实正确的姿势是用wechat gem,还有官方调试工具。。。

  • [Autodesk] 参与分享,回馈社区 at September 22, 2015

    棒!

  • Rails 中有没有作业调度的框架? at September 22, 2015

    whenever?

  • Rails 5 的 where.or 在 Rails 4.2 上也可以使用了。 at September 18, 2015

    #10 楼 @martin91 承认,所以我举了一个生产的例子,我就料到爱美的 rubyist 肯定要喷这个简单例子不漂亮。 😄

  • 书不在多,精读才行 at September 17, 2015

    其实guides.rubyonrails.org,官方 guide 真的值得细读,更何况还是免费的。

  • Rails 5 的 where.or 在 Rails 4.2 上也可以使用了。 at September 17, 2015

    #6 楼 @roclv 你这样写目前 rails 5/where-or 里面都是不工作的。

  • Rails 5 的 where.or 在 Rails 4.2 上也可以使用了。 at September 17, 2015

    #2 楼 @huacnlee 需求比较变态,已知一堆程序的字符数组,需要从 EES_RMS_TOOL_RECIPE 表中,找到匹配文件名,使用recipe_id LIKE '%P12457-20NI150MI'匹配,但是显然一条条用 like 查数量会比较多,所以希望一条语句直接捞出来,所以不同的 like 间是 OR 关系,最后还有一个 and 关系。

    #1 楼 @alvin2ye 由于 like 数量不限,拼字符串我觉得肯定没有 where.or 好,更不要说拼字符串的 SQL 注入问题了。

  • Rails 5 的 where.or 在 Rails 4.2 上也可以使用了。 at September 17, 2015

    #3 楼 @est #4 楼 @roclv AR 类似 jQuery,要求链式调用,这些都不是链式调用

  • 查找文件创建时间-寻找解决方案 at September 17, 2015

    #4 楼 @zlx_star 嗯,好像的确 Ubuntu 12.04 下同样有这个问题,难得的 Windows 下正常,Linux 下不正常的功能。。

    D:\>irb
    irb(main):001:0> File.birthtime('Ruby223.rar')
    => 2015-09-16 11:00:24 +0800
    irb(main):002:0>
    
  • Rails 中的 blank? and present? at September 16, 2015

    可惜 present?是 activesupport 的写法,如果不想用这个 gems,有没有其他更好的写法?

  • ActiveRecord 里面关于 or 查询的时候,有没有比较简单的写法? at September 16, 2015

    如果用的是 Rails 4.2.3+,可以考虑用这个where-or gem,就是Rails 5 的 where.or

  • 查找文件创建时间-寻找解决方案 at September 16, 2015

    Ruby 2.2 开始有了birthtime,就是你要的。

  • 关于连接其它数据库的配置 at September 13, 2015

    可以参考这个帖子

  • 2015 最新调查:现在的前端工程师都用什么? at September 13, 2015

    #61 楼 @nightire 加油,少灌水,用产品说话。😄

  • 有在用 12 寸 Macbook 的吗? at September 13, 2015

    等下一代吧,应该很快出了,Skylake

  • gem 'net-ssh' 调用 Net::SSH.start ('host', 'user', :password => "password") 方法时候 用户名或者密码错误情况下程序卡死 at September 13, 2015

    有个 on_falure 可以看一下。

    http://net-ssh.github.io/ssh/v1/chapter-5.html

    channel.on_failure do
      puts "shell could not be started!"
    end
    channel.on_data do |ch,data|
      puts "recieved #{data} from shell"
    end
    channel.on_close do
      puts "shell terminated"
    end
    
  • Prev
  • 1
  • 2
  • …
  • 16
  • 17
  • 18
  • 19
  • 20
  • …
  • 44
  • 45
  • Next
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English