nexaas-async-collector 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/controllers/nexaas/async/collector/application_controller.rb +1 -1
- data/app/controllers/nexaas/async/collector/async_resource_controller.rb +1 -1
- data/lib/nexaas/async/collector/in_memory_storage.rb +2 -2
- data/lib/nexaas/async/collector/result.rb +2 -2
- data/lib/nexaas/async/collector/version.rb +1 -1
- data/lib/nexaas/async/collector.rb +23 -8
- metadata +2 -3
- data/lib/nexaas/async/collector/configuration.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f581d99eadd9c89653976bae829da7a41b3cb3e
|
4
|
+
data.tar.gz: f8536ee8f83082febba407dbce62b06ea6c18d2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f18c4347e88fc3386cbacb5deca78c8d5b3626a94917295000d04d747a326ac62cd30d92a924a8e46cab1e36100119b09e5d8832e6cafa52f595be2d8b0304a3
|
7
|
+
data.tar.gz: 40de4e4f4609fed9a47251257e8d4a012f1e223c05a7cd225b938d57288406979aede844f4928d5be72d18661d08e114bb4cb32aaf28d2a3612872ffcc29ebc1
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ $ gem install nexaas-async-collector
|
|
45
45
|
# The namespace where you want to store you data within Redis
|
46
46
|
config.redis_namespace = 'nexaas_async'
|
47
47
|
|
48
|
-
# The method that returns the
|
48
|
+
# The method that returns the user object (or any other object you want. It must respond to id method)
|
49
49
|
config.scope = :current_user
|
50
50
|
|
51
51
|
# The parent class of all nexaas-async-collector controller
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Nexaas
|
2
2
|
module Async
|
3
3
|
module Collector
|
4
|
-
class ApplicationController < Nexaas::Async::Collector.
|
4
|
+
class ApplicationController < Nexaas::Async::Collector.parent_controller.constantize
|
5
5
|
protect_from_forgery with: :exception
|
6
6
|
end
|
7
7
|
end
|
@@ -26,11 +26,11 @@ module Nexaas
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def redis_url
|
29
|
-
Nexaas::Async::Collector.
|
29
|
+
Nexaas::Async::Collector.redis_url
|
30
30
|
end
|
31
31
|
|
32
32
|
def redis_namespace
|
33
|
-
Nexaas::Async::Collector.
|
33
|
+
Nexaas::Async::Collector.redis_namespace
|
34
34
|
end
|
35
35
|
|
36
36
|
end
|
@@ -39,11 +39,11 @@ module Nexaas
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def url
|
42
|
-
Nexaas::Async::Collector.
|
42
|
+
Nexaas::Async::Collector.redis_url
|
43
43
|
end
|
44
44
|
|
45
45
|
def namespace
|
46
|
-
Nexaas::Async::Collector.
|
46
|
+
Nexaas::Async::Collector.redis_namespace
|
47
47
|
end
|
48
48
|
|
49
49
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'redis-namespace'
|
2
2
|
require 'sidekiq'
|
3
3
|
require "nexaas/async/collector/engine"
|
4
|
-
require "nexaas/async/collector/configuration"
|
5
4
|
require "nexaas/async/collector/in_memory_storage"
|
6
5
|
require "nexaas/async/collector/result"
|
7
6
|
require "nexaas/async/collector/persist"
|
@@ -9,15 +8,31 @@ require "nexaas/async/collector/persist"
|
|
9
8
|
module Nexaas
|
10
9
|
module Async
|
11
10
|
module Collector
|
12
|
-
class << self
|
13
|
-
def configure
|
14
|
-
yield(configuration)
|
15
|
-
end
|
16
11
|
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
# Redis URL
|
13
|
+
mattr_accessor :redis_url
|
14
|
+
@@redis_url = ENV.fetch('REDIS_URL') { nil }
|
15
|
+
|
16
|
+
# Namespace used in Redis
|
17
|
+
mattr_accessor :redis_namespace
|
18
|
+
@@redis_namespace = 'nexaas_async'
|
19
|
+
|
20
|
+
# Method will be called to get the user/account id
|
21
|
+
# This ID is used to store and ensure only the user
|
22
|
+
# will fetch the processed data.
|
23
|
+
mattr_accessor :scope
|
24
|
+
@@scope = 'current_user'
|
25
|
+
|
26
|
+
# Parent controller which
|
27
|
+
# Nexaas::Async::Collector::AsynResourceController will
|
28
|
+
# inherit from
|
29
|
+
mattr_accessor :parent_controller
|
30
|
+
@@parent_controller = '::ActionController::Base'
|
31
|
+
|
32
|
+
def self.configure
|
33
|
+
yield self
|
20
34
|
end
|
35
|
+
|
21
36
|
end
|
22
37
|
end
|
23
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexaas-async-collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Hertz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -143,7 +143,6 @@ files:
|
|
143
143
|
- config/locales/pt.yml
|
144
144
|
- config/routes.rb
|
145
145
|
- lib/nexaas/async/collector.rb
|
146
|
-
- lib/nexaas/async/collector/configuration.rb
|
147
146
|
- lib/nexaas/async/collector/engine.rb
|
148
147
|
- lib/nexaas/async/collector/in_memory_storage.rb
|
149
148
|
- lib/nexaas/async/collector/persist.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Nexaas
|
2
|
-
module Async
|
3
|
-
module Collector
|
4
|
-
class Configuration
|
5
|
-
attr_accessor :redis_url, :redis_namespace, :scope, :parent_controller
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
@redis_url = ENV.fetch('REDIS_URL') { nil }
|
9
|
-
@redis_namespace = 'nexaas_async'
|
10
|
-
@scope = :current_user
|
11
|
-
@parent_controller = '::ActionController::Base'
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|