Ruby-PLSQL 项目教程

Ruby-PLSQL 项目教程

ruby-plsqlruby-plsql gem provides simple Ruby API for calling Oracle PL/SQL procedures. It could be used both for accessing Oracle PL/SQL API procedures in legacy applications as well as it could be used to create PL/SQL unit tests using Ruby testing libraries.项目地址:https://gitcode.com/gh_mirrors/ru/ruby-plsql

1. 项目的目录结构及介绍

Ruby-PLSQL 项目的目录结构如下:

ruby-plsql/
├── Gemfile
├── LICENSE
├── README.md
├── Rakefile
├── lib/
│   ├── ruby_plsql.rb
│   └── ruby_plsql/
│       ├── base.rb
│       ├── connection.rb
│       ├── cursor.rb
│       ├── exceptions.rb
│       ├── functions.rb
│       ├── procedures.rb
│       ├── records.rb
│       ├── schema.rb
│       ├── table.rb
│       ├── types.rb
│       └── version.rb
├── ruby-plsql.gemspec
├── spec/
│   ├── spec_helper.rb
│   └── ruby_plsql_spec.rb
└── vagrant/
    └── Vagrantfile

目录介绍

  • Gemfile: 定义了项目的依赖关系。
  • LICENSE: 项目的许可证文件。
  • README.md: 项目的说明文档。
  • Rakefile: 用于定义项目的任务。
  • lib/: 包含项目的主要代码文件。
    • ruby_plsql.rb: 项目的主文件。
    • ruby_plsql/: 包含项目的各个模块文件。
  • ruby-plsql.gemspec: 项目的 gemspec 文件,用于打包和发布。
  • spec/: 包含项目的测试文件。
  • vagrant/: 包含 Vagrant 配置文件,用于虚拟环境设置。

2. 项目的启动文件介绍

项目的启动文件是 lib/ruby_plsql.rb,该文件是 Ruby-PLSQL 库的入口点。它负责加载项目的各个模块,并提供对外的 API 接口。

require "ruby-plsql/version"
require "ruby-plsql/base"
require "ruby-plsql/connection"
require "ruby-plsql/cursor"
require "ruby-plsql/exceptions"
require "ruby-plsql/functions"
require "ruby-plsql/procedures"
require "ruby-plsql/records"
require "ruby-plsql/schema"
require "ruby-plsql/table"
require "ruby-plsql/types"

3. 项目的配置文件介绍

项目的配置文件主要是 Gemfileruby-plsql.gemspec

Gemfile

Gemfile 定义了项目的依赖关系,包括所需的 gem 及其版本。

source "https://rubygems.org"

gem "activerecord", ">= 3.2.3", "< 4.3.0"
gem "activerecord-oracle_enhanced-adapter", ">= 1.4.1", "< 1.7.0"
gem "jeweler", "~> 2.0.1"
gem "rspec", "~> 3.1"

ruby-plsql.gemspec

ruby-plsql.gemspec 是项目的 gemspec 文件,用于打包和发布。它包含了项目的元数据和依赖关系。

Gem::Specification.new do |s|
  s.name = "ruby-plsql"
  s.version = "0.6.0"
  s.authors = ["Raimonds Simanovskis"]
  s.email = ["raimonds.simanovskis@gmail.com"]
  s.summary = "Ruby API for calling Oracle PL/SQL procedures"
  s.description = "ruby-plsql gem provides simple Ruby API for calling Oracle PL/SQL procedures. It could be used both for accessing Oracle PL/SQL API procedures in legacy applications as well as it could be used to create PL/SQL unit tests using Ruby testing libraries."
  s.homepage = "https://github.com/rsim/ruby-plsql"
  s.license = "MIT"

  s.files = `git ls-files`.split($/)
  s.require_paths = ["lib"]

  s.add_dependency "activerecord", ">= 3.2.3", "< 4.3.0"
  s.add_dependency "activerecord-oracle_enhanced-adapter", ">= 1.4.1", "< 1.7.0"
  s.add_development_dependency "jeweler", "~> 2.

ruby-plsqlruby-plsql gem provides simple Ruby API for calling Oracle PL/SQL procedures. It could be used both for accessing Oracle PL/SQL API procedures in legacy applications as well as it could be used to create PL/SQL unit tests using Ruby testing libraries.项目地址:https://gitcode.com/gh_mirrors/ru/ruby-plsql

  • 10
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

柏珂卿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值