inoculate 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c70e4eab6fb2335d6f85faf1ed3d9a7ffbbcd4adb3e5aba1bc634963b1d655f
4
- data.tar.gz: 1194422c0091c941bc9ed5738098ce91a4ea6f07f6d2b1b0fa024d23ee27bf60
3
+ metadata.gz: b26bc8e397a1e50bb29e716bd1c4abb531f9267765960b936ce03ba8449ab7e5
4
+ data.tar.gz: e09a3d2235a100c7723596614845a4faba198261bbecfe979ebdf3b209b7d325
5
5
  SHA512:
6
- metadata.gz: b757fd3dddb407d98f71696dc3f64d115e18e3d8123049a57a6ed1e0c3e3b82da50d93890a53944af1572cf28b9c3902de2be89d7a8c1547cca68acdef36c57b
7
- data.tar.gz: 3da07d78b270f86f6ea28c807e72b4dec29d45e6c28db301dc2c2f2cc9e75107e56ec359e5f4133f312d412e74a1772ade84edf0ba6b83c2465f485ff04833fd
6
+ metadata.gz: d6a281590288dec453e6adf338f5b9461160d07ea35c8bdb3914a464630dd76d46ecfe3c2d16099d936e0f8c04159c0e1200cd0f7c65cf426e74a844492be8c1
7
+ data.tar.gz: 27c2596ce1a7e2e0c24bdcaf8cb83272a71f0f5e5a3addf8caac8aa082f5b13448f0af66226c45162deb96a6a43cc61d3addf052253aac84ec250002f827ef7d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v0.1.0 — 2022-10-10
2
+
3
+ * Add transient dependency registration.
4
+ * Add initialization process for gem.
5
+
1
6
  ## v0.0.0 — 2022-10-05
2
7
 
3
- * Initial gem setup
8
+ * Initial gem setup.
data/README.md CHANGED
@@ -3,45 +3,178 @@
3
3
  Inoculate is a small, thread-safe dependency injection library configured entirely with Ruby.
4
4
  It provides several life-cycles and provides dependency access through private accessors.
5
5
 
6
- ## Installation
6
+ ---
7
+
8
+ ## What's in the box?
9
+ ✅ Simple usage documentation written to get started fast. [Check it out!](#quick-start)
10
+
11
+ 📚 YARD generated API documentation for the library. [Check it out!](https://tinychameleon.github.io/inoculate/)
12
+
13
+ 🤖 RBS types for your type checking wants. [Check it out!](./sig/inoculate.rbs)
14
+
15
+ 💎 Tests against many Ruby versions. [Check it out!](#supported-ruby-versions)
16
+
17
+ 🔒 MFA protection on all gem owners. [Check it out!](https://rubygems.org/gems/inoculate)
18
+
19
+ ---
20
+
21
+ 1. [Quick Start](#quick-start)
22
+ 2. [Usage](#usage)
23
+ 1. [Dependency Life Cycles](#dependency-life-cycles)
24
+ 1. [Transient](#transient)
25
+ 2. [Renaming the Declaration API](#renaming-the-declaration-api)
26
+ 3. [Hide Your Dependency on Inoculate](#hide-your-dependency-on-inoculate)
27
+ 3. [Installation](#installation)
28
+ 1. [Supported Ruby Versions](#supported-ruby-versions)
29
+
30
+ ## Quick Start
31
+ Create an initialization file for your dependencies and start registering them.
32
+
33
+ ```ruby
34
+ require "inoculate"
35
+
36
+ Inoculate.initialize do |config|
37
+ config.transient(:counter) { Counter.new }
38
+ end
39
+ ```
40
+
41
+ To take advantage of dependency injection in tests, initialize based on the run-time environment.
42
+
43
+ ```ruby
44
+ # config/environments/test.rb
45
+ require "inoculate"
46
+
47
+ Inoculate.initialize do |config|
48
+ config.transient(:counter) { instance_double(Counter) }
49
+ end
50
+ ```
51
+
52
+ Finally, declare your dependencies (which are injected as included modules).
53
+
54
+ ```ruby
55
+ require "inoculate"
56
+
57
+ class HistogramGraph
58
+ include Inoculate::Porter
59
+ inoculate_with :counter
60
+
61
+ def to_s
62
+ counter.to_s
63
+ end
64
+ end
65
+ ```
66
+
67
+ ## Usage
7
68
 
8
- Add this line to your application's Gemfile:
69
+ ### Dependency Life Cycles
70
+ #### Transient
71
+ Transient dependencies are constructed for each call of the dependency method.
9
72
 
10
73
  ```ruby
11
- gem 'inoculate'
74
+ class Counter
75
+ attr_reader :count
76
+
77
+ def initialize
78
+ @count = 0
79
+ end
80
+
81
+ def inc
82
+ @count += 1
83
+ end
84
+ end
85
+
86
+ Inoculate.initialize do |config|
87
+ config.transient(:counter) { Counter.new }
88
+ end
89
+
90
+ class Example
91
+ include Inoculate::Porter
92
+ inoculate_with :counter
93
+
94
+ def to_s
95
+ counter.inc
96
+ "Count is: #{counter.count}"
97
+ end
98
+ end
99
+
100
+ puts Example.new
101
+ ```
102
+
103
+ This results in:
104
+
105
+ ```
106
+ Count is: 0
107
+ => nil
12
108
  ```
13
109
 
14
- And then execute:
110
+ ### Renaming the Declaration API
111
+ The `inoculate_with` API is named to avoid immediate collisions with other modules
112
+ and code you may have. You can use it as-is, or rename it to something you see fit
113
+ for your project.
114
+
115
+ ```ruby
116
+ require "inoculate"
117
+
118
+ class HistogramGraph
119
+ include Inoculate::Porter[:inject]
120
+ inject :counter
121
+ end
122
+ ```
15
123
 
16
- $ bundle install
124
+ ### Hide Your Dependency on Inoculate
125
+ Writing `Inocuate::Porter` everywhere in your code is probably going to get old fast,
126
+ feel free to hide it behind a base class or common included module.
17
127
 
18
- Or install it yourself as:
128
+ ```ruby
129
+ # Make it available to all Rails controllers.
130
+ class ApplicationController < ActionController::Base
131
+ include Inoculate::Porter[:dependencies]
132
+ end
133
+ ```
19
134
 
20
- $ gem install inoculate
135
+ ## Installation
136
+ Inoculate is a pure ruby library and does not rely on any compiled dependencies.
21
137
 
22
- ## Supported Ruby Versions
138
+ Install it by adding it to your gemfile and then running `bundle install`
23
139
 
140
+ ```ruby
141
+ gem "inoculate"
142
+ ```
143
+
144
+ Or manually install it with `gem`
145
+
146
+ ```shell
147
+ $ gem install inoculate
148
+ ```
149
+
150
+ ### Supported Ruby Versions
24
151
  Inoculate is tested against the following Ruby versions:
25
152
 
26
- - 2.7.6
27
- - 3.0.4
28
- - 3.1.2
153
+ - 2.7
154
+ - 3.0
155
+ - 3.1
29
156
  - 3.2-rc
30
157
 
31
- ## Usage
158
+ ## Development
159
+ After checking out the repo:
32
160
 
33
- TODO: Write usage instructions here
161
+ 1. run `bin/setup` to install dependencies.
162
+ 2. run `rake spec` to run the tests.
163
+ 3. run `rake spec:all` to run the tests across supported Ruby versions using Docker.
164
+ 4. run `rake standard` to see lint errors.
34
165
 
35
- ## Development
166
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
167
 
37
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
168
+ ### Local Installation
169
+ Run `bundle exec rake install` or `bundle exec rake install:local`.
38
170
 
39
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
171
+ ### Releasing
172
+ 1. Update the version number in `lib/inoculate/version.rb`.
173
+ 2. Run `bundle exec rake yard` to generate the latest documentation.
174
+ 3. Run `bundle exec rake release` to create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
175
 
41
176
  ## Contributing
42
-
43
177
  Bug reports and pull requests are welcome on GitHub at https://github.com/tinychameleon/inoculate.
44
178
 
45
179
  ## License
46
-
47
180
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/inoculate.gemspec CHANGED
@@ -21,15 +21,9 @@ Gem::Specification.new do |spec|
21
21
  spec.metadata["source_code_uri"] = "https://github.com/tinychameleon/inoculate"
22
22
  spec.metadata["bug_tracker_uri"] = "https://github.com/tinychameleon/inoculate/issues"
23
23
  spec.metadata["changelog_uri"] = "https://github.com/tinychameleon/inoculate/blob/main/CHANGELOG.md"
24
- #spec.metadata["documentation_uri"] = "https://tinychameleon.github.io/inoculate"
24
+ spec.metadata["documentation_uri"] = "https://tinychameleon.github.io/inoculate"
25
25
 
26
- # Specify which files should be added to the gem when it is released.
27
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
29
- `git ls-files -z`.split("\x0").reject do |f|
30
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
31
- end
32
- end
26
+ spec.files = Dir["lib/**/*.rb", "sig/**/*.rbs", "inoculate.gemspec", "CHANGELOG.md", "README.md", "LICENSE.txt"]
33
27
  spec.bindir = "exe"
34
28
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
35
29
  spec.require_paths = ["lib"]
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Inoculate
4
+ # Configure dependencies through a restricted API during initialization.
5
+ #
6
+ # @since 0.1.0
7
+ class Configurer
8
+ def initialize(manufacturer)
9
+ @manufacturer = manufacturer
10
+ end
11
+
12
+ # Register a transient dependency.
13
+ # @see Manufacturer#transient
14
+ #
15
+ # @since 0.1.0
16
+ def transient(name, builder = nil, &block)
17
+ manufacturer.transient(name, builder, &block)
18
+ end
19
+
20
+ private
21
+
22
+ attr_reader :manufacturer
23
+ end
24
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Inoculate
4
+ # A namespace for error types.
5
+ #
6
+ # @since 0.1.0
7
+ module Errors
8
+ # Base type for all Inoculate errors.
9
+ #
10
+ # @since 0.1.0
11
+ class Error < StandardError; end
12
+
13
+ # Raised when the user attempts to register a dependency with a name that can't be converted to a symbol.
14
+ #
15
+ # @since 0.1.0
16
+ class InvalidName < Error; end
17
+
18
+ # Raised when the user attempts to register a name again.
19
+ #
20
+ # @since 0.1.0
21
+ class AlreadyRegistered < Error; end
22
+
23
+ # Raised when the user attempts to depend on an unknown dependency.
24
+ #
25
+ # @since 0.1.0
26
+ class UnknownName < Error; end
27
+
28
+ # Raised when the user attempts to register a dependency with a builder that can't be called.
29
+ #
30
+ # @since 0.1.0
31
+ class RequiresCallable < Error; end
32
+ end
33
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Inoculate is a small, thread-safe dependency injection library configured entirely with Ruby.
4
+ # It provides several life-cycles and provides dependency access through private accessors.
5
+ #
6
+ # @since 0.1.0
7
+ module Inoculate
8
+ # The main configuration entrypoint for Inoculate. Use this to set up named dependencies.
9
+ #
10
+ # @note This method is not thread safe.
11
+ #
12
+ # @example A simple dependency configuration
13
+ # Inoculate.initialize do |config|
14
+ # config.transient(:http) { Faraday }
15
+ # end
16
+ #
17
+ # @example An environment-based dynamic dependency configuration
18
+ # Inoculate.initialize do |config|
19
+ # http_service = ENV["test"] ? -> { class_double(Faraday) } : -> { Faraday }
20
+ # config.transient(:http, http_service)
21
+ # end
22
+ #
23
+ # @yieldparam config [Configurer] a configuration object to register dependencies
24
+ #
25
+ # @since 0.1.0
26
+ def self.initialize
27
+ yield Configurer.new(manufacturer)
28
+ end
29
+
30
+ # @!visibility private
31
+ def self.manufacturer
32
+ @manufacturer ||= Manufacturer.new
33
+ end
34
+ end
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "digest"
4
+
5
+ module Inoculate
6
+ # Registers and builds dependency injection modules.
7
+ # @todo building needs to be thread-safe
8
+ # @todo singleton life cycle
9
+ # @todo instance life cycle
10
+ # @todo thread singleton life cycle
11
+ #
12
+ # @since 0.1.0
13
+ class Manufacturer
14
+ # The set of registered blueprints for dependency injection modules.
15
+ # @return [Hash<Symbol, Hash>]
16
+ #
17
+ # @since 0.1.0
18
+ attr_reader :registered_blueprints
19
+
20
+ def initialize
21
+ @registered_blueprints = {}
22
+ end
23
+
24
+ # Register a transient dependency.
25
+ #
26
+ # A transient dependency gets created anew every time it is retrieved through the accessor.
27
+ #
28
+ # @example With a block
29
+ # manufacturer.transient(:sha1_hasher) { Digest::SHA1.new }
30
+ #
31
+ # @example With a Proc
32
+ # manufacturer.transient(:sha1_hasher, -> { Digest::SHA1.new })
33
+ #
34
+ # @example With anything Callable
35
+ # class HashingBuilder
36
+ # def call = Digest::SHA1.new
37
+ # end
38
+ # manufacturer.transient(:sha1_hasher, HashingBuilder.new)
39
+ #
40
+ # @param name [Symbol, #to_sym] the dependency name which will be used to access it
41
+ # @param builder [#call] the callable to build the dependency
42
+ # @param block [Proc, nil] an alternative builder callable
43
+ #
44
+ # @raise [Errors::RequiresCallable] if no builder or block is provided
45
+ # @raise [Errors::InvalidName] if the name is not a symbol, cannot be converted to a symbol,
46
+ # or is not a valid attribute name
47
+ # @raise [Errors::AlreadyRegistered] if the name has been registered previously
48
+ #
49
+ # @since 0.1.0
50
+ def transient(name, builder = nil, &block)
51
+ validate_builder_name name
52
+ raise Errors::AlreadyRegistered if @registered_blueprints.has_key? name
53
+ raise Errors::RequiresCallable unless builder.respond_to?(:call) || block
54
+
55
+ @registered_blueprints[name.to_sym] = {lifecycle: :transient, builder: builder || block, accessor_module: nil}
56
+ end
57
+
58
+ # Build the accessor module associated with a dependency name.
59
+ #
60
+ # @param name [Symbol] the dependency name to build an accessor module for
61
+ #
62
+ # @raise [Errors::UnknownName] if the dependency name is not registered
63
+ #
64
+ # @return [Module] the accessor module for accessing instances of the dependency
65
+ #
66
+ # @since 0.1.0
67
+ def build(name)
68
+ blueprint = @registered_blueprints[name]
69
+ raise Errors::UnknownName if blueprint.nil?
70
+ return blueprint[:accessor_module] unless blueprint[:accessor_module].nil?
71
+
72
+ module_name = "I#{Digest::SHA1.hexdigest(name.to_s)}"
73
+ builder = blueprint[:builder]
74
+ blueprint[:accessor_module] = Providers.module_eval do
75
+ const_set(module_name, Module.new do
76
+ private define_method(name) { builder.call }
77
+ end)
78
+ end
79
+ end
80
+
81
+ private
82
+
83
+ def validate_builder_name(name)
84
+ raise Errors::InvalidName, "name must be a symbol or convert to one" unless name.respond_to? :to_sym
85
+ begin
86
+ Module.new { attr_reader name }
87
+ rescue NameError
88
+ raise Errors::InvalidName, "name must be a valid attr_reader"
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Inoculate
4
+ # Delivers requested dependencies to user classes.
5
+ #
6
+ # The default method +inoculate_with+ is named to avoid collisions with other
7
+ # libraries. You can alias it to something that makes your codebase legible.
8
+ #
9
+ # @example Getting Dependencies
10
+ # class HealthChecker
11
+ # include Inoculate::Porter
12
+ # inoculate_with :http_service
13
+ #
14
+ # def healthy?
15
+ # http_service.get("/health").ok?
16
+ # end
17
+ # end
18
+ #
19
+ # @example With Aliasing Include
20
+ # class Base
21
+ # include Inoculate::Porter[:depend_on]
22
+ # end
23
+ #
24
+ # class Child < Base
25
+ # depend_on :http_service
26
+ # end
27
+ #
28
+ # @since 0.1.0
29
+ module Porter
30
+ # Create a dependency injection module with your chosen method name.
31
+ #
32
+ # @param method_name [Symbol] the dependency injection method name
33
+ # @return [Module] a dependency injection module for inclusion in classes.
34
+ #
35
+ # @since 0.1.0
36
+ def self.[](method_name)
37
+ m = Module.new do
38
+ define_method(method_name) do |*names|
39
+ names.each do |name|
40
+ include(Inoculate.manufacturer.build(name))
41
+ end
42
+ end
43
+ end
44
+
45
+ inclusion = Module.new
46
+ inclusion.singleton_class.define_method(:included) do |base|
47
+ base.extend m
48
+ end
49
+ inclusion
50
+ end
51
+
52
+ # Including this module makes the default +inoculate_with+ method available.
53
+ #
54
+ # @param base [Class] the class this module is included within
55
+ #
56
+ # @since 0.1.0
57
+ def self.included(base)
58
+ base.include self[:inoculate_with]
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Inoculate
4
+ # A namespace for generated dependency injection modules.
5
+ #
6
+ # @since 0.1.0
7
+ module Providers
8
+ end
9
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Inoculate
4
- VERSION = "0.0.0"
4
+ # The library version.
5
+ VERSION = "0.1.0"
5
6
  end
data/lib/inoculate.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "inoculate/version"
4
-
5
- module Inoculate
6
- class Error < StandardError; end
7
- # Your code goes here...
8
- end
4
+ require_relative "inoculate/errors"
5
+ require_relative "inoculate/providers"
6
+ require_relative "inoculate/manufacturer"
7
+ require_relative "inoculate/porter"
8
+ require_relative "inoculate/configurer"
9
+ require_relative "inoculate/initialization"
data/sig/inoculate.rbs CHANGED
@@ -1,4 +1,61 @@
1
1
  module Inoculate
2
2
  VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
3
+
4
+ interface _ToSymbol
5
+ def to_sym: () -> Symbol
6
+ end
7
+
8
+ type callable = ^() -> untyped
9
+ type lifecycle_name = :transient
10
+ type builder_name = Symbol
11
+ type blueprint = { lifecycle: lifecycle_name, builder: callable, accessor_module: Module? }
12
+
13
+ module Errors
14
+ class Error < StandardError
15
+ end
16
+
17
+ class InvalidName < Error
18
+ end
19
+
20
+ class AlreadyRegistered < Error
21
+ end
22
+
23
+ class UnknownName < Error
24
+ end
25
+
26
+ class RequiresCallable < Error
27
+ end
28
+ end
29
+
30
+ module Providers
31
+ end
32
+
33
+ class Manufacturer
34
+ attr_reader registered_blueprints: Hash[builder_name, blueprint]
35
+ def transient: (builder_name | _ToSymbol, callable?) ?{ () -> void } -> void
36
+ def build: (builder_name) -> Module
37
+
38
+ private
39
+
40
+ def validate_builder_name: (builder_name) -> void
41
+ end
42
+
43
+ class Configurer
44
+ def initialize: (Manufacturer) -> void
45
+
46
+ def transient: (builder_name | _ToSymbol, callable?) -> void
47
+
48
+ private
49
+
50
+ attr_reader manufacturer: Manufacturer
51
+ end
52
+
53
+ module Porter
54
+ def self.[]: (Symbol) -> Module
55
+ end
56
+
57
+ def self.initialize: () { (Configurer) -> void } -> void
58
+
59
+ # "Private"
60
+ def self.manufacturer: () -> Manufacturer
4
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inoculate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephan Tarulli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-06 00:00:00.000000000 Z
11
+ date: 2022-10-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Inoculate is a small, thread-safe dependency injection library configured entirely with Ruby.
@@ -19,22 +19,17 @@ executables: []
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
- - ".idea/.gitignore"
23
- - ".idea/inspectionProfiles/Project_Default.xml"
24
- - ".idea/misc.xml"
25
- - ".idea/modules.xml"
26
- - ".idea/vcs.xml"
27
- - ".rspec"
28
- - ".standard.yml"
29
22
  - CHANGELOG.md
30
- - Gemfile
31
- - Gemfile.lock
32
23
  - LICENSE.txt
33
24
  - README.md
34
- - Rakefile
35
25
  - inoculate.gemspec
36
- - inoculate.iml
37
26
  - lib/inoculate.rb
27
+ - lib/inoculate/configurer.rb
28
+ - lib/inoculate/errors.rb
29
+ - lib/inoculate/initialization.rb
30
+ - lib/inoculate/manufacturer.rb
31
+ - lib/inoculate/porter.rb
32
+ - lib/inoculate/providers.rb
38
33
  - lib/inoculate/version.rb
39
34
  - sig/inoculate.rbs
40
35
  homepage: https://github.com/tinychameleon/inoculate
@@ -45,6 +40,7 @@ metadata:
45
40
  source_code_uri: https://github.com/tinychameleon/inoculate
46
41
  bug_tracker_uri: https://github.com/tinychameleon/inoculate/issues
47
42
  changelog_uri: https://github.com/tinychameleon/inoculate/blob/main/CHANGELOG.md
43
+ documentation_uri: https://tinychameleon.github.io/inoculate
48
44
  post_install_message:
49
45
  rdoc_options: []
50
46
  require_paths:
data/.idea/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- # Default ignored files
2
- /shelf/
3
- /workspace.xml
4
- # Editor-based HTTP Client requests
5
- /httpRequests/
6
- # Datasource local storage ignored files
7
- /dataSources/
8
- /dataSources.local.xml
@@ -1,8 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Rubocop" enabled="true" level="WARNING" enabled_by_default="true">
5
- <option name="myUseStandardGemIfPossible" value="true" />
6
- </inspection_tool>
7
- </profile>
8
- </component>
data/.idea/misc.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 3.1.2" project-jdk-type="RUBY_SDK">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- </project>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/inoculate.iml" filepath="$PROJECT_DIR$/inoculate.iml" />
6
- </modules>
7
- </component>
8
- </project>
data/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.standard.yml DELETED
@@ -1,3 +0,0 @@
1
- # For available configuration options, see:
2
- # https://github.com/testdouble/standard
3
- ruby_version: 2.7
data/Gemfile DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in inoculate.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
9
- gem "rspec", "~> 3.11"
10
- gem "standard", "~> 1.16"
11
- gem "yard", "~> 0.9"
data/Gemfile.lock DELETED
@@ -1,67 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- inoculate (0.0.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ast (2.4.2)
10
- diff-lcs (1.5.0)
11
- json (2.6.2)
12
- parallel (1.22.1)
13
- parser (3.1.2.1)
14
- ast (~> 2.4.1)
15
- rainbow (3.1.1)
16
- rake (13.0.6)
17
- regexp_parser (2.6.0)
18
- rexml (3.2.5)
19
- rspec (3.11.0)
20
- rspec-core (~> 3.11.0)
21
- rspec-expectations (~> 3.11.0)
22
- rspec-mocks (~> 3.11.0)
23
- rspec-core (3.11.0)
24
- rspec-support (~> 3.11.0)
25
- rspec-expectations (3.11.1)
26
- diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.11.0)
28
- rspec-mocks (3.11.1)
29
- diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.11.0)
31
- rspec-support (3.11.1)
32
- rubocop (1.35.1)
33
- json (~> 2.3)
34
- parallel (~> 1.10)
35
- parser (>= 3.1.2.1)
36
- rainbow (>= 2.2.2, < 4.0)
37
- regexp_parser (>= 1.8, < 3.0)
38
- rexml (>= 3.2.5, < 4.0)
39
- rubocop-ast (>= 1.20.1, < 2.0)
40
- ruby-progressbar (~> 1.7)
41
- unicode-display_width (>= 1.4.0, < 3.0)
42
- rubocop-ast (1.21.0)
43
- parser (>= 3.1.1.0)
44
- rubocop-performance (1.14.3)
45
- rubocop (>= 1.7.0, < 2.0)
46
- rubocop-ast (>= 0.4.0)
47
- ruby-progressbar (1.11.0)
48
- standard (1.16.1)
49
- rubocop (= 1.35.1)
50
- rubocop-performance (= 1.14.3)
51
- unicode-display_width (2.3.0)
52
- webrick (1.7.0)
53
- yard (0.9.28)
54
- webrick (~> 1.7.0)
55
-
56
- PLATFORMS
57
- x86_64-darwin-19
58
-
59
- DEPENDENCIES
60
- inoculate!
61
- rake (~> 13.0)
62
- rspec (~> 3.11)
63
- standard (~> 1.16)
64
- yard (~> 0.9)
65
-
66
- BUNDLED WITH
67
- 2.3.7
data/Rakefile DELETED
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
- require "yard"
6
-
7
- RSpec::Core::RakeTask.new(:spec)
8
-
9
- YARD::Rake::YardocTask.new do |t|
10
- t.files = %w[lib/**/*.rb - CHANGELOG.md]
11
- t.options = %w[--private -o ./docs]
12
- end
13
-
14
- require "standard/rake"
15
-
16
- task default: %i[spec standard]
data/inoculate.iml DELETED
@@ -1,75 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$">
6
- <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
7
- <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
8
- <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
9
- </content>
10
- <orderEntry type="inheritedJdk" />
11
- <orderEntry type="sourceFolder" forTests="false" />
12
- <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.1.2) [gem]" level="application" />
13
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.7, rbenv: 3.1.2) [gem]" level="application" />
14
- <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.0, rbenv: 3.1.2) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="json (v2.6.2, rbenv: 3.1.2) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, rbenv: 3.1.2) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="parser (v3.1.2.1, rbenv: 3.1.2) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, rbenv: 3.1.2) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, rbenv: 3.1.2) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.6.0, rbenv: 3.1.2) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, rbenv: 3.1.2) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="rspec (v3.11.0, rbenv: 3.1.2) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.11.0, rbenv: 3.1.2) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.11.1, rbenv: 3.1.2) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.11.1, rbenv: 3.1.2) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.11.1, rbenv: 3.1.2) [gem]" level="application" />
27
- <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.35.1, rbenv: 3.1.2) [gem]" level="application" />
28
- <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.21.0, rbenv: 3.1.2) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="rubocop-performance (v1.14.3, rbenv: 3.1.2) [gem]" level="application" />
30
- <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, rbenv: 3.1.2) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="standard (v1.16.1, rbenv: 3.1.2) [gem]" level="application" />
32
- <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.3.0, rbenv: 3.1.2) [gem]" level="application" />
33
- <orderEntry type="library" scope="PROVIDED" name="webrick (v1.7.0, rbenv: 3.1.2) [gem]" level="application" />
34
- <orderEntry type="library" scope="PROVIDED" name="yard (v0.9.28, rbenv: 3.1.2) [gem]" level="application" />
35
- </component>
36
- <component name="RakeTasksCache">
37
- <option name="myRootTask">
38
- <RakeTaskImpl id="rake">
39
- <subtasks>
40
- <RakeTaskImpl description="Build inoculate-0.0.0.gem into the pkg directory" fullCommand="build" id="build" />
41
- <RakeTaskImpl id="build">
42
- <subtasks>
43
- <RakeTaskImpl description="Generate SHA512 checksum if inoculate-0.0.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
44
- </subtasks>
45
- </RakeTaskImpl>
46
- <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
47
- <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
48
- <RakeTaskImpl description="Build and install inoculate-0.0.0.gem into system gems" fullCommand="install" id="install" />
49
- <RakeTaskImpl id="install">
50
- <subtasks>
51
- <RakeTaskImpl description="Build and install inoculate-0.0.0.gem into system gems without network access" fullCommand="install:local" id="local" />
52
- </subtasks>
53
- </RakeTaskImpl>
54
- <RakeTaskImpl description="Create tag v0.0.0 and build and push inoculate-0.0.0.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
55
- <RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
56
- <RakeTaskImpl description="Lint with the Standard Ruby style guide" fullCommand="standard" id="standard" />
57
- <RakeTaskImpl id="standard">
58
- <subtasks>
59
- <RakeTaskImpl description="Lint and automatically fix with the Standard Ruby style guide" fullCommand="standard:fix" id="fix" />
60
- </subtasks>
61
- </RakeTaskImpl>
62
- <RakeTaskImpl description="" fullCommand="default" id="default" />
63
- <RakeTaskImpl description="" fullCommand="release" id="release" />
64
- <RakeTaskImpl id="release">
65
- <subtasks>
66
- <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
67
- <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
68
- <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
69
- </subtasks>
70
- </RakeTaskImpl>
71
- </subtasks>
72
- </RakeTaskImpl>
73
- </option>
74
- </component>
75
- </module>