nac 1.0.0 → 1.1.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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +63 -0
- data/README.md +5 -2
- data/lib/nac.rb +2 -2
- data/lib/nac/config.rb +2 -2
- data/lib/nac/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 837ff4298f6eb2564098d5b5d800ab78d17fe8e0
|
4
|
+
data.tar.gz: c6cf7033d86c5f62eed05253f3ea903a966ed2c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f7c446625828310635e3d297886b36121f915218f39ecfd178c81f350df2a948135e7e1ee24ed284926ab909d52ce8ee07b3480fdf551f503f4d61b84039d80
|
7
|
+
data.tar.gz: fccb0d5802d84c23b849fe4ca190df1ee1a5c7cda548e7c22c29d95b4e96290542b06f49c117fc48f3e1328966ba40e3134b115e804bbb635e35cd8cedbb4231
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
# specify the version you desire here
|
10
|
+
#- image: circleci/ruby:2.4.1-node-browsers
|
11
|
+
- image: circleci/ruby:2.6.0-node
|
12
|
+
environment:
|
13
|
+
BUNDLER_VERSION: 2.0.1
|
14
|
+
|
15
|
+
|
16
|
+
# Specify service dependencies here if necessary
|
17
|
+
# CircleCI maintains a library of pre-built images
|
18
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
19
|
+
# - image: circleci/postgres:9.4
|
20
|
+
|
21
|
+
working_directory: ~/repo
|
22
|
+
|
23
|
+
steps:
|
24
|
+
- checkout
|
25
|
+
|
26
|
+
# Download and cache dependencies
|
27
|
+
- restore_cache:
|
28
|
+
keys:
|
29
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
30
|
+
# fallback to using the latest cache if no exact match is found
|
31
|
+
- v1-dependencies-
|
32
|
+
|
33
|
+
#- run:
|
34
|
+
# name: Configure Bundler
|
35
|
+
# command: |
|
36
|
+
# echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
|
37
|
+
# source $BASH_ENV
|
38
|
+
# gem install bundler
|
39
|
+
|
40
|
+
- run:
|
41
|
+
name: install dependencies
|
42
|
+
command: |
|
43
|
+
sudo gem update --system
|
44
|
+
sudo gem uninstall bundler
|
45
|
+
sudo rm /usr/local/bin/bundle
|
46
|
+
sudo rm /usr/local/bin/bundler
|
47
|
+
sudo gem install bundler
|
48
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
49
|
+
|
50
|
+
- save_cache:
|
51
|
+
paths:
|
52
|
+
- ./vendor/bundle
|
53
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
54
|
+
|
55
|
+
# run tests!
|
56
|
+
- run:
|
57
|
+
name: run tests
|
58
|
+
command: |
|
59
|
+
bundle exec rake test
|
60
|
+
|
61
|
+
# collect reports
|
62
|
+
- store_artifacts:
|
63
|
+
path: coverage
|
data/README.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
A very simple yet flexible configuration writer/reader library.
|
4
4
|
|
5
|
+
[](https://circleci.com/gh/chris-roerig/nac/tree/master)
|
6
|
+
[](https://codeclimate.com/github/chris-roerig/nac/maintainability)
|
7
|
+
|
5
8
|
## Installation
|
6
9
|
|
7
10
|
Add this line to your application's Gemfile:
|
@@ -58,7 +61,7 @@ require 'nac'
|
|
58
61
|
config = Nac::Config.new('my_config')
|
59
62
|
|
60
63
|
config.set(%[user name first], 'Homer')
|
61
|
-
config.set(%[user name last],
|
64
|
+
config.set(%[user name last], 'Simpson')
|
62
65
|
|
63
66
|
puts config.get('user')
|
64
67
|
#=> { name: { first: 'Homer', last: 'Simpson' }}
|
@@ -86,7 +89,7 @@ puts config.get(:look)
|
|
86
89
|
* `init!`: When true, force the configuration file to be rewritten. Default is `false`.
|
87
90
|
|
88
91
|
**Note:** One doesn't need to specify `init!` when using `template`.
|
89
|
-
The template will not be written if
|
92
|
+
The template will not be written if the configuration file exists.
|
90
93
|
However, using `init!` will re-initialize the config file and the
|
91
94
|
template *will* be written. Similarly, `template` is not required when
|
92
95
|
using `init!`.
|
data/lib/nac.rb
CHANGED
data/lib/nac/config.rb
CHANGED
@@ -21,7 +21,7 @@ module Nac
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def get(keys = nil)
|
24
|
+
def get(keys = nil, default = nil)
|
25
25
|
return @cache unless keys
|
26
26
|
|
27
27
|
val = @cache
|
@@ -32,7 +32,7 @@ module Nac
|
|
32
32
|
|
33
33
|
val
|
34
34
|
rescue NoMethodError
|
35
|
-
|
35
|
+
default
|
36
36
|
end
|
37
37
|
|
38
38
|
def set(keys, value)
|
data/lib/nac/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roerig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -157,6 +157,7 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
+
- ".circleci/config.yml"
|
160
161
|
- ".gitignore"
|
161
162
|
- ".rubocop.yml"
|
162
163
|
- ".travis.yml"
|