Skip to content

Commit 1a50bb7

Browse files
author
Naomi Slater
committed
add create_tag.sh and improve top level docs
1 parent ba51e80 commit 1a50bb7

File tree

6 files changed

+239
-190
lines changed

6 files changed

+239
-190
lines changed

CONTRIBUTING.rst

Lines changed: 7 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,10 @@
1-
Contributing to Crate Ruby
2-
==========================
1+
============
2+
Contributing
3+
============
34

4-
Thanks for considering contributing to the Crate Data Ruby library.
5+
Thank you for your interest in contributing.
56

7+
Please see the CrateDB `contribution guide`_ for more information. Everything in
8+
the CrateDB contribution guide applies to this repository.
69

7-
Reporting an issue
8-
------------------
9-
10-
- Search existing issues before raising a new one.
11-
12-
- include as much details as possible. This might include:
13-
14-
- Which OS you're using.
15-
16-
- Which version you've been running.
17-
18-
- Logs/Stacktrace of the error that occurred.
19-
20-
- Steps to reproduce.
21-
22-
23-
Pull requests
24-
-------------
25-
26-
Before we can accept any pull requests to the Crate Data Ruby library
27-
we need you to agree to our CLA_. Once that is done, we suggest to
28-
continue as follows:
29-
30-
- Add an issue on Github and let us know that you're working on something.
31-
32-
- Use a feature branch, not master.
33-
34-
- Rebase your feature branch onto origin/master before raising the PR
35-
36-
- Be descriptive in your PR and commit messages. What is it for, why is it
37-
needed, etc.
38-
39-
- Make sure the tests pass.
40-
41-
- Squash related commits
42-
43-
.. _CLA: https://crate.io/community/contribute/
44-
45-
46-
Rebase
47-
------
48-
49-
If while you've been working in the feature branch new commits were added to
50-
the master branch please don't merge them but use rebase::
51-
52-
git fetch origin
53-
git rebase origin/master
54-
55-
This will apply all commits on your feature branch on top of the master branch.
56-
Any conflicts can be resolved just the same as if ``git merge`` was used. After
57-
the conflict has been resolved use ``git rebase --continue`` to continue the
58-
rebase process.
59-
60-
61-
Squash
62-
------
63-
64-
Minor commits that only fix typos or rename variables that are related to a
65-
bigger change should be squashed into that commit.
66-
67-
This can be done using ``git rebase -i ( <hash> | <branch> )``
68-
69-
For example while working on a feature branch you'd use::
70-
71-
git add .
72-
git commit -m "implemented feature XY"
73-
74-
# push and ask for a merge/review
75-
76-
git add .
77-
git commit --fixup $(git rev-parse HEAD)
78-
79-
# push and ask for a merge/review
80-
81-
git add .
82-
git commit --fixup $(git rev-parse HEAD)
83-
84-
git rebase -i origin/master
85-
86-
``git commit --fixup`` will mark the commit as a fixup relating to the commit
87-
HEAD currently points to.
88-
89-
This is useful because ``git rebase -i`` will then automatically recognize the
90-
fixup commits and mark them to squash. But in order for that to work the
91-
``autosquash`` setting has to be enabled in the ``.gitconfig``::
92-
93-
git config --global rebase.autosquash true
10+
.. _contribution guide: https://github.com/crate/crate/blob/master/CONTRIBUTING.rst

DEVELOP.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

DEVELOP.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
===============
2+
Developer Guide
3+
===============
4+
5+
Tests
6+
=====
7+
8+
First, download and install CrateDB locally::
9+
10+
$ ruby spec/bootstrap.rb
11+
12+
Then, run tests like so::
13+
14+
$ bundle exec rspec spec
15+
16+
Preparing a Release
17+
===================
18+
19+
To create a new release, you must:
20+
21+
- Update ``CrateRuby.version`` in ``lib/crate_ruby/version.rb``
22+
23+
- Add a section for the new version in the ``history.txt`` file
24+
25+
- Commit your changes with a message like "prepare release x.y.z"
26+
27+
- Push to origin
28+
29+
- Create a tag by running ``./devtools/create_tag.sh``
30+
31+
RubyGems Deployment
32+
===================
33+
34+
Update your package manager::
35+
36+
$ gem update --system
37+
38+
Build the new gem::
39+
40+
$ gem build crate_ruby.gemspec
41+
42+
Publish the new gem::
43+
44+
$ gem push crate_ruby-<VERISON>.gem
45+
46+
Here, ``<VERISON>`` is the version you are releasing.

