fast_jsonapi 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b3264df8a99356f622a1ae64d3342b4053db4034
4
+ data.tar.gz: ff8f3b5f94425a792ea7e91ae71a03e37e329187
5
+ SHA512:
6
+ metadata.gz: 2f360b1b12b52ea8655592613fbce505d8fe79c2458ee58d2ae1e6e17f30ece72f6c9781f3dd116b1e4ddbada91f2abb36bda960c8c09ff83ba54441b089a0db
7
+ data.tar.gz: 596aa63a06c578396193f55fbefaeb69c957632ad90efe270213c1fa345114fea0c2fddec419aa9b2459a09ea4ba93a03e87874995ebec5cf247b9747bd16a0c
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,23 @@
1
+ # Add gem dependencies here.
2
+ gem "activesupport", "~> 5.0"
3
+ gem "multi_json", "~> 1.12"
4
+ gem "oj", "~> 3.3"
5
+
6
+ # needed to send active support notifications to skylight
7
+ gem "skylight", "~> 1.3"
8
+
9
+ # needed because of the extension/has_one.rb
10
+ gem "activerecord", "~> 5.0"
11
+
12
+ # Add dependencies to develop and test the gem here
13
+ group :development do
14
+ gem "rspec", "~> 3.5.0"
15
+ gem "rspec-benchmark", "~> 0.3.0"
16
+ gem "rdoc", "~> 3.12"
17
+ gem "bundler", "~> 1.0"
18
+ gem "juwelier", "~> 2.1.0"
19
+ gem "simplecov", ">= 0"
20
+ gem "byebug"
21
+ gem "active_model_serializers", "~> 0.10.4"
22
+ gem "sqlite3", "~> 1.3"
23
+ end
@@ -0,0 +1,152 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ actionpack (5.1.4)
5
+ actionview (= 5.1.4)
6
+ activesupport (= 5.1.4)
7
+ rack (~> 2.0)
8
+ rack-test (>= 0.6.3)
9
+ rails-dom-testing (~> 2.0)
10
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
11
+ actionview (5.1.4)
12
+ activesupport (= 5.1.4)
13
+ builder (~> 3.1)
14
+ erubi (~> 1.4)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
17
+ active_model_serializers (0.10.7)
18
+ actionpack (>= 4.1, < 6)
19
+ activemodel (>= 4.1, < 6)
20
+ case_transform (>= 0.2)
21
+ jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
22
+ activemodel (5.1.4)
23
+ activesupport (= 5.1.4)
24
+ activerecord (5.1.4)
25
+ activemodel (= 5.1.4)
26
+ activesupport (= 5.1.4)
27
+ arel (~> 8.0)
28
+ activesupport (5.1.4)
29
+ concurrent-ruby (~> 1.0, >= 1.0.2)
30
+ i18n (~> 0.7)
31
+ minitest (~> 5.1)
32
+ tzinfo (~> 1.1)
33
+ addressable (2.5.2)
34
+ public_suffix (>= 2.0.2, < 4.0)
35
+ arel (8.0.0)
36
+ benchmark-perf (0.2.1)
37
+ builder (3.2.3)
38
+ byebug (9.1.0)
39
+ case_transform (0.2)
40
+ activesupport
41
+ concurrent-ruby (1.0.5)
42
+ crass (1.0.3)
43
+ descendants_tracker (0.0.4)
44
+ thread_safe (~> 0.3, >= 0.3.1)
45
+ diff-lcs (1.3)
46
+ docile (1.1.5)
47
+ erubi (1.7.0)
48
+ faraday (0.12.2)
49
+ multipart-post (>= 1.2, < 3)
50
+ git (1.3.0)
51
+ github_api (0.18.2)
52
+ addressable (~> 2.4)
53
+ descendants_tracker (~> 0.0.4)
54
+ faraday (~> 0.8)
55
+ hashie (~> 3.5, >= 3.5.2)
56
+ oauth2 (~> 1.0)
57
+ hashie (3.5.6)
58
+ highline (1.7.10)
59
+ i18n (0.9.1)
60
+ concurrent-ruby (~> 1.0)
61
+ json (1.8.6)
62
+ jsonapi-renderer (0.2.0)
63
+ juwelier (2.1.3)
64
+ builder
65
+ bundler (>= 1.13)
66
+ git (>= 1.2.5)
67
+ github_api
68
+ highline (>= 1.6.15)
69
+ nokogiri (>= 1.5.10)
70
+ rake
71
+ rdoc
72
+ semver
73
+ jwt (1.5.6)
74
+ loofah (2.1.1)
75
+ crass (~> 1.0.2)
76
+ nokogiri (>= 1.5.9)
77
+ mini_portile2 (2.3.0)
78
+ minitest (5.10.3)
79
+ multi_json (1.12.2)
80
+ multi_xml (0.6.0)
81
+ multipart-post (2.0.0)
82
+ nokogiri (1.8.1)
83
+ mini_portile2 (~> 2.3.0)
84
+ oauth2 (1.4.0)
85
+ faraday (>= 0.8, < 0.13)
86
+ jwt (~> 1.0)
87
+ multi_json (~> 1.3)
88
+ multi_xml (~> 0.5)
89
+ rack (>= 1.2, < 3)
90
+ oj (3.3.9)
91
+ public_suffix (3.0.1)
92
+ rack (2.0.3)
93
+ rack-test (0.8.2)
94
+ rack (>= 1.0, < 3)
95
+ rails-dom-testing (2.0.3)
96
+ activesupport (>= 4.2.0)
97
+ nokogiri (>= 1.6)
98
+ rails-html-sanitizer (1.0.3)
99
+ loofah (~> 2.0)
100
+ rake (12.3.0)
101
+ rdoc (3.12.2)
102
+ json (~> 1.4)
103
+ rspec (3.5.0)
104
+ rspec-core (~> 3.5.0)
105
+ rspec-expectations (~> 3.5.0)
106
+ rspec-mocks (~> 3.5.0)
107
+ rspec-benchmark (0.3.0)
108
+ benchmark-perf (~> 0.2.0)
109
+ rspec (>= 3.0.0, < 4.0.0)
110
+ rspec-core (3.5.4)
111
+ rspec-support (~> 3.5.0)
112
+ rspec-expectations (3.5.0)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.5.0)
115
+ rspec-mocks (3.5.0)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.5.0)
118
+ rspec-support (3.5.0)
119
+ semver (1.0.1)
120
+ simplecov (0.15.1)
121
+ docile (~> 1.1.0)
122
+ json (>= 1.8, < 3)
123
+ simplecov-html (~> 0.10.0)
124
+ simplecov-html (0.10.2)
125
+ skylight (1.5.0)
126
+ activesupport (>= 3.0.0)
127
+ sqlite3 (1.3.13)
128
+ thread_safe (0.3.6)
129
+ tzinfo (1.2.4)
130
+ thread_safe (~> 0.1)
131
+
132
+ PLATFORMS
133
+ ruby
134
+
135
+ DEPENDENCIES
136
+ active_model_serializers (~> 0.10.4)
137
+ activerecord (~> 5.0)
138
+ activesupport (~> 5.0)
139
+ bundler (~> 1.0)
140
+ byebug
141
+ juwelier (~> 2.1.0)
142
+ multi_json (~> 1.12)
143
+ oj (~> 3.3)
144
+ rdoc (~> 3.12)
145
+ rspec (~> 3.5.0)
146
+ rspec-benchmark (~> 0.3.0)
147
+ simplecov
148
+ skylight (~> 1.3)
149
+ sqlite3 (~> 1.3)
150
+
151
+ BUNDLED WITH
152
+ 1.16.0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright {yyyy} {name of copyright owner}
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,233 @@
1
+ # Fast JSON API
2
+
3
+ [![NetflixOSS Lifecycle](https://img.shields.io/osslifecycle/Netflix/osstracker.svg)]()
4
+
5
+ A lightning fast [JSON:API](http://jsonapi.org/) serializer for Ruby Objects.
6
+
7
+ # Performance Comparision
8
+
9
+ We compare serialization times with Active Model Serializer as part of RSpec performance tests included on this library. We want to ensure that with every change on this library, serialization time is at least `25 times` faster than Active Model Serializers on up to current benchmark of 1000 records.
10
+
11
+ ## Benchmark times for 250 records
12
+
13
+ ```bash
14
+ $ rspec
15
+ Active Model Serializer serialized 250 records in 138.71 ms
16
+ Fast JSON API serialized 250 records in 3.01 ms
17
+ ```
18
+
19
+ # Table of Contents
20
+
21
+ * [Features](#features)
22
+ * [Installation](#installation)
23
+ * [Usage](#usage)
24
+ * [Model Definition](#model-definition)
25
+ * [Serializer Definition](#serializer-definition)
26
+ * [Object Serialization](#object-serialization)
27
+ * [Compound Document](#compound-document)
28
+ * [Collection Serialization](#collection-serialization)
29
+ * [Caching](#caching)
30
+ * [Contributing](#contributing)
31
+
32
+
33
+ ## Features
34
+
35
+ * Declaration syntax similar to Active Model serializer
36
+ * Support for belongs_to, has_many and has_one
37
+ * Support for compound documents (included)
38
+ * Optimized serialization of compound documents
39
+ * Caching
40
+
41
+ ## Installation
42
+
43
+ Add this line to your application's Gemfile:
44
+
45
+ ```ruby
46
+ gem 'fast_jsonapi'
47
+ ```
48
+
49
+ Execute:
50
+
51
+ ```ruby
52
+ $ bundle install
53
+ ```
54
+
55
+ ## Usage
56
+
57
+ ### Model Definition
58
+
59
+ ```ruby
60
+ class Movie
61
+ attr_accessor :id, :name, :year, :actor_ids, :owner_id
62
+ end
63
+ ```
64
+
65
+ ### Serializer Definition
66
+
67
+ ```ruby
68
+ class MovieSerializer
69
+ include FastJsonapi::ObjectSerializer
70
+ set_type :movie # optional
71
+ attributes :name, :year
72
+ has_many :actors
73
+ belongs_to :owner, record_type: :user
74
+ belongs_to :movie_type
75
+ end
76
+ ```
77
+
78
+ ### Sample Object
79
+
80
+ ```ruby
81
+ m = Movie.new
82
+ m.id = 232
83
+ m.name = 'test movie'
84
+ m.actor_ids = [1, 2, 3]
85
+ m.owner_id = 3
86
+ m.movie_type_id = 1
87
+ m
88
+ ```
89
+
90
+ ### Object Serialization
91
+
92
+ #### Return a hash
93
+ ```ruby
94
+ hash = MovieSerializer.new(movie).serializable_hash
95
+ ```
96
+
97
+ #### Return Serialized JSON
98
+ ```ruby
99
+ json_string = MovieSerializer.new(movie).serialized_json
100
+ ```
101
+
102
+ #### Serialized Output
103
+
104
+ ```json
105
+ {
106
+ "data": {
107
+ "id": "232",
108
+ "type": "movie",
109
+ "attributes": {
110
+ "name": "test movie",
111
+ "year": null
112
+ },
113
+ "relationships": {
114
+ "actors": {
115
+ "data": [
116
+ {
117
+ "id": "1",
118
+ "type": "actor"
119
+ },
120
+ {
121
+ "id": "2",
122
+ "type": "actor"
123
+ }
124
+ ]
125
+ },
126
+ "owner": {
127
+ "data": {
128
+ "id": "3",
129
+ "type": "user"
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+
136
+ ```
137
+ ### Compound Document
138
+
139
+ Support for top-level included member through ` options[:include] `.
140
+
141
+ ```ruby
142
+ options = {}
143
+ options[:meta] = { total: 2 }
144
+ options[:include] = [:actors]
145
+ MovieSerializer.new([movie, movie], options).serialized_json
146
+ ```
147
+
148
+ ### Collection Serialization
149
+
150
+ ```ruby
151
+ options[:meta] = { total: 2 }
152
+ hash = MovieSerializer.new([movie, movie], options).serializable_hash
153
+ json_string = MovieSerializer.new([movie, movie], options).serialized_json
154
+ ```
155
+
156
+ [Output String](https://github.com/Netflix/fast_jsonapi/blob/master/docs/collection_serializer_output.md)
157
+
158
+ ### Caching
159
+
160
+ ```ruby
161
+ class MovieSerializer
162
+ include FastJsonapi::ObjectSerializer
163
+ set_type :movie # optional
164
+ cache_options enabled: true cache_length: 12.hours
165
+ attributes :name, :year
166
+ end
167
+ ```
168
+
169
+ ### Customizable Options
170
+
171
+ Option | Purpose | Example
172
+ ------------ | ------------- | -------------
173
+ set_type | Type name of Object | ```set_type :movie ```
174
+ cache_options | Hash to enable caching and set cache length | ```cache_options enabled: true cache_length: 12.hours```
175
+ id_method_name | Set custom method name to get ID of an object | ```has_many :locations, id_method_name: :place_ids ```
176
+ object_method_name | Set custom method name to get related objects | ```has_many :locations, object_method_name: :places ```
177
+ record_type | Set custom Object Type for a relationship | ```belongs_to :owner, record_type: :user```
178
+ serializer | Set custom Serializer for a relationship | ```has_many :actors, serializer: :custom_actor```
179
+ cache_options | Hash to enable caching and set cache length | ```cache_options enabled: true cache_length: 12.hours ```
180
+
181
+
182
+ ## Contributing
183
+
184
+ This gem is built using a gem building gem called [juwelier](https://github.com/flajann2/juwelier).
185
+
186
+ Beyond just editing source code, you’ll be interacting with the gem using rake a lot. To see all the tasks available with a brief description, you can run:
187
+
188
+ ```bash
189
+ rake -T
190
+ ```
191
+
192
+ ### Updating Project information
193
+ You can update the project information of the gem by updating the [Rakefile](Rakefile). Then you need to generate a new gemspec
194
+
195
+ ```bash
196
+ rake gemspec
197
+ ```
198
+
199
+ ### Running Tests
200
+ We use rspec for testing. We have unit tests, functional tests and performance tests. To run tests use the following rake task
201
+
202
+ ```bash
203
+ rake spec
204
+ ```
205
+
206
+ ### Installation
207
+
208
+ ```bash
209
+ $ rake install
210
+ ```
211
+
212
+ The install rake task builds the gem installs it. You're all
213
+ set if you're using [RVM](http://rvm.beginrescueend.com/), but you may
214
+ need to run it with sudo if you have a system-installed ruby:
215
+
216
+ ### Bumping Version
217
+
218
+ It feels good to release code. Do it, do it often. But before that, bump
219
+ the version. Then release it. There's a few ways to update the version:
220
+
221
+ ```ruby
222
+ # version:write like before
223
+ $ rake version:write MAJOR=0 MINOR=3 PATCH=0
224
+
225
+ # bump just major, ie 0.1.0 -> 1.0.0
226
+ $ rake version:bump:major
227
+
228
+ # bump just minor, ie 0.1.0 -> 0.2.0
229
+ $ rake version:bump:minor
230
+
231
+ # bump just patch, ie 0.1.0 -> 0.1.1
232
+ $ rake version:bump:patch
233
+ ```