asyncapi-client 0.4.0 → 0.5.0

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
  SHA1:
3
- metadata.gz: b83f99d3d3eeda201dc5fafbe092ee3a19f6577d
4
- data.tar.gz: 658a32124445648fbda873da5466cab39e023ad6
3
+ metadata.gz: f8f0c459111eb7270486b2b9cd41c811d6ec8fda
4
+ data.tar.gz: 2bd5e7375adc86a910b63832c7d702f4a03e1c70
5
5
  SHA512:
6
- metadata.gz: ae91d6f8ba6eb77d11d0965e1073865019bdfec05deba9742e5e65137a03eb54e9e7aa25aa65f75493a18f257439bf554d5fe52e57d1765672b63f6ef22f4c34
7
- data.tar.gz: 4f76f7f0026fd3a1a577f037c0662cca5683f2565c28bc2b1731d02c34123b35c393b4bbfbdb3d3ef18986b9c3ee18d4f5b423477114e580bd40f8367798c114
6
+ metadata.gz: a317e387d9c38c7f0fa2ad1f7e6aebcbf2b4c40c37ee8828ac5ebf4b7ede618bf2070d69c4997e0c91edb4137674136928149f119005e40fdd42256103f5a877
7
+ data.tar.gz: 44f4b7b73c6c1bf28aad6ea32b414183225d9ee7779d7c38783dd892bfe94c24fc9da036175616f9d883dbaad0865d85945525a97f16572b11bea0518a86de2b
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2014 G5Search
1
+ Copyright 2016 G5Search
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -36,7 +36,7 @@ class DoOnQueue < Asyncapi::Client::CallbackRunner
36
36
  end
37
37
 
38
38
  class DoOnSuccess < Asyncapi::Client::CallbackRunner
39
- def self.call
39
+ def call
40
40
  Rails.logger.info "Job##{job.id} is done. The server's response: #{job.message}"
41
41
  end
42
42
  end
@@ -135,13 +135,20 @@ If you use FactoryGirl, you can require the factories for easy testing and stubb
135
135
  require "asyncapi/client/factories"
136
136
  ```
137
137
 
138
- ## Security
138
+ # Security
139
139
 
140
140
  `asyncapi-client` generates a secret for the job using `SecureRandom.uuid`, and sends this to the app using `asyncapi-server`. The server app, using the latest compatible gem, will reply with the secret in the params. `asyncapi-client` will make sure the job id matches with the given secret.
141
141
 
142
- ## License
142
+ # Development
143
+
144
+ ```
145
+ rake app:db:schema:load
146
+ rspec spec
147
+ ```
148
+
149
+ # License
143
150
 
144
- Copyright (c) 2014 G5
151
+ Copyright (c) 2016 G5
145
152
 
146
153
  MIT License
147
154
 
@@ -1,7 +1,6 @@
1
1
  module Asyncapi::Client
2
2
  module V1
3
3
  class JobsController < Asyncapi::Client.parent_controller
4
- respond_to :json
5
4
 
6
5
  def index
7
6
  jobs = Job.all
@@ -11,7 +10,7 @@ module Asyncapi::Client
11
10
  def update
12
11
  if job = Job.find_by(id: params[:id], secret: params[:job][:secret])
13
12
  UpdateJob.execute(job: job, params: job_params)
14
- respond_with job
13
+ render json: job
15
14
  else
16
15
  render nothing: true, status: 403
17
16
  end
@@ -1,7 +1,7 @@
1
1
  module Asyncapi::Client
2
2
  class UpdateJob
3
3
 
4
- def self.execute(job: job, params: params)
4
+ def self.execute(job:, params:)
5
5
  sanitized_params = params.reject { |key, value| key.to_sym == :status }
6
6
  job.assign_attributes(sanitized_params)
7
7
  status = params[:status]
@@ -15,7 +15,7 @@ module Asyncapi::Client
15
15
  def perform(job_id)
16
16
  job = Job.find(job_id)
17
17
  callback_method = STATUS_CALLBACK_MAP[job.status]
18
- return unless job.respond_to?(callback_method)
18
+ return if callback_method.nil?
19
19
  class_name = job.send(callback_method)
20
20
  begin
21
21
  callback_class = class_name.constantize
@@ -1,5 +1,5 @@
1
1
  module Asyncapi
2
2
  module Client
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asyncapi-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - G5
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-09-24 00:00:00.000000000 Z
13
+ date: 2016-03-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - "~>"
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: 4.1.5
21
+ version: '4.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - "~>"
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 4.1.5
28
+ version: '4.0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: sidekiq
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  version: '0'
281
281
  requirements: []
282
282
  rubyforge_project:
283
- rubygems_version: 2.4.7
283
+ rubygems_version: 2.5.1
284
284
  signing_key:
285
285
  specification_version: 4
286
286
  summary: Asynchronous API communication