Elvuel

善战者无赫赫之功

  • Home
  • Atom
  • About Elvuel
« Previous 1 2 3 4 5 6 7 8 9 … 13 14 Next »

Prawn使用Annotation坐标点注意事项

辛卯[兔]年 腊月十三

Prawn的坐标系统简单说明:页面左下为(x=0. y=0) 向右x+, 向上y+

注意annotation时rectangle的点位确认

1. 默认取 左下-右上 两点确定rectangle

2.如果是在bounding_box block中使用annotation,使用左上-右下确定rectangle

read more >>

Tags: prawn   Posted in Ruby & Rails

ejabberd mod_archive

辛卯[兔]年 十一月十一

以下配置在ubuntu下测试通过,使用PGSQL为存储数据库

Install ejabberd

apt-get install ejabberd

Checkout ejabberd modules

svn checkout https://svn.process-one.net/ejabberd-modules /usr/local/src/ejabberd-modules

Complie mod_archive

cd mod_archive/trunk

./build.sh

cp ebin/*.beam /usr/lib/ejabberd/ebin

Compile pgsql

cd pgsql/trunk

./build.sh

cp ebin/*.bea

read more >>

Tags: ejabberd mod_archive   Posted in Ruby & Rails

Capybara get session in cuke step

辛卯[兔]年 十一月初五

Capybara.current_session.driver.browser.current_session.last_request.env["rack.session"]["user_id"]

真的很长!

read more >>

Tags: capybara cucumber   Posted in Ruby & Rails

Juggernaut & Rails

辛卯[兔]年 八月初二

Juggernauthttps://github.com/maccman/juggernaut

安装配置

1. nodejs http://nodejs.org

获取 0.4.11稳定版

以下: sudo

wget http://nodejs.org/dist/node-v0.4.11.tar.gz

〉tar zxvfnode-v0.4.11.tar.gz

〉cd node-v0.4.11

〉./configure

〉make

〉make install

2. npm(需NODEJS 0.4以上版本)

以下: sudo

curl http://npmjs.org/install.sh | sh

安装模块

〉npm install socket.io

〉npm install redis

〉npm install optimist

〉npm install node-static-maccman

3. 安装并启动redis-server

〉redis-server /etc/redis/redis.conf

4. 启动 juggernaut

〉git clone https://github.com/maccman/juggernaut.git

〉cd juggernaut

〉node server.js

4. 创建RAILS应用

〉rails new juggernaut_demo

〉cd juggernaut_demo

vim Gemfile:

gem 'juggernaut'

〉bundle install

〉rails g controller welcome index publish

vim routes.rb

root :to =〉 "welcome#index"

get "welcome#publish"

vim application.html.erb

〈script src="http://localhost:8080/application.js" type="text/javascript" charset="utf-8"〉〈/script〉

vim welcome#index.html.erb

〈script type="text/javascript" charset="utf-8"〉 var jug = new Juggernaut; jug.subscribe("demo_channel", function(data){ alert(data); }); 〈/script〉

vim welcome_controller#publish

def publish

Juggernaut.publish"demo_channel", "juggernaut demo msg"

end

〉rails s

访问: http://localhost:3000/

http://localhost:3000/welcome/publish

Ok,结束。


read more >>

Tags: juggernaut rails   Posted in Ruby & Rails

RottenEgg发布

辛卯[兔]年 七月十七

RottenEgg文件上传:将基于版本管理(SVN或GIT)得文件通过FTP上传到指定位置。

还得从目前在使用中的JUSTHOST主机说起,部署不便,需要FTP。变更多或是频繁,操作起来就够呛。

RottenEgg最初是在命令行下使用的脚本。经过工作之余断断续续的增补,才滚出来。

Thin + Sinatra + ExtJS4

GitHub:https://github.com/elvuel/rottenegg

RubyGems:http://rubygems.org/gems/rottenegg

目前BETA版本。

read more >>

Tags: scm ftp   Posted in Ruby & Rails

« Previous 1 2 3 4 5 6 7 8 9 … 13 14 Next »
  • Search

  • Categories

    • Ruby & Rails
    • Jobs
    • Uncategorized
  • Recent Posts

    • Prawn使用Annotation坐...
    • ejabberd mod_archive
    • Capybara get session in ...
    • Juggernaut & Rails
    • RottenEgg发布
    • ruby rmagick 生成DM
    • ActiveResource for no r...
    • Rails生成Model文档
    • 转-Method triggers:inst...
    • 招聘-Ruby on Rails软件...
  • Links

    • RailsCasts
    • Alltop Ruby
    • Command Line Refer
    • Ruby Code Snippets
    • GitHub
    • API Dock
    • OpenSourceRails
    • RailsPlugins
    • RailsLab
    • The Ruby Reflector
  • Archives

    • 2012年(1)

    • 2012年01月(1)
    • 2011年(10)

    • 2011年12月(1)
    • 2011年11月(1)
    • 2011年08月(2)
    • 2011年04月(2)
    • 2011年03月(1)
    • 2011年01月(3)
    • 2010年(27)

    • 2010年12月(1)
    • 2010年11月(2)
    • 2010年10月(4)
    • 2010年09月(7)
    • 2010年08月(1)
    • 2010年07月(5)
    • 2010年06月(1)
    • 2010年04月(6)
    • 2009年(13)

    • 2009年10月(1)
    • 2009年05月(2)
    • 2009年04月(1)
    • 2009年03月(2)
    • 2009年02月(7)
    • 2008年(19)

    • 2008年08月(1)
    • 2008年07月(1)
    • 2008年06月(1)
    • 2008年05月(3)
    • 2008年04月(1)
    • 2008年03月(2)
    • 2008年02月(10)

Copyright © 2010 elvuel.com Powered by Elvuel.