Prawn使用Annotation坐标点注意事项
辛卯[兔]年 腊月十三
Prawn的坐标系统简单说明:页面左下为(x=0. y=0) 向右x+, 向上y+
注意annotation时rectangle的点位确认
1. 默认取 左下-右上 两点确定rectangle
2.如果是在bounding_box block中使用annotation,使用左上-右下确定rectangle
Prawn的坐标系统简单说明:页面左下为(x=0. y=0) 向右x+, 向上y+
注意annotation时rectangle的点位确认
1. 默认取 左下-右上 两点确定rectangle
2.如果是在bounding_box block中使用annotation,使用左上-右下确定rectangle
Tags: prawn Posted in Ruby & Rails
以下配置在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
Tags: ejabberd mod_archive Posted in Ruby & Rails
Capybara.current_session.driver.browser.current_session.last_request.env["rack.session"]["user_id"]
真的很长!
Tags: capybara cucumber Posted in Ruby & 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,结束。
Tags: juggernaut rails Posted in Ruby & Rails
RottenEgg文件上传:将基于版本管理(SVN或GIT)得文件通过FTP上传到指定位置。
还得从目前在使用中的JUSTHOST主机说起,部署不便,需要FTP。变更多或是频繁,操作起来就够呛。
RottenEgg最初是在命令行下使用的脚本。经过工作之余断断续续的增补,才滚出来。
Thin + Sinatra + ExtJS4
GitHub:https://github.com/elvuel/rottenegg
RubyGems:http://rubygems.org/gems/rottenegg
目前BETA版本。
Tags: scm ftp Posted in Ruby & Rails
Copyright © 2010 elvuel.com Powered by Elvuel.