configem 1.0.1 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -5
- data/lib/configem.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48ed3b022f9c657bf2380dd9afb62d8e8c9e4bdf74b955ff3084acea1cbdb616
|
4
|
+
data.tar.gz: 65f19837f6e68ed98d6d7c150d4fc1d08e68614bc74c9aa82e0ad0907ab84ec9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 973d7cfcbe2f0ae283a1c09dea672e0f0f881a7f6efdffc344065b97ddb43c4c80fe86ae8bfce8ab866d059f8aab88e7d43e557822a14774e87f0ec956131807
|
7
|
+
data.tar.gz: fea479fbc49f349bb6d649d98186e590f0056d6f51ec99512c1cb98855c8948b0cdf8184e967825cc3ecb1adf5bc4ccb6f91d05d44883e684ae877ebd96d699d
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Configem
|
2
2
|
|
3
|
+
[![Ruby](https://github.com/alekpopovic/configem/actions/workflows/ruby.yml/badge.svg)](https://github.com/alekpopovic/configem/actions/workflows/ruby.yml)
|
4
|
+
|
5
|
+
[![Ruby Gem](https://github.com/alekpopovic/configem/actions/workflows/gem-push.yml/badge.svg)](https://github.com/alekpopovic/configem/actions/workflows/gem-push.yml)
|
6
|
+
|
3
7
|
A simple mixin to add configuration functionality to your classes
|
4
8
|
|
5
9
|
## Installation
|
@@ -8,22 +12,50 @@ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with
|
|
8
12
|
|
9
13
|
Install the gem and add to the application's Gemfile by executing:
|
10
14
|
|
11
|
-
$ bundle add
|
15
|
+
$ bundle add configem
|
12
16
|
|
13
17
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
14
18
|
|
15
|
-
$ gem install
|
19
|
+
$ gem install configem
|
16
20
|
|
17
21
|
## Usage
|
18
22
|
|
19
|
-
|
23
|
+
```sh
|
24
|
+
class Example1
|
25
|
+
include Configem
|
26
|
+
end
|
27
|
+
|
28
|
+
class Example2
|
29
|
+
extend Configem
|
30
|
+
end
|
31
|
+
|
32
|
+
class Example3
|
33
|
+
prepend Configem
|
34
|
+
end
|
35
|
+
|
36
|
+
Example1.configure do |config|
|
37
|
+
config.api_key_1 = "api_key_1_value"
|
38
|
+
end
|
39
|
+
|
40
|
+
Example2.configure do |config|
|
41
|
+
config.api_key_2 = "api_key_2_value"
|
42
|
+
end
|
43
|
+
|
44
|
+
Example3.configure do |config|
|
45
|
+
config.api_key_3 = "api_key_3_value"
|
46
|
+
end
|
47
|
+
|
48
|
+
puts Example1.config.api_key_1
|
49
|
+
|
50
|
+
puts Example2.config.api_key_2
|
51
|
+
|
52
|
+
puts Example3.config.api_key_3
|
53
|
+
```
|
20
54
|
|
21
55
|
## Development
|
22
56
|
|
23
57
|
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.
|
24
58
|
|
25
|
-
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).
|
26
|
-
|
27
59
|
## Contributing
|
28
60
|
|
29
61
|
Bug reports and pull requests are welcome on GitHub at https://github.com/alekpopovic/configem/issues. 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/alekpopovic/configem/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/configem.rb
CHANGED