logux_rails 0.1.0 → 0.2.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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/Appraisals +4 -0
  4. data/CHANGELOG.md +13 -0
  5. data/Gemfile +3 -0
  6. data/README.md +7 -2
  7. data/app/helpers/logux_helper.rb +1 -2
  8. data/config/routes.rb +1 -1
  9. data/lib/logux/{actions.rb → action.rb} +1 -1
  10. data/lib/logux/model/proxy.rb +1 -1
  11. data/lib/logux/model/updates_deprecator.rb +12 -8
  12. data/lib/logux/version.rb +1 -1
  13. data/lib/logux_rails.rb +22 -1
  14. data/lib/tasks/logux_tasks.rake +10 -37
  15. data/logux_rails.gemspec +3 -6
  16. metadata +14 -77
  17. data/app/controllers/logux_controller.rb +0 -41
  18. data/lib/logux.rb +0 -107
  19. data/lib/logux/action_caller.rb +0 -42
  20. data/lib/logux/action_controller.rb +0 -6
  21. data/lib/logux/add.rb +0 -37
  22. data/lib/logux/auth.rb +0 -6
  23. data/lib/logux/base_controller.rb +0 -37
  24. data/lib/logux/channel_controller.rb +0 -24
  25. data/lib/logux/class_finder.rb +0 -61
  26. data/lib/logux/client.rb +0 -21
  27. data/lib/logux/error_renderer.rb +0 -40
  28. data/lib/logux/meta.rb +0 -36
  29. data/lib/logux/node.rb +0 -37
  30. data/lib/logux/policy.rb +0 -14
  31. data/lib/logux/policy_caller.rb +0 -34
  32. data/lib/logux/process.rb +0 -9
  33. data/lib/logux/process/action.rb +0 -60
  34. data/lib/logux/process/auth.rb +0 -27
  35. data/lib/logux/process/batch.rb +0 -59
  36. data/lib/logux/response.rb +0 -18
  37. data/lib/logux/stream.rb +0 -25
  38. data/lib/logux/test.rb +0 -35
  39. data/lib/logux/test/helpers.rb +0 -75
  40. data/lib/logux/test/matchers.rb +0 -10
  41. data/lib/logux/test/matchers/base.rb +0 -25
  42. data/lib/logux/test/matchers/response_chunks.rb +0 -48
  43. data/lib/logux/test/matchers/send_to_logux.rb +0 -51
  44. data/lib/logux/test/store.rb +0 -21
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base'
4
-
5
- module Logux
6
- module Test
7
- module Matchers
8
- class SendToLogux < Base
9
- def matches?(actual)
10
- @difference = state_changes_inside { actual.call }
11
- return !@difference.empty? if expected.empty?
12
-
13
- expected.all? do |ex|
14
- @difference.find do |state|
15
- state['commands'].any? do |c|
16
- match_commands?(c, ex)
17
- end
18
- end
19
- end
20
- end
21
-
22
- def failure_message
23
- "expected that #{pretty(@difference)} to include "\
24
- "commands #{pretty(expected)}"
25
- end
26
-
27
- private
28
-
29
- def state_changes_inside
30
- before_state = Logux::Test::Store.instance.data.dup
31
- yield
32
- after_state = Logux::Test::Store.instance.data
33
-
34
- (after_state - before_state).map { |d| JSON.parse(d) }
35
- end
36
-
37
- def match_commands?(stored_command, expected_command)
38
- expected_command.each_with_index.all? do |part, index|
39
- part.stringify_keys! if part.is_a?(Hash)
40
- matcher = if part.is_a?(RSpec::Matchers::BuiltIn::BaseMatcher)
41
- part
42
- else
43
- RSpec::Matchers::BuiltIn::Eq.new(part)
44
- end
45
- matcher.matches?(stored_command[index])
46
- end
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Logux
4
- module Test
5
- class Store
6
- include Singleton
7
-
8
- def add(params)
9
- data << params
10
- end
11
-
12
- def data
13
- @data ||= []
14
- end
15
-
16
- def reset!
17
- @data = []
18
- end
19
- end
20
- end
21
- end