totoro 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8a3d545d257843e061c07ced9defa1da81b9152046433b6595abb7745f2cf92
4
- data.tar.gz: c80f3d65b173af4cc8fbc52c264de04afce72379c509b557083066a25e09e2f5
3
+ metadata.gz: f1bd582f2fffa08dd029c8d11c77552868322cc8f71bd92f18880966362d70ab
4
+ data.tar.gz: 0deb992d109d947d598de595b50e3e1f09fcee10e178ac6921ef3d1761aaec9c
5
5
  SHA512:
6
- metadata.gz: 24d012083e63c863e7651d6268cf7372ea6fb79bd253fb622321a90cc68d0ae66239f5c1c0014cb2a885dff512ff903f568453d4487ad5971e57d009532abd1b
7
- data.tar.gz: 5cfd29b9ce643f998d70b4cb791bf2d62d061771cf906e8d429dd2511b3d2bb65e13be1c45723e733f353a31e60225207a966c703678e785885f826c72430ae2
6
+ metadata.gz: 54f94fdc1deee3e4c2a92eea73ddf8e406989210f95989e19ced9f3f95101d3265fd310a5ebc882cefdc89abcadca079e0a6b5e0a60c5a0d0d5d051100fd76f3
7
+ data.tar.gz: ebc2e7d9c63fb256b2c7572c60fc284a63016e96327ae93c52a7f45447c761d5c714d8fef1fa0752e7b44ba2f763dc58c4d162ccf2e7980d4622a1a55eb62693
data/README.md CHANGED
@@ -1,11 +1,10 @@
1
- # Totoro
1
+ # Totoro, a RabbitMQ Util
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/totoro`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Totoro is a RabbitMQ util that focuses on samplify queue operation.
6
4
 
7
5
  ## Installation
8
6
 
7
+ #### Install gem
9
8
  Add this line to your application's Gemfile:
10
9
 
11
10
  ```ruby
@@ -16,23 +15,43 @@ And then execute:
16
15
 
17
16
  $ bundle
18
17
 
19
- Or install it yourself as:
20
-
21
- $ gem install totoro
22
-
23
- ## Usage
18
+ #### Generate configuration file
19
+ ```
20
+ rails g totoro:config
21
+ ```
24
22
 
25
- TODO: Write usage instructions here
23
+ ## Quick Start
26
24
 
27
- ## Development
25
+ #### Enqueue
26
+ ```
27
+ Totoro::Queue.enqueue('queue', payload)
28
+ ```
28
29
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+ #### Dequeue
31
+ To create a dequeue daemon, first you need to create a worker
32
+ ```
33
+ rails g totoro:wroker <worker_name> <queue_name>
34
+ ```
35
+ after that, add business logic in the process method
36
+ ```
37
+ module Worker
38
+ class WorkerClass
39
+ QUEUE = 'queue_name'
40
+ def process(payload, _metadata, _delivery_info)
41
+ # worker process
42
+ end
43
+ end
44
+ end
45
+ ```
46
+ finally, run the background deamon
47
+ ```
48
+ bundle exec totoro worker_class
49
+ ```
30
50
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
51
 
33
52
  ## Contributing
34
53
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/totoro. 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.
54
+ Bug reports and pull requests are welcome on GitHub at https://github.com/blockchaintech-au/totoro. 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.
36
55
 
37
56
  ## License
38
57
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Worker
4
4
  class <%= name.camelcase %>
5
- QUEUE = '<%= queue || name.underscore %>'
5
+ QUEUE = '<%= queue || name.underscore %>'.freeze
6
6
  def process(payload, _metadata, _delivery_info)
7
7
  # worker process
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Totoro
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totoro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShuHui18
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-29 00:00:00.000000000 Z
11
+ date: 2018-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,6 +77,8 @@ files:
77
77
  - lib/totoro/queue.rb
78
78
  - lib/totoro/version.rb
79
79
  - pkg/totoro-0.1.1.gem
80
+ - pkg/totoro-0.1.2.gem
81
+ - pkg/totoro-0.1.3.gem
80
82
  - spec/spec_helper.rb
81
83
  - spec/totoro_spec.rb
82
84
  - totoro.gemspec