README.md

Lines changed: 0 additions & 87 deletions
This file was deleted.

README.rst

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
===================
2+
CrateDB Ruby Client
3+
===================
4+
5+
.. image:: https://badge.fury.io/rb/crate_ruby.svg
6+
:target: http://badge.fury.io/rb/crate_ruby
7+
:alt: Gem Version
8+
9+
.. image:: https://travis-ci.org/crate/crate_ruby.svg?branch=master
10+
:target: https://travis-ci.org/crate/crate_ruby
11+
:alt: Build Status
12+
13+
.. image:: https://codeclimate.com/github/crate/crate_ruby.png
14+
:target: https://codeclimate.com/github/crate/crate_ruby
15+
:alt: Code Climate
16+
17+
|
18+
19+
A Ruby client library for CrateDB_.
20+
21+
Prerequisites
22+
=============
23+
24+
You will need Ruby 2.0 or greater.
25+
26+
Installation
27+
============
28+
29+
The CrateDB Ruby client is available as a Ruby gem_.
30+
31+
Add this line to your application's ``Gemfile``::
32+
33+
gem 'crate_ruby'
34+
35+
Or, install it manually, like so::
36+
37+
$ gem install crate_ruby
38+
39+
Examples
40+
========
41+
42+
Set up the client like so::
43+
44+
require 'crate_ruby'
45+
46+
client = CrateRuby::Client.new
47+
48+
Execute SQL queries like so::
49+
50+
result = client.execute("Select * from posts")
51+
=> #<CrateRuby::ResultSet:0x00000002a9c5e8 @rowcount=1, @duration=5>
52+
53+
result.each do |row|
54+
puts row.inspect
55+
end
56+
=> [1, "test", 5]
57+
58+
result.cols
59+
=> ["id", "my_column", "my_integer_col"]
60+
61+
62+
Perform parameter substitution like so::
63+
64+
client.execute(
65+
"INSERT INTO posts (id, title, tags) VALUES (\$1, \$2, \$3)",
66+
[1, "My life with crate", ['awesome', 'cool']])
67+
68+
Manipulate BLOBs like so::
69+
70+
digest = Digest::SHA1.file(file_path).hexdigest
71+
72+
# upload
73+
f = File.read(file_path)
74+
client.blob_put(table_name, digest, f)
75+
76+
# download
77+
data = client.blob_get(table_name, digest)
78+
open(file_path, "wb") do |file|
79+
file.write(data)
80+
end
81+
82+
# deletion
83+
client.blob_delete(table_name, digest)
84+
85+
Contributing
86+
============
87+
88+
This project is primarily maintained by `Crate.io`_, but we welcome community
89+
contributions!
90+
91+
See the `developer docs`_ and the `contribution docs`_ for more information.
92+
93+
Help
94+
====
95+
96+
Looking for more help?
97+
98+
- Check `StackOverflow`_ for common problems
99+
- Chat with us on `Slack`_
100+
- Get `paid support`_
101+
102+
.. _contribution docs: CONTRIBUTING.rst
103+
.. _Crate.io: https://crate.io
104+
.. _CrateDB: https://github.com/crate/crate
105+
.. _developer docs: DEVELOP.rst
106+
.. _gem: https://rubygems.org/
107+
.. _paid support: https://crate.io/pricing/
108+
.. _Slack: https://crate.io/docs/support/slackin/
109+
.. _StackOverflow: https://stackoverflow.com/tags/crate

0 commit comments

Comments
 (0)