Skip to content

Commit c14563b

Browse files
committed
Maintenance: Update docs.
1 parent 9ce2f31 commit c14563b

1 file changed

Lines changed: 40 additions & 24 deletions

File tree

README.md

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Or install it yourself as:
3131

3232
## Usage
3333

34-
### create instance
34+
### Create instance
3535

36-
#### username/email and password
36+
#### Username/email and password
3737

3838
```ruby
3939
client = ZammadAPI::Client.new(
@@ -43,7 +43,7 @@ client = ZammadAPI::Client.new(
4343
)
4444
```
4545

46-
#### access token
46+
#### Access token
4747

4848
```ruby
4949
client = ZammadAPI::Client.new(
@@ -65,9 +65,9 @@ client = ZammadAPI::Client.new(
6565

6666
Individual resources can be created, modified, saved, and destroyed.
6767

68-
### create object
68+
### Create object
6969

70-
with new and save
70+
With new and save:
7171
```ruby
7272
group = client.group.new(
7373
name: 'Support',
@@ -79,7 +79,7 @@ group.id # id of record
7979
group.name # 'Support'
8080
```
8181

82-
with create
82+
With create:
8383
```ruby
8484
group = client.group.create(
8585
name: 'Support',
@@ -90,21 +90,21 @@ group.id # id of record
9090
group.name # 'Support'
9191
```
9292

93-
### fetch object
93+
### Fetch object
9494

9595
```ruby
9696
group = client.group.find(123)
9797
puts group.inspect
9898
```
99-
### update object
99+
### Update object
100100

101101
```ruby
102102
group = client.group.find(123)
103103
group.name = 'Support 2'
104104
group.save
105105
```
106106

107-
### destroy object
107+
### Destroy object
108108

109109
```ruby
110110
group = client.group.find(123)
@@ -115,7 +115,7 @@ group.destroy
115115

116116
A list of individual resources.
117117

118-
### all
118+
### All
119119

120120
```ruby
121121
groups = client.group.all
@@ -129,7 +129,7 @@ groups.each {|group|
129129
}
130130
```
131131

132-
### search
132+
### Search
133133
```ruby
134134
groups = client.group.search(query: 'some name')
135135

@@ -142,7 +142,7 @@ groups.each {|group|
142142
}
143143
```
144144

145-
### all with pagination (beta)
145+
### All with pagination (beta)
146146

147147
```ruby
148148
groups = client.group.all
@@ -162,7 +162,7 @@ groups.page(2,3) {|group|
162162
}
163163
```
164164

165-
### search with pagination (beta)
165+
### Search with pagination (beta)
166166
```ruby
167167
groups = client.group.search(query: 'some name')
168168

@@ -181,7 +181,7 @@ groups.page(2,3) {|group|
181181
}
182182
```
183183

184-
## perform actions on behalf of other user
184+
## Perform actions on behalf of another user
185185

186186
As described in the [Zammad API documentation](https://docs.zammad.org/en/latest/api-intro.html#example-curl-request-on-behalf-of-a-different-user) it is possible to perfom actions on behalf other users. To use this feature you can set the attribute of the client accordingly:
187187

@@ -213,7 +213,7 @@ end
213213

214214
## Examples
215215

216-
create ticket
216+
Create a ticket:
217217
```ruby
218218
ticket = client.ticket.create(
219219
title: 'a new ticket #1',
@@ -241,7 +241,7 @@ ticket.created_at # '2022-01-01T12:42:01Z'
241241
# ...
242242
```
243243

244-
list of all new or open
244+
List all new or open tickets:
245245
```ruby
246246
tickets = client.ticket.search(query: 'state:new OR state:open')
247247

@@ -256,7 +256,7 @@ tickets.each {|ticket|
256256
}
257257
```
258258

259-
get all articles of a ticket
259+
Get all articles of a ticket:
260260
```ruby
261261
ticket = client.ticket.find(123)
262262
articles = ticket.articles
@@ -277,7 +277,7 @@ articles.each {|article|
277277
}
278278
```
279279

280-
create an article for a ticket
280+
Create an article for a ticket:
281281
```ruby
282282
ticket = client.ticket.find(123)
283283

@@ -312,7 +312,7 @@ article.attachments.each { |attachment|
312312
p "article: #{article.from} - #{article.subject}"
313313
```
314314

315-
create an article with html and inline images for a ticket
315+
Create an article with html and inline images for a ticket:
316316
```ruby
317317
ticket = client.ticket.find(123)
318318

@@ -344,7 +344,7 @@ p "article: #{article.from} - #{article.subject}"
344344

345345
## Testing
346346

347-
### setup an (empty Zammad) test env
347+
### Setup an (empty Zammad) test env
348348

349349
```
350350
git clone git@github.com:zammad/zammad.git
@@ -356,17 +356,33 @@ cp contrib/auto_wizard_test.json auto_wizard.json
356356
bundle exec rake zammad:ci:test:start
357357
```
358358

359-
### execute client tests
359+
### Execute client tests
360360

361361
Run tests via `rake spec`. (Remember to export the vars above if you are running this in another shell.)
362362

363363
## Publishing
364364

365+
1. Update version in [version.rb](lib/zammad_api/version.rb).
366+
2. Add release to [CHANGELOG.md](CHANGELOG.md)
367+
3. Commit.
368+
4. Test build.
365369
```
366-
gem build -o pkg/zammad_api-1.0.6.gem zammad_api.gemspec
367-
gem push pkg/zammad_api-1.0.6.gem
370+
> rake build
371+
zammad_api 1.0.7 built to pkg/zammad_api-1.0.7.gem.
372+
```
373+
5. Release
374+
```
375+
> rake release
376+
zammad_api 1.0.7 built to pkg/zammad_api-1.0.7.gem.
377+
Tag v1.0.7 has already been created.
378+
Pushing gem to https://rubygems.org...
379+
You have enabled multi-factor authentication. Please enter OTP code.
380+
Code: ......
381+
Successfully registered gem: zammad_api (1.0.7)
382+
Pushed zammad_api 1.0.7 to https://rubygems.org
383+
368384
```
369385

370386
## Contributing
371387

372-
Bug reports and pull requests are welcome on GitHub at https://github.com/zammad/zammad-api-client-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
388+
Bug reports and pull requests are welcome on [GitHub](https://github.com/zammad/zammad-api-client-ruby). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

0 commit comments

Comments
 (0)