nexaas-async-collector 1.0.1 → 1.0.2

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: cf7d40a0d6f372c5eb52f1a7146c9792024a94ea
4
- data.tar.gz: '0548da7ee88fa6c5b27b5460fefd9754ffb48d58'
3
+ metadata.gz: 1f581d99eadd9c89653976bae829da7a41b3cb3e
4
+ data.tar.gz: f8536ee8f83082febba407dbce62b06ea6c18d2b
5
5
  SHA512:
6
- metadata.gz: 934bf8e6731e278964371bffdca6621c7f035ab0c2c70123e7d76aa2e124bbbe7c00826f465d6efba1f749c1c2d45a24c410424ccf421ee92011cbad52537984
7
- data.tar.gz: 975fa2668eb4ba2fcf77bf33d6d89b553e4e7fcbc11a22569c257985aa0633ff79c2e597717a3d2e1e4fc59b353f84467123327c61524531f354e1ac8f291574
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 use robject (or anyother object you want. It must respond to id method)
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.configuration.parent_controller.constantize
4
+ class ApplicationController < Nexaas::Async::Collector.parent_controller.constantize
5
5
  protect_from_forgery with: :exception
6
6
  end
7
7
  end
@@ -10,7 +10,7 @@ module Nexaas
10
10
  private
11
11
 
12
12
  def nexaas_async_collector_scope
13
- Nexaas::Async::Collector.configuration.scope
13
+ Nexaas::Async::Collector.scope
14
14
  end
15
15
 
16
16
  def collector_scope
@@ -26,11 +26,11 @@ module Nexaas
26
26
  end
27
27
 
28
28
  def redis_url
29
- Nexaas::Async::Collector.configuration.redis_url
29
+ Nexaas::Async::Collector.redis_url
30
30
  end
31
31
 
32
32
  def redis_namespace
33
- Nexaas::Async::Collector.configuration.redis_namespace
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.configuration.redis_url
42
+ Nexaas::Async::Collector.redis_url
43
43
  end
44
44
 
45
45
  def namespace
46
- Nexaas::Async::Collector.configuration.redis_namespace
46
+ Nexaas::Async::Collector.redis_namespace
47
47
  end
48
48
 
49
49
  end
@@ -1,7 +1,7 @@
1
1
  module Nexaas
2
2
  module Async
3
3
  module Collector
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
6
6
  end
7
7
  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
- def configuration
18
- @configuration ||= Configuration.new
19
- end
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.1
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-07 00:00:00.000000000 Z
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