celluloid 0.17.2 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES.md +340 -75
  3. data/CONDUCT.md +13 -0
  4. data/CONTRIBUTING.md +39 -0
  5. data/LICENSE.txt +1 -1
  6. data/README.md +54 -150
  7. data/REFACTOR.md +1 -0
  8. data/architecture.md +120 -0
  9. data/examples/basic_usage.rb +1 -1
  10. data/examples/configurations.rb +78 -0
  11. data/examples/futures.rb +1 -1
  12. data/examples/ring.rb +5 -4
  13. data/examples/simple_pmap.rb +1 -1
  14. data/examples/stack.rb +2 -2
  15. data/examples/supervisors_and_registry.rb +82 -0
  16. data/examples/timers.rb +2 -2
  17. data/lib/celluloid.rb +78 -65
  18. data/lib/celluloid/actor.rb +27 -17
  19. data/lib/celluloid/actor/system.rb +13 -29
  20. data/lib/celluloid/autostart.rb +6 -1
  21. data/lib/celluloid/call/async.rb +2 -0
  22. data/lib/celluloid/call/sync.rb +10 -3
  23. data/lib/celluloid/calls.rb +13 -13
  24. data/lib/celluloid/cell.rb +5 -9
  25. data/lib/celluloid/condition.rb +3 -3
  26. data/lib/celluloid/core_ext.rb +0 -2
  27. data/lib/celluloid/debug.rb +3 -0
  28. data/lib/celluloid/exceptions.rb +2 -2
  29. data/lib/celluloid/future.rb +8 -10
  30. data/lib/celluloid/group.rb +16 -6
  31. data/lib/celluloid/group/pool.rb +1 -3
  32. data/lib/celluloid/group/spawner.rb +2 -6
  33. data/lib/celluloid/internals/call_chain.rb +15 -0
  34. data/lib/celluloid/internals/cpu_counter.rb +62 -0
  35. data/lib/celluloid/internals/handlers.rb +42 -0
  36. data/lib/celluloid/internals/links.rb +38 -0
  37. data/lib/celluloid/internals/logger.rb +104 -0
  38. data/lib/celluloid/internals/method.rb +34 -0
  39. data/lib/celluloid/internals/properties.rb +32 -0
  40. data/lib/celluloid/internals/receivers.rb +64 -0
  41. data/lib/celluloid/internals/registry.rb +102 -0
  42. data/lib/celluloid/internals/responses.rb +46 -0
  43. data/lib/celluloid/internals/signals.rb +24 -0
  44. data/lib/celluloid/internals/stack.rb +74 -0
  45. data/lib/celluloid/internals/stack/dump.rb +12 -0
  46. data/lib/celluloid/internals/stack/states.rb +72 -0
  47. data/lib/celluloid/internals/stack/summary.rb +12 -0
  48. data/lib/celluloid/internals/task_set.rb +51 -0
  49. data/lib/celluloid/internals/thread_handle.rb +52 -0
  50. data/lib/celluloid/internals/uuid.rb +40 -0
  51. data/lib/celluloid/logging/incident.rb +21 -0
  52. data/lib/celluloid/logging/incident_logger.rb +147 -0
  53. data/lib/celluloid/logging/incident_reporter.rb +49 -0
  54. data/lib/celluloid/logging/log_event.rb +20 -0
  55. data/lib/celluloid/logging/ring_buffer.rb +64 -0
  56. data/lib/celluloid/mailbox.rb +22 -9
  57. data/lib/celluloid/mailbox/evented.rb +13 -7
  58. data/lib/celluloid/notifications.rb +95 -0
  59. data/lib/celluloid/pool.rb +6 -0
  60. data/lib/celluloid/probe.rb +81 -0
  61. data/lib/celluloid/proxy/abstract.rb +38 -7
  62. data/lib/celluloid/proxy/actor.rb +0 -5
  63. data/lib/celluloid/proxy/async.rb +2 -18
  64. data/lib/celluloid/proxy/block.rb +2 -1
  65. data/lib/celluloid/proxy/cell.rb +1 -7
  66. data/lib/celluloid/proxy/future.rb +3 -21
  67. data/lib/celluloid/proxy/sync.rb +2 -20
  68. data/lib/celluloid/rspec.rb +22 -34
  69. data/lib/celluloid/supervision.rb +17 -0
  70. data/lib/celluloid/supervision/configuration.rb +169 -0
  71. data/lib/celluloid/supervision/configuration/injections.rb +8 -0
  72. data/lib/celluloid/supervision/configuration/instance.rb +113 -0
  73. data/lib/celluloid/supervision/constants.rb +123 -0
  74. data/lib/celluloid/supervision/container.rb +144 -0
  75. data/lib/celluloid/supervision/container/behavior.rb +89 -0
  76. data/lib/celluloid/supervision/container/behavior/pool.rb +71 -0
  77. data/lib/celluloid/supervision/container/behavior/tree.rb +23 -0
  78. data/lib/celluloid/supervision/container/injections.rb +8 -0
  79. data/lib/celluloid/supervision/container/instance.rb +116 -0
  80. data/lib/celluloid/supervision/container/pool.rb +210 -0
  81. data/lib/celluloid/supervision/service.rb +27 -0
  82. data/lib/celluloid/supervision/supervise.rb +34 -0
  83. data/lib/celluloid/supervision/validation.rb +40 -0
  84. data/lib/celluloid/supervision/version.rb +5 -0
  85. data/lib/celluloid/system_events.rb +10 -3
  86. data/lib/celluloid/task.rb +25 -12
  87. data/lib/celluloid/task/fibered.rb +6 -2
  88. data/lib/celluloid/task/threaded.rb +3 -3
  89. data/lib/celluloid/test.rb +5 -2
  90. data/lib/celluloid/thread.rb +0 -2
  91. data/lib/celluloid/version.rb +1 -1
  92. data/spec/celluloid/block_spec.rb +29 -32
  93. data/spec/celluloid/calls_spec.rb +5 -15
  94. data/spec/celluloid/future_spec.rb +7 -1
  95. data/spec/celluloid/internals/cpu_counter_spec.rb +129 -0
  96. data/spec/celluloid/internals/links_spec.rb +43 -0
  97. data/spec/celluloid/internals/properties_spec.rb +40 -0
  98. data/spec/celluloid/internals/registry_spec.rb +62 -0
  99. data/spec/celluloid/internals/stack/dump_spec.rb +4 -0
  100. data/spec/celluloid/internals/stack/summary_spec.rb +4 -0
  101. data/spec/celluloid/internals/thread_handle_spec.rb +60 -0
  102. data/spec/celluloid/internals/uuid_spec.rb +9 -0
  103. data/spec/celluloid/logging/ring_buffer_spec.rb +36 -0
  104. data/spec/celluloid/mailbox/evented_spec.rb +21 -19
  105. data/spec/celluloid/misc/leak_spec.rb +3 -4
  106. data/spec/celluloid/notifications_spec.rb +140 -0
  107. data/spec/celluloid/probe_spec.rb +102 -0
  108. data/spec/celluloid/proxy_spec.rb +33 -0
  109. data/spec/celluloid/supervision/behavior_spec.rb +74 -0
  110. data/spec/celluloid/supervision/configuration_spec.rb +181 -0
  111. data/spec/celluloid/supervision/container_spec.rb +72 -0
  112. data/spec/celluloid/supervision/instance_spec.rb +13 -0
  113. data/spec/celluloid/supervision/root_spec.rb +28 -0
  114. data/spec/celluloid/supervision/supervisor_spec.rb +93 -0
  115. data/spec/celluloid/task/fibered_spec.rb +1 -3
  116. data/spec/celluloid/task/threaded_spec.rb +1 -3
  117. data/spec/shared/actor_examples.rb +65 -29
  118. data/spec/shared/group_examples.rb +2 -2
  119. data/spec/shared/mailbox_examples.rb +1 -1
  120. data/spec/shared/stack_examples.rb +87 -0
  121. data/spec/shared/task_examples.rb +2 -3
  122. data/spec/spec_helper.rb +2 -4
  123. data/spec/support/configure_rspec.rb +3 -4
  124. data/spec/support/coverage.rb +2 -4
  125. data/spec/support/crash_checking.rb +2 -2
  126. data/spec/support/examples/actor_class.rb +3 -8
  127. data/spec/support/examples/call_class.rb +2 -2
  128. data/spec/support/examples/container_class.rb +35 -0
  129. data/spec/support/examples/evented_mailbox_class.rb +1 -2
  130. data/spec/support/examples/stack_classes.rb +58 -0
  131. data/spec/support/examples/stack_methods.rb +23 -0
  132. data/spec/support/examples/subordinate_class.rb +19 -0
  133. data/spec/support/logging.rb +3 -34
  134. data/spec/support/loose_threads.rb +3 -24
  135. data/spec/support/reset_class_variables.rb +5 -1
  136. data/spec/support/stubbing.rb +1 -1
  137. metadata +93 -291
  138. data/culture/CONDUCT.md +0 -28
  139. data/culture/Gemfile +0 -9
  140. data/culture/LICENSE.txt +0 -22
  141. data/culture/README.md +0 -22
  142. data/culture/Rakefile +0 -5
  143. data/culture/SYNC.md +0 -70
  144. data/culture/celluloid-culture.gemspec +0 -18
  145. data/culture/gems/README.md +0 -39
  146. data/culture/gems/dependencies.yml +0 -85
  147. data/culture/gems/loader.rb +0 -101
  148. data/culture/rubocop/README.md +0 -38
  149. data/culture/rubocop/lint.yml +0 -8
  150. data/culture/rubocop/metrics.yml +0 -15
  151. data/culture/rubocop/perf.yml +0 -0
  152. data/culture/rubocop/rubocop.yml +0 -5
  153. data/culture/rubocop/style.yml +0 -57
  154. data/culture/spec/gems_spec.rb +0 -2
  155. data/culture/spec/spec_helper.rb +0 -0
  156. data/culture/spec/sync_spec.rb +0 -2
  157. data/culture/sync.rb +0 -56
  158. data/culture/tasks/rspec.rake +0 -5
  159. data/culture/tasks/rubocop.rake +0 -2
  160. data/lib/celluloid/actor/manager.rb +0 -7
  161. data/lib/celluloid/backported.rb +0 -2
  162. data/lib/celluloid/current.rb +0 -2
  163. data/lib/celluloid/deprecate.rb +0 -21
  164. data/lib/celluloid/fiber.rb +0 -32
  165. data/lib/celluloid/managed.rb +0 -3
  166. data/lib/celluloid/notices.rb +0 -15
  167. data/spec/celluloid/actor/manager_spec.rb +0 -0
  168. data/spec/deprecate/actor_system_spec.rb +0 -72
  169. data/spec/deprecate/block_spec.rb +0 -52
  170. data/spec/deprecate/calls_spec.rb +0 -39
  171. data/spec/deprecate/evented_mailbox_spec.rb +0 -34
  172. data/spec/deprecate/future_spec.rb +0 -32
  173. data/spec/deprecate/internal_pool_spec.rb +0 -4
  174. data/spec/support/env.rb +0 -21
@@ -1,28 +0,0 @@
1
- # Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, we pledge to respect all
4
- people who contribute through reporting issues, posting feature requests,
5
- updating documentation, submitting pull requests or patches, and other
6
- activities.
7
-
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, age, or religion.
12
-
13
- Examples of unacceptable behavior by participants include the use of sexual
14
- language or imagery, derogatory comments or personal attacks, trolling, public
15
- or private harassment, insults, or other unprofessional conduct.
16
-
17
- Project maintainers have the right and responsibility to remove, edit, or
18
- reject comments, commits, code, wiki edits, issues, and other contributions
19
- that are not aligned to this Code of Conduct. Project maintainers who do not
20
- follow the Code of Conduct may be removed from the project team.
21
-
22
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
23
- reported by opening an issue or contacting one or more of the project
24
- maintainers.
25
-
26
- This Code of Conduct is adapted from the [Contributor Covenant](http
27
- :contributor-covenant.org), version 1.0.0, available at [http://contributor-
28
- covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
@@ -1,9 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- group :development, :test do
4
- gem "rubocop"
5
- gem "rspec"
6
- gem "rake"
7
- end
8
-
9
- gemspec
@@ -1,22 +0,0 @@
1
- Copyright (c) 2012 Tony Arcieri, Donovan Keme
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,22 +0,0 @@
1
- Celluloid::Culture
2
- ==================
3
- [![Build Status](https://travis-ci.org/celluloid/culture.svg)](https://travis-ci.org/celluloid/culture)
4
-
5
- ### Please see...
6
- * Important [issues for discussion](/celluloid/culture/issues).
7
- * Information about [Celluloid::Sync](SYNC.md).
8
- * Information about [RuboCop](rubocop/README.md).
9
-
10
-
11
- ## Integration
12
- To add `celluloid/culture` and its many splendors to a gem, install it as a sub-module of the gem repository. Once you fully integrate [`Celluloid::Sync`](SYNC.md), the sub-module will be automatically refreshed.
13
-
14
- ##### Add celluloid/culture as GIT submodule:
15
- ```sh
16
- git submodule add http://github.com/celluloid/culture.git
17
- ```
18
-
19
- Make sure `http://` is used and no other method of inclusion. CI needs it to be `http://`
20
-
21
- ### Then what?
22
- Once you've done that, read up on [Celluloid::Sync](SYNC.md) and [RuboCop](rubocop/README.md).
@@ -1,5 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
3
- Dir["tasks/**/*.rake"].each { |task| load task }
4
-
5
- task default: "rubocop"
@@ -1,70 +0,0 @@
1
- # Celluloid::Sync
2
-
3
- The `celluloid/culture` sub-module needs to be updated in ever repository which uses it, and integrations between all the gems in Celluloid's core suite began to need greater efficiency in handling many gems at once. This lead to the birth of `Celluloid::Sync` and its automation of several otherwise tedious tasks.
4
-
5
-
6
- ## When all is said and done...
7
-
8
- Running `bundle` or `rspec` will trigger `Celluloid::Sync` automatically, without slowing you down.
9
-
10
- ---
11
-
12
- ## So what does it do?
13
-
14
- **1. It adds the gem you're in to the `$LOADPATH`.**
15
-
16
- **2. It tries to find the `VERSION` constant for the current gem and load it.**
17
-
18
- This allows easy inclusion of `VERSION` in gemspec, without individually including the required file first.
19
-
20
- **3. It updates the `celluloid/culture` sub-module.**
21
-
22
- Whenever `bundle` is run, the `culture/` directory is synchronized with the repository before it's used any further.
23
-
24
- **4. It keeps `Gemfile` and `gemspec` requirements up to date.**
25
-
26
- Avoid circular dependency errors, but still have the power to use locally sourced repositories.
27
-
28
- ---
29
-
30
- ## How is it installed in `Gemfile` and `gemspec` then?
31
-
32
- Add the line above to the top of both files, before everything else:
33
-
34
-
35
- ```ruby
36
- require File.expand_path("../culture/sync", __FILE__)
37
- ```
38
-
39
-
40
- #### Finishing off `gemspec` ...
41
-
42
- You only have one other line to add, other than line above ... right before the closing `end` in the file:
43
-
44
- ```ruby
45
- require File.expand_path("../culture/sync", __FILE__)
46
- Gem::Specification.new do |gem|
47
- # ...
48
- # ...
49
- # Keep in mind, the VERSION constant of this gem ought to be loaded.
50
- # ...
51
- # ...
52
- Celluloid::Sync.gems(gem)
53
- end
54
-
55
- ```
56
-
57
- #### Finishing off `Gemfile` ...
58
-
59
- Same as in `gemspec` you have only two bits to add. The second line we're adding goes at the very end, or at least after `gemspec` is called:
60
-
61
- ```ruby
62
- require File.expand_path("../culture/sync", __FILE__)
63
-
64
- # ...
65
- # below any calls to `gemspec`
66
- # below any other gems
67
- # ...
68
-
69
- Celluloid::Sync.gems(self)
70
- ```
@@ -1,18 +0,0 @@
1
- # coding: utf-8
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "celluloid-culture"
5
- spec.version = "0.2"
6
- spec.authors = ["Tony Arcieri", "Donovan Keme"]
7
- spec.email = ["bascule@gmail.com", "code@extremist.digital"]
8
-
9
- spec.summary = "The culture of Celluloid, in RubyGem form!"
10
- spec.description = "In which we try to codify Celluloid's life philosophy as Ruby"
11
- spec.homepage = "https://github.com/celluloid/culture"
12
-
13
- spec.files = Dir["README.md", "CHANGES.md", "LICENSE.txt", "lib/**/*", "spec/**/*"]
14
- spec.require_path = "lib"
15
-
16
- spec.add_development_dependency "bundler", "~> 1.9"
17
- spec.add_development_dependency "rake", "~> 10.0"
18
- end
@@ -1,39 +0,0 @@
1
- # Motivation
2
- To achieve the higher level of modularity, Celluloid was split into small sub-projects that naturally depend on each other.
3
- Bundler can't handle circular dependencies properly and currently the only workaround is to list all celluloid-ish dependencies in both Gemfile and gemspec.
4
- This is error-prone and not efficient. Thus it was required to put some better workaround in place.
5
-
6
- # Configuration
7
- The list of gems and their properties are now defined in `dependencies.yml`.
8
-
9
- For example:
10
-
11
- ```yml
12
- celluloid:
13
- bundler:
14
- github: celluloid/celluloid
15
- branch: 0.17.0-prerelease
16
- celluloid-extras:
17
- bundler:
18
- github: celluloid/celluloid-extras
19
- celluloid-supervision:
20
- bundler:
21
- github: celluloid/celluloid-supervision
22
- celluloid-pool:
23
- bundler:
24
- github: celluloid/celluloid-pool
25
- celluloid-fsm:
26
- bundler:
27
- github: celluloid/celluloid-fsm
28
- timers:
29
- gemspec:
30
- - ~> 4.0.0
31
- bundler:
32
- github: celluloid/timers
33
- ```
34
-
35
- # Modification of `gemspec` and `Gemfile`
36
-
37
- The injection of dependencies into `gemspec` and `Gemfile` is handled by `Celluloid::Sync.gems()`, which routes to either `Celluloid::Gems.gemspec` or `Celluloid::Gems.gemfile` depending on what is passed to it:
38
-
39
- * Discussed in [SYNC.md](../SYNC.md#how-do-you-install-it-in-gemfile-and-gemspec-then)
@@ -1,85 +0,0 @@
1
- bundler:
2
- dependency: development
3
-
4
- nenv:
5
- dependency: development
6
-
7
- dotenv:
8
- dependency: development
9
-
10
- benchmark_suite:
11
- dependency: development
12
-
13
- rubocop:
14
- dependency: development
15
-
16
- transpec:
17
- dependency: development
18
-
19
- pry:
20
- dependency: development
21
-
22
- rake:
23
- dependency: development
24
-
25
- rspec:
26
- dependency: development
27
-
28
- guard-rspec:
29
- dependency: development
30
-
31
- rspec-retry:
32
- dependency: development
33
-
34
- coveralls:
35
- dependency: development
36
- gemfile:
37
- require: false
38
-
39
- celluloid:
40
- dependency: core
41
- version: ">= 0.17.2"
42
- gemfile:
43
- github: celluloid/celluloid
44
- branch: master
45
- submodules: true
46
-
47
- celluloid-essentials:
48
- dependency: module
49
- gemfile:
50
- github: celluloid/celluloid-essentials
51
- branch: master
52
- submodules: true
53
-
54
- celluloid-supervision:
55
- dependency: module
56
- gemfile:
57
- github: celluloid/celluloid-supervision
58
- branch: master
59
- submodules: true
60
-
61
- celluloid-pool:
62
- dependency: module
63
- gemfile:
64
- github: celluloid/celluloid-pool
65
- branch: master
66
- submodules: true
67
-
68
- celluloid-fsm:
69
- dependency: module
70
- gemfile:
71
- github: celluloid/celluloid-fsm
72
- branch: master
73
- submodules: true
74
-
75
- celluloid-extras:
76
- dependency: module
77
- gemfile:
78
- github: celluloid/celluloid-extras
79
- branch: master
80
- submodules: true
81
-
82
- timers:
83
- version: ">= 4.1.1"
84
- gemfile:
85
- github: celluloid/timers
@@ -1,101 +0,0 @@
1
- require "yaml"
2
-
3
- module Celluloid
4
- module Sync
5
- module Gemfile
6
- class << self
7
- def [](dsl)
8
- dsl.source("https://rubygems.org")
9
- dsl.gemspec # Runs gemspec, but also @sets gem_name.
10
- Gems.gemfile(dsl)
11
- end
12
- end
13
- end
14
- module Gemspec
15
- class << self
16
- def [](gem)
17
- Gems.gemspec(gem)
18
- end
19
- end
20
- end
21
- end
22
- module Gems
23
- extend self
24
- @gem_name = nil
25
-
26
- undef gems rescue nil
27
- def gems
28
- File.expand_path("../dependencies.yml", __FILE__)
29
- end
30
-
31
- unless @dependencies ||= nil
32
- @dependencies = YAML.load_file(gems) if File.exist?(gems)
33
- end
34
-
35
- unless @dependencies.is_a?(Hash) && @dependencies.any?
36
- fail "Celluloid cannot find its dependencies."
37
- end
38
-
39
- undef core? rescue nil
40
- def core?(name=@gem_name)
41
- return false unless @dependencies[name].is_a? Hash
42
- @dependencies[name]["dependency"] == "core"
43
- end
44
-
45
- undef separate? rescue nil
46
- def separate?
47
- !@dependencies.keys.include?(@gem_name)
48
- end
49
-
50
- undef gemspec rescue nil
51
- def gemspec(gem)
52
- @gem_name = gem.name
53
- loader do |name, spec|
54
- # Rules for dependencies, to avoid so-called circular dependency:
55
- # - Only the core gem lists all the modules as runtime dependencies.
56
- # - If this gem is not in the dependencies list, then it needs the core gem at runtime;
57
- # the module gems are development dependencies only. This is a depending separate gem.
58
- # There is the core gem, module gems, true dependencies, and separately depending gems.
59
- # - If the dependency is a module, it is only a development dependency to other modules,
60
- # and even the core gem is a development dependency. It is not expected to be used alone.
61
- meth = case spec["dependency"]
62
- when "core", "module"
63
- # For the core gem, all modules are runtime dependencies.
64
- # For separate gems, only the core gem is a runtime dependency.
65
- if core? || (separate? && core?(name))
66
- :add_runtime_dependency
67
- else
68
- :add_development_dependency
69
- end
70
- when "development"
71
- :add_development_dependency
72
- else
73
- :add_dependency
74
- end
75
- gem.send(meth, name, spec["version"] || ">= 0")
76
- end
77
- end
78
-
79
- undef gemfile rescue nil
80
- def gemfile(dsl)
81
- loader do |name, spec|
82
- params = [name, spec["version"] || ">= 0"]
83
- req = spec["gemfile"] || {}
84
- params << req.each_with_object({}) { |(k, v), o| o[k.to_sym] = v }
85
- current = dsl.dependencies.find { |d| d.name == name }
86
- dsl.dependencies.delete(current) if current
87
- dsl.gem(*params)
88
- end
89
- end
90
-
91
- private
92
-
93
- def loader
94
- @dependencies.each do |name, spec|
95
- next if name == @gem_name
96
- spec ||= {}
97
- yield name, spec
98
- end
99
- end
100
- end
101
- end
@@ -1,38 +0,0 @@
1
- # About
2
- [RuboCop](https://github.com/bbatsov/rubocop) is a ruby static code analyzer.
3
- It's more than just a lint. It verifies the code against ruby best practices and performs code correctness analysis.
4
- Celluloid culture doesn't always agree with all rubocop default policies and so we provide a rubocop configuration file that overrides its default behavior.
5
-
6
- # Integration
7
-
8
- [Integrate `celluloid/culture`](../README.md#integration), then include `culture/rupocop/.rubocop.yml` in your default rubocop config.
9
-
10
- ##### Add celluloid/culture as GIT submodule:
11
-
12
- * See instructions: [Integrate the `celluloid/culture` sub-module](../README.md#integration)
13
-
14
- ##### Include `culture/rupocop/rubocop.yml` in the `.rubocop.yml` in the root of your project:
15
- ```yml
16
- inherit_from:
17
- - culture/rubocop/rubocop.yml
18
- ```
19
-
20
- # How to add rubocop to your project
21
-
22
- The `rubocop` gem is automatically included by `Celluloid::Sync.gems` when that is [implemented](../SYNC.md).
23
-
24
- ##### Add a 'rubocop' target in your `Rakefile`
25
-
26
- # Hints
27
- It's possible to use rubocop for autocorrection of minor problems.
28
-
29
- Always verify these changes by running:
30
-
31
- ```sh
32
- bundle exec rubocop
33
- ```
34
-
35
- Once you are ready to auto-corret the issues you are shown, run it with the `-a` option:
36
- ```sh
37
- bundle exec rubocop -a
38
- ```