|
1 | | -# Seam API Ruby SDK |
2 | | - |
3 | | -[](https://rubygems.org/gems/seamapi) |
4 | | -[](https://github.com/seamapi/ruby/actions) |
5 | | -[](https://docs.seam.co/) |
6 | | - |
7 | | -Official interface to the [Seam Connect API]. |
8 | | - |
9 | | -[Seam Connect API]: https://docs.seam.co/ |
10 | | - |
11 | | -## Description |
12 | | - |
13 | | -This SDK provides convenient access to the [Seam Connect API] for Ruby applications. |
14 | | - |
15 | | -This library includes: |
16 | | - |
17 | | -- A predefined set of classes for API resources that |
18 | | - initialize themselves dynamically from API responses. |
19 | | -- Methods for all [Seam API endpoints](https://docs.seam.co/latest/api-clients/overview). |
20 | | -- Simplified asynchronous flows, e.g., listening for events or actions to finish. |
21 | | - |
22 | | -[Seam API endpoints]: https://docs.seam.co/latest/api-endpoints/overview |
23 | | - |
24 | | -## Installation |
25 | | - |
26 | | -Add this as a dependency to your project using [Bundler] with |
27 | | - |
28 | | -``` |
29 | | -$ bundle add seamapi |
30 | | -``` |
31 | | - |
32 | | -[bundler]: https://bundler.io/ |
33 | | - |
34 | | -## Usage |
35 | | - |
36 | | -_Refer to the [Seam Connect API documentation][Seam Connect API]._ |
37 | | - |
38 | | -### Requirements |
39 | | - |
40 | | -- Ruby version 3 or later. |
41 | | -- An API Key generated via the [Seam Dashboard]. |
42 | | - |
43 | | -[Seam Dashboard]: https://dashboard.getseam.com |
44 | | - |
45 | | -### Example |
46 | | - |
47 | | -```ruby |
48 | | -seam = Seam::Client.new(api_key: "MY_SEAM_API_KEY") |
49 | | -devices = seam.devices.list |
50 | | -my_door = devices.first |
51 | | -seam.locks.unlock(my_door).wait_until_finished |
52 | | -``` |
53 | | - |
54 | | -## Development and Testing |
55 | | - |
56 | | -### Quickstart |
57 | | - |
58 | | -``` |
59 | | -$ git clone https://github.com/seamapi/ruby.git |
60 | | -$ cd ruby |
61 | | -$ bundle install |
62 | | -``` |
63 | | - |
64 | | -Run the command below |
65 | | - |
66 | | -``` |
67 | | -$ bundle exec rake |
68 | | -``` |
69 | | - |
70 | | -Open an interactive ruby console with |
71 | | - |
72 | | -``` |
73 | | -$ bundle exec rake |
74 | | -``` |
75 | | - |
76 | | -Primary development tasks are defined as [rake] tasks in the `Rakefile` |
77 | | -and available via `rake`. |
78 | | -View them with |
79 | | - |
80 | | -``` |
81 | | -$ bundle exec rake -T |
82 | | -``` |
83 | | - |
84 | | -[rake]: https://ruby.github.io/rake/ |
85 | | - |
86 | | -### Interactive Console |
87 | | - |
88 | | -Play around with this module inside an interactive console with |
89 | | - |
90 | | -``` |
91 | | -$ rake console |
92 | | -``` |
93 | | - |
94 | | -Use a sandbox API key to play with the SDK without touching real devices. |
95 | | - |
96 | | -### Source code |
97 | | - |
98 | | -The [source code] is hosted on GitHub. |
99 | | -Clone the project with |
100 | | - |
101 | | -``` |
102 | | -$ git clone [email protected]:seamapi/ruby.git |
103 | | -``` |
104 | | - |
105 | | -[source code]: https://github.com/seamapi/ruby |
106 | | - |
107 | | -### Requirements |
108 | | - |
109 | | -You will need [Ruby] with [Bundler]. |
110 | | - |
111 | | -Be sure that all commands run under the correct Ruby version, e.g., |
112 | | -if using [rbenv], install the correct version with |
113 | | - |
114 | | -``` |
115 | | -$ rbenv install |
116 | | -``` |
117 | | - |
118 | | -Install the development dependencies with |
119 | | - |
120 | | -``` |
121 | | -$ bundle install |
122 | | -``` |
123 | | - |
124 | | -[bundler]: https://bundler.io/ |
125 | | -[ruby]: https://www.ruby-lang.org/ |
126 | | -[rbenv]: https://github.com/rbenv/rbenv |
127 | | - |
128 | | -### Publishing |
129 | | - |
130 | | -Releases are handled automatically by [semantic-release]. |
131 | | -Publishing may be triggered manually using a [workflow_dispatch on GitHub Actions]. |
132 | | - |
133 | | -[semantic-release]: https://semantic-release.gitbook.io/ |
134 | | -[workflow_dispatch on github actions]: https://github.com/seamapi/ruby/actions?query=workflow%3Aversion |
135 | | - |
136 | | -## GitHub Actions |
137 | | - |
138 | | -_GitHub Actions should already be configured: this section is for reference only._ |
139 | | - |
140 | | -The following repository secrets must be set on [GitHub Actions]: |
141 | | - |
142 | | -- `RUBYGEMS_API_KEY`: RubyGems.org token for publishing packages. |
143 | | -- `GH_TOKEN`: A personal access token for the user. |
144 | | -- `GIT_USER_NAME`: The GitHub user's real name. |
145 | | -- `GIT_USER_EMAIL`: The GitHub user's email. |
146 | | -- `GPG_PRIVATE_KEY`: The GitHub user's [GPG private key]. |
147 | | -- `GPG_PASSPHRASE`: The GitHub user's GPG passphrase. |
148 | | - |
149 | | -These are set at the organization level. |
150 | | - |
151 | | -[github actions]: https://github.com/features/actions |
152 | | -[gpg private key]: https://github.com/marketplace/actions/import-gpg#prerequisites |
153 | | - |
154 | | -## Contributing |
155 | | - |
156 | | -Please submit and comment on bug reports and feature requests. |
157 | | - |
158 | | -To submit a patch: |
159 | | - |
160 | | -1. Fork it (https://github.com/seamapi/ruby/fork). |
161 | | -2. Create your feature branch (`git checkout -b my-new-feature`). |
162 | | -3. Make changes. |
163 | | -4. Commit your changes (`git commit -am 'Add some feature'`). |
164 | | -5. Push to the branch (`git push origin my-new-feature`). |
165 | | -6. Create a new Pull Request. |
166 | | - |
167 | | -## License |
168 | | - |
169 | | -This Ruby gem is licensed under the MIT license. |
170 | | - |
171 | | -## Warranty |
172 | | - |
173 | | -This software is provided by the copyright holders and contributors "as is" and |
174 | | -any express or implied warranties, including, but not limited to, the implied |
175 | | -warranties of merchantability and fitness for a particular purpose are |
176 | | -disclaimed. In no event shall the copyright holder or contributors be liable for |
177 | | -any direct, indirect, incidental, special, exemplary, or consequential damages |
178 | | -(including, but not limited to, procurement of substitute goods or services; |
179 | | -loss of use, data, or profits; or business interruption) however caused and on |
180 | | -any theory of liability, whether in contract, strict liability, or tort |
181 | | -(including negligence or otherwise) arising in any way out of the use of this |
182 | | -software, even if advised of the possibility of such damage. |
| 1 | +This package has moved to [seam](https://rubygems.org/gems/seam). |
| 2 | +Please refer to the [migration guide](https://github.com/seamapi/ruby/releases/tag/v2.0.0). |
0 commit comments