settings_cabinet 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5b97d0554a3bc144e342ad263c1335930404658a1fdfb16401911cc98a23e130
4
+ data.tar.gz: 2346f43f8fb95d48dbbbef5a14a177ad30e76bbeeab1c4065ca8cee901397808
5
+ SHA512:
6
+ metadata.gz: '0495ec42369fede25effeb3f16ba9d62245610a0fe4d3407658595b4366cb028b1d58b3491c583e0570d937ab417bb99beab5dd02ce512c14132d569276cb737'
7
+ data.tar.gz: b83916434005e0a2b6d3bfbe875ee9200d66bcec25a6b608bcfd67bb164508341008f7562e181b896722a0d9003218a79f7314dd26c951160d3bf90257f9285d
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,29 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+
6
+ AllCops:
7
+ TargetRubyVersion: 2.7
8
+ NewCops: enable
9
+
10
+ Style/Documentation:
11
+ Enabled: false
12
+
13
+ Style/StringLiterals:
14
+ Enabled: true
15
+ EnforcedStyle: double_quotes
16
+
17
+ Style/StringLiteralsInInterpolation:
18
+ Enabled: true
19
+ EnforcedStyle: double_quotes
20
+
21
+ Layout/LineLength:
22
+ Max: 120
23
+
24
+ Layout/MultilineMethodCallIndentation:
25
+ EnforcedStyle: indented
26
+
27
+ Metrics/BlockLength:
28
+ Exclude:
29
+ - spec/**/*
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-04-23
4
+
5
+ * Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at yuji.developer@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in settings_cabinet.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.11", require: false
11
+ gem "rubocop", "~> 1.27", require: false
12
+ gem "rubocop-performance", "~> 1.13", require: false
13
+ gem "rubocop-rake", "~> 0.6", require: false
14
+ gem "rubocop-rspec", "~> 2.9", require: false
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Yuji Hanamura
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # SettingsCabinet
2
+
3
+ SettingsCabinet is a simple settings solution with ERB-enabled YAML file like [settingslogic](https://github.com/settingslogic/settingslogic).
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem "settings_cabinet"
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install settings_cabinet
20
+
21
+ ## Usage
22
+
23
+ DSL is very similar to settingslogic.
24
+
25
+ ```ruby
26
+ class Settings < SettingsCabinet
27
+ using SettingsCabinet::DSL
28
+
29
+ source Rails.root.join("config", "settings.yml")
30
+ namespace Rails.env
31
+ end
32
+ ```
33
+
34
+ | Name | Type | Description | Default | Optional |
35
+ |--|--|--|--|--|--|
36
+ | `source` | String | Path of settings file. | - | No |
37
+ | `namespace` | String | Using a namespace allows you to change your configuration depending on your environment. e.g. `Rails.env` | `nil` | Yes |
38
+ | `permitted_classes` | Array of Class | Arbitrary classes can be allowed by adding those classes to the allowlist. e.g. `[Date, Time]` | `[]` | Yes |
39
+
40
+
41
+ ```yaml
42
+ # config/settings.yml
43
+ defaults: &defaults
44
+ foo:
45
+ bar: nested setting
46
+ baz: <%= 3 * 3 %>
47
+ quz: 24
48
+
49
+ development:
50
+ <<: *defaults
51
+ quz: 48
52
+
53
+ test:
54
+ <<: *defaults
55
+
56
+ production:
57
+ <<: *defaults
58
+ ```
59
+
60
+ Accessors are defined in the same way as settingslogic, but writers do not.
61
+ ```ruby
62
+ Settings.foo.bar #=> "nested setting"
63
+ Settings[:baz] #=> 9
64
+ ```
65
+
66
+ You can explicitly load all your settings, if needed.
67
+ ```ruby
68
+ # e.g. config/initializers/settings.rb
69
+ using SettingsCabinet::Control
70
+ Settings.load!
71
+ ```
72
+ or
73
+ ```ruby
74
+ class Settings < SettingsCabinet
75
+ using SettingsCabinet::DSL
76
+ using SettingsCabinet::Control
77
+
78
+ source Rails.root.join("config", "settings.yml")
79
+ namespace Rails.env
80
+
81
+ load!
82
+ end
83
+ ```
84
+
85
+ ## Development
86
+
87
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
88
+
89
+ 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).
90
+
91
+ ## Contributing
92
+
93
+ Bug reports and pull requests are welcome on GitHub at https://github.com/yujideveloper/settings_cabinet. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/yujideveloper/settings_cabinet/blob/main/CODE_OF_CONDUCT.md).
94
+
95
+ ## License
96
+
97
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
98
+
99
+ ## Code of Conduct
100
+
101
+ Everyone interacting in the SettingsCabinet project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yujideveloper/settings_cabinet/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rubocop/rake_task"
5
+ require "rspec/core/rake_task"
6
+
7
+ RuboCop::RakeTask.new
8
+ RSpec::Core::RakeTask.new(:spec)
9
+
10
+ task default: %i[rubocop spec]
@@ -0,0 +1,168 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yaml"
4
+ require "erb"
5
+
6
+ require_relative "settings"
7
+ require_relative "configuration"
8
+
9
+ module SettingsCabinet
10
+ class Base
11
+ module AccessorBuilder
12
+ RESERVED_METHODS = %i[instance define_accessors! define_class_accessors!].freeze
13
+ private_constant :RESERVED_METHODS
14
+
15
+ refine Base do
16
+ private
17
+
18
+ def define_accessors!(values)
19
+ values.each_key do |key|
20
+ name = key.to_s
21
+ next unless name.match?(/\A\w+\z/)
22
+
23
+ self.class.class_eval <<~METHOD, __FILE__, __LINE__ + 1
24
+ def #{name} # def foo
25
+ self[:#{name.dump}] # self[:foo]
26
+ end # end
27
+ METHOD
28
+ end
29
+ end
30
+
31
+ def define_class_accessors!
32
+ names = public_methods(false)
33
+ .difference(::Object.public_methods, self.class.public_methods(false), RESERVED_METHODS)
34
+ names.each do |name|
35
+ self.class.class_eval <<~METHOD, __FILE__, __LINE__ + 1
36
+ def self.#{name}(...) # def self.foo(...)
37
+ @instance.#{name}(...) # @instance.foo(...)
38
+ end # end
39
+ METHOD
40
+ end
41
+ end
42
+ end
43
+ end
44
+ private_constant :AccessorBuilder
45
+
46
+ module SettingsLoader
47
+ refine Base do
48
+ def load_settings_hash(config)
49
+ YAMLSettingsLoader.new(config).call
50
+ end
51
+ end
52
+
53
+ class YAMLSettingsLoader
54
+ def initialize(config)
55
+ @source = config.source
56
+ @namespace = config.namespace
57
+ @permitted_classes = config.permitted_classes
58
+ end
59
+
60
+ def call
61
+ erb_str = ::File.read(source)
62
+ yaml_str = ::ERB.new(erb_str).result
63
+ ::YAML
64
+ .safe_load(yaml_str,
65
+ permitted_classes: permitted_classes,
66
+ aliases: true,
67
+ filename: source,
68
+ fallback: {},
69
+ symbolize_names: true)
70
+ .then { |h| namespace ? h.fetch(namespace.to_sym) : h }
71
+ end
72
+
73
+ private
74
+
75
+ attr_reader :source, :namespace, :permitted_classes
76
+ end
77
+ private_constant :YAMLSettingsLoader
78
+ end
79
+
80
+ require_relative "instance"
81
+ using Instance
82
+
83
+ using SettingsLoader
84
+ using AccessorBuilder
85
+
86
+ def initialize(config)
87
+ settings_hash = load_settings_hash(config)
88
+
89
+ @settings = Settings.new(settings_hash)
90
+
91
+ define_accessors!(settings_hash)
92
+ define_class_accessors!
93
+ end
94
+
95
+ def [](...)
96
+ @settings.[](...) # rubocop:todo Layout/SpaceBeforeBrackets false positive: https://github.com/rubocop/rubocop/issues/10573
97
+ end
98
+
99
+ def dig(...)
100
+ @settings.dig(...) # rubocop:todo Style/SingleArgumentDig false positive: https://github.com/rubocop/rubocop/issues/10574
101
+ end
102
+
103
+ def fetch(...)
104
+ @settings.fetch(...)
105
+ end
106
+
107
+ def fetch_values(...)
108
+ @settings.fetch_values(...)
109
+ end
110
+
111
+ def values_at(...)
112
+ @settings.values_at(...)
113
+ end
114
+
115
+ def to_h(...)
116
+ @settings.to_h(...)
117
+ end
118
+
119
+ def self.[](...)
120
+ instance.[](...)
121
+ end
122
+
123
+ def self.dig(...)
124
+ instance.dig(...) # rubocop:todo Style/SingleArgumentDig false positive: https://github.com/rubocop/rubocop/issues/10574
125
+ end
126
+
127
+ def self.fetch(...)
128
+ instance.fetch(...)
129
+ end
130
+
131
+ def self.fetch_values(...)
132
+ instance.fetch_values(...)
133
+ end
134
+
135
+ def self.values_at(...)
136
+ instance.values_at(...)
137
+ end
138
+
139
+ def self.to_h(...)
140
+ instance.to_h(...)
141
+ end
142
+
143
+ def self.method_missing(...)
144
+ instance.public_send(...)
145
+ end
146
+ private_class_method :method_missing
147
+
148
+ def self.respond_to_missing?(symbol, _include_private)
149
+ instance.respond_to?(symbol, false)
150
+ end
151
+ private_class_method :respond_to_missing?
152
+
153
+ def self.new(*)
154
+ raise ::NotImplementedError, "#{self} is an abstract class and cannot be instantiated." if self == Base
155
+
156
+ super
157
+ end
158
+ private_class_method :new
159
+
160
+ def self.inherited(subclass)
161
+ super
162
+ config = Configuration.new(source: nil, namespace: nil, permitted_classes: [])
163
+ subclass.instance_variable_set(:@config, config)
164
+ subclass.instance_variable_set(:@instance_lock, ::Mutex.new)
165
+ end
166
+ private_class_method :inherited
167
+ end
168
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SettingsCabinet
4
+ class Configuration
5
+ attr_accessor :source, :namespace, :permitted_classes
6
+
7
+ def initialize(source: nil, namespace: nil, permitted_classes: [])
8
+ @source = source
9
+ @namespace = namespace
10
+ @permitted_classes = permitted_classes
11
+ end
12
+ end
13
+ private_constant :Configuration
14
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SettingsCabinet
4
+ module Control
5
+ require_relative "instance"
6
+ using Instance
7
+
8
+ refine Base.singleton_class do
9
+ def load!
10
+ instance
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SettingsCabinet
4
+ module DSL
5
+ refine Base.singleton_class do
6
+ def namespace(value)
7
+ @config.namespace = value
8
+ end
9
+
10
+ def source(value)
11
+ @config.source = value
12
+ end
13
+
14
+ def permitted_classes(value)
15
+ @config.permitted_classes = Array(value)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SettingsCabinet
4
+ class SettingsSourcePathNotSpecified < ::StandardError; end
5
+
6
+ module Instance
7
+ MUTEX = ::Mutex.new
8
+ private_constant :MUTEX
9
+
10
+ refine Base.singleton_class do
11
+ def instance
12
+ if instance_variable_defined?(:@instance) && (instance_ = @instance)
13
+ return instance_
14
+ end
15
+
16
+ @instance_lock.synchronize do
17
+ break @instance if instance_variable_defined?(:@instance)
18
+
19
+ raise SettingsSourcePathNotSpecified unless @config.source
20
+
21
+ @instance = new(@config)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ private_constant :Instance
27
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SettingsCabinet
4
+ class Settings
5
+ module AccessorBuilder
6
+ refine Settings do
7
+ private
8
+
9
+ def define_accessors!(values)
10
+ values.each_key do |k|
11
+ name = k.to_s
12
+ next unless name.match?(/\A\w+\z/)
13
+
14
+ singleton_class.class_eval <<~METHOD, __FILE__, __LINE__ + 1
15
+ def #{name} # def foo
16
+ self[:#{name.dump}] # self[:foo]
17
+ end # end
18
+ METHOD
19
+ end
20
+ end
21
+ end
22
+ end
23
+ private_constant :AccessorBuilder
24
+
25
+ using AccessorBuilder
26
+
27
+ def initialize(hash)
28
+ @values = hash.transform_values { |v| v.is_a?(::Hash) ? self.class.new(v) : v }
29
+
30
+ define_accessors!(@values)
31
+ end
32
+
33
+ def [](key)
34
+ @values[key.to_sym]
35
+ end
36
+
37
+ def dig(*keys)
38
+ keys[0] = keys[0].to_sym unless keys.empty?
39
+ @values.dig(*keys)
40
+ end
41
+
42
+ def fetch(key, *args, &block)
43
+ @values.fetch(key.to_sym, *args, &block)
44
+ end
45
+
46
+ def fetch_values(*keys, &block)
47
+ @values.fetch_values(*keys.map(&:to_sym), &block)
48
+ end
49
+
50
+ def values_at(*keys)
51
+ @values.values_at(*keys.map(&:to_sym))
52
+ end
53
+
54
+ def to_h
55
+ @values.transform_values { |v| v.is_a?(self.class) ? v.to_h : v }
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SettingsCabinet
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "settings_cabinet/version"
4
+
5
+ require_relative "settings_cabinet/base"
6
+ require_relative "settings_cabinet/dsl"
7
+ require_relative "settings_cabinet/control"
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/settings_cabinet/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "settings_cabinet"
7
+ spec.version = SettingsCabinet::VERSION
8
+ spec.authors = ["Yuji Hanamura"]
9
+ spec.email = ["yuji.developer@gmail.com"]
10
+
11
+ spec.summary = "A simple settings solution with ERB-enabled YAML file"
12
+ spec.description = "A simple settings solution with ERB-enabled YAML file"
13
+ spec.homepage = "https://github.com/yujideveloper/settings_cabinet"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.7.0"
16
+
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = spec.homepage
21
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/tree/main/CHANGELOG.md"
22
+
23
+ spec.metadata["rubygems_mfa_required"] = "true"
24
+
25
+ # Specify which files should be added to the gem when it is released.
26
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
+ `git ls-files -z`.split("\x0").reject do |f|
29
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
30
+ end
31
+ end
32
+ spec.bindir = "exe"
33
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
34
+ spec.require_paths = ["lib"]
35
+
36
+ # Uncomment to register a new dependency of your gem
37
+ # spec.add_dependency "example-gem", "~> 1.0"
38
+
39
+ # For more information and examples about making a new gem, check out our
40
+ # guide at: https://bundler.io/guides/creating_gem.html
41
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: settings_cabinet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Yuji Hanamura
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-04-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple settings solution with ERB-enabled YAML file
14
+ email:
15
+ - yuji.developer@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rspec"
21
+ - ".rubocop.yml"
22
+ - CHANGELOG.md
23
+ - CODE_OF_CONDUCT.md
24
+ - Gemfile
25
+ - LICENSE.txt
26
+ - README.md
27
+ - Rakefile
28
+ - lib/settings_cabinet.rb
29
+ - lib/settings_cabinet/base.rb
30
+ - lib/settings_cabinet/configuration.rb
31
+ - lib/settings_cabinet/control.rb
32
+ - lib/settings_cabinet/dsl.rb
33
+ - lib/settings_cabinet/instance.rb
34
+ - lib/settings_cabinet/settings.rb
35
+ - lib/settings_cabinet/version.rb
36
+ - settings_cabinet.gemspec
37
+ homepage: https://github.com/yujideveloper/settings_cabinet
38
+ licenses:
39
+ - MIT
40
+ metadata:
41
+ allowed_push_host: https://rubygems.org
42
+ homepage_uri: https://github.com/yujideveloper/settings_cabinet
43
+ source_code_uri: https://github.com/yujideveloper/settings_cabinet
44
+ changelog_uri: https://github.com/yujideveloper/settings_cabinet/tree/main/CHANGELOG.md
45
+ rubygems_mfa_required: 'true'
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.7.0
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubygems_version: 3.3.7
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: A simple settings solution with ERB-enabled YAML file
65
+ test_files: []