fittings 1.0.0 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b679fb549952c6427c53415d90f4e0c2d4acd07483062ff3b7b78fa0c4fec455
4
- data.tar.gz: 1718401ee1f52d5da4a52add3fdb1a002ffeb68b469e318604dd3971040dd667
3
+ metadata.gz: caecbb60f8fcd01f6487054124746dab9891db42699a575112fb641c3fbbbbd4
4
+ data.tar.gz: eefb06bd4cc4f11384582ee87c6b48870300ca28e9c39cfb51be25b4c8df2fe0
5
5
  SHA512:
6
- metadata.gz: 94f30339ca45d20fa0ce9cf9c5aa7bef61c5af8e1e679f057be084f0bb1f36771461f4601366efacbbfca7fe414c9d670dc83af8c9d15d8440312021e461b39b
7
- data.tar.gz: 34d94ac4bdd9d6b462423620b0e321b3cfc4ed18380611c99355e81c78c2ffc2b2b68a1a7c50cc24854411d3ea504b80c0faa5cdf3bfa7636e9bedb84dc8e414
6
+ metadata.gz: e9d4ee552dbe4e19299c57cd70973755203573d0851f0c48af37532c9b97715835fc0a981fa0a9a90fed745c520279a146d5e6761b1bc7beeacced4d024510de
7
+ data.tar.gz: 2639d507e51bd6b4b13b3d5730e711cb9fc38267c0d811c996f666ffc98ab3cd2a5ebc6a7b5c1d1007fa17cc6d897e4051620877d5fe71db0b301047855f1543
data/.circleci/config.yml CHANGED
@@ -1,11 +1,30 @@
1
1
  # DO NOT MODIFY - this is managed by Git Reduce in goro and generated from build-matrix.json
2
2
  #
3
3
  ---
4
- version: 2
4
+ version: 2.1
5
+
6
+ ############
7
+ ## Github Actions Pipeline Params
8
+ ############
9
+
10
+ parameters:
11
+ GHA_Event:
12
+ type: string
13
+ default: ""
14
+ GHA_Actor:
15
+ type: string
16
+ default: ""
17
+ GHA_Action:
18
+ type: string
19
+ default: ""
20
+ GHA_Meta:
21
+ type: string
22
+ default: ""
23
+
5
24
  jobs:
6
25
  generate-and-push-docs:
7
26
  docker:
8
- - image: cimg/ruby:3.1.2
27
+ - image: cimg/ruby:3.1.3
9
28
  auth:
10
29
  username: "$DOCKERHUB_USERNAME"
11
30
  password: "$DOCKERHUB_PASSWORD"
@@ -26,7 +45,7 @@ jobs:
26
45
  docs:push; fi
27
46
  release:
28
47
  docker:
29
- - image: cimg/ruby:3.1.2
48
+ - image: cimg/ruby:3.1.3
30
49
  auth:
31
50
  username: "$DOCKERHUB_USERNAME"
32
51
  password: "$DOCKERHUB_PASSWORD"
@@ -41,9 +60,9 @@ jobs:
41
60
  - run:
42
61
  name: Build/release gem to artifactory
43
62
  command: bundle exec rake push_artifactory
44
- ruby-3.1.2:
63
+ ruby-3_1_3:
45
64
  docker:
46
- - image: cimg/ruby:3.1.2
65
+ - image: cimg/ruby:3.1.3
47
66
  auth:
48
67
  username: "$DOCKERHUB_USERNAME"
49
68
  password: "$DOCKERHUB_PASSWORD"
@@ -69,9 +88,9 @@ jobs:
69
88
  when: on_fail
70
89
  - store_test_results:
71
90
  path: "/tmp/test-results"
72
- ruby-3.0.4:
91
+ ruby-3_0_5:
73
92
  docker:
74
- - image: cimg/ruby:3.0.4
93
+ - image: cimg/ruby:3.0.5
75
94
  auth:
76
95
  username: "$DOCKERHUB_USERNAME"
77
96
  password: "$DOCKERHUB_PASSWORD"
@@ -104,11 +123,11 @@ workflows:
104
123
  - release:
105
124
  context: org-global
106
125
  requires:
107
- - ruby-3.1.2
108
- - ruby-3.0.4
126
+ - ruby-3_1_3
127
+ - ruby-3_0_5
109
128
  filters:
110
129
  tags:
111
- only: /^[0-9]+\.[0-9]+\.[0-9]+((-|\.)?(RC|rc)[-\.]?\w*)?$/
130
+ only: /^[0-9]+\.[0-9]+\.[0-9]+((-|\.)?(RC|rc)[-.]?\w*)?$/
112
131
  branches:
113
132
  ignore: /.*/
114
133
  - generate-and-push-docs:
@@ -117,29 +136,24 @@ workflows:
117
136
  - release
118
137
  filters:
119
138
  tags:
120
- only: /^[0-9]+\.[0-9]+\.[0-9]+((-|\.)?(RC|rc)[-\.]?\w*)?$/
139
+ only: /^[0-9]+\.[0-9]+\.[0-9]+((-|\.)?(RC|rc)[-.]?\w*)?$/
121
140
  branches:
122
141
  ignore: /.*/
123
- - ruby-3.1.2:
142
+ - ruby-3_1_3:
124
143
  context: org-global
125
144
  filters:
126
145
  tags:
127
146
  only: &1 /.*/
128
- - ruby-3.0.4:
147
+ - ruby-3_0_5:
129
148
  context: org-global
130
149
  filters:
131
150
  tags:
132
151
  only: *1
133
152
  scheduled:
134
- triggers:
135
- - schedule:
136
- cron: 26 18 * * 1,2,3,4,5
137
- filters:
138
- branches:
139
- only:
140
- - main
153
+ when:
154
+ equal: [ "schedule", << pipeline.parameters.GHA_Event >> ]
141
155
  jobs:
142
- - ruby-3.1.2:
156
+ - ruby-3_1_3:
143
157
  context: org-global
144
- - ruby-3.0.4:
158
+ - ruby-3_0_5:
145
159
  context: org-global
@@ -0,0 +1,14 @@
1
+ on:
2
+ schedule:
3
+ - cron: '26 18 * * 1,2,3,4,5'
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ trigger-circleci:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: CircleCI trigger on schedule
11
+ id: step1
12
+ uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5
13
+ env:
14
+ CCI_TOKEN: ${{ secrets.CCI_TOKEN || secrets.CCI_TOKEN_FOR_PUBLIC_REPOS }}
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ ruby-3.0.4
data/fittings.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "fittings"
3
- s.version = "1.0.0"
3
+ s.version = "2.0.0"
4
4
 
5
5
  s.authors = ["Edwin Cruz", "Colin Shield"]
6
6
  s.date = %q{2011-09-06}
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
22
 
23
+ s.required_ruby_version = ">= 2.4.0"
23
24
  s.add_dependency "hashie"
24
25
  s.add_development_dependency "rspec"
25
26
  s.add_development_dependency "rake"
data/lib/setting.rb CHANGED
@@ -8,12 +8,13 @@ class Setting
8
8
  class FileError < RuntimeError; end
9
9
  class AlreadyLoaded < RuntimeError; end
10
10
 
11
+ class SettingHash < Hash
12
+ include Hashie::Extensions::IndifferentAccess
13
+ include Hashie::Extensions::KeyConversion
14
+ include Hashie::Extensions::DeepMerge
15
+ end
16
+
11
17
  include Singleton
12
- NUM_KLASS = if RUBY_VERSION.split(/\./)[0].to_i == 2 && RUBY_VERSION.split(/\./)[1].to_i >= 4
13
- Integer
14
- else
15
- Fixnum
16
- end
17
18
 
18
19
  attr_reader :available_settings
19
20
 
@@ -87,7 +88,7 @@ class Setting
87
88
  #=================================================================
88
89
 
89
90
  def initialize
90
- @available_settings ||= Hashie::Mash.new
91
+ @available_settings ||= SettingHash.new
91
92
  end
92
93
 
93
94
  def has_key?(key)
@@ -105,12 +106,15 @@ class Setting
105
106
  end
106
107
 
107
108
  v = @available_settings[name]
109
+ if v.is_a?(Hash)
110
+ v = SettingHash[v]
111
+ end
108
112
  if block_given?
109
113
  v = yield(v, args)
110
114
  end
111
115
 
112
116
 
113
- if v.is_a?(NUM_KLASS) && bool
117
+ if v.is_a?(Integer) && bool
114
118
  v.to_i > 0
115
119
  else
116
120
  v
@@ -151,7 +155,7 @@ class Setting
151
155
 
152
156
  def load(params)
153
157
  # reset settings hash
154
- @available_settings = Hashie::Mash.new
158
+ @available_settings = SettingHash.new
155
159
  @loaded = false
156
160
 
157
161
  files = []
@@ -170,9 +174,9 @@ class Setting
170
174
  # `load` is the behavior we want (in later versions, `load` uses `safe_load`, which doesn't support aliases and
171
175
  # requires allowlisting classes used in files.
172
176
  if Psych::VERSION < '3.3.2'
173
- @available_settings.deep_merge!(YAML::load(ERB.new(IO.read(file)).result) || {}) if File.exists?(file)
177
+ @available_settings.deep_merge!(YAML::load(ERB.new(IO.read(file)).result) || {}) if File.exist?(file)
174
178
  else
175
- @available_settings.deep_merge!(YAML::unsafe_load(ERB.new(IO.read(file)).result) || {}) if File.exists?(file)
179
+ @available_settings.deep_merge!(YAML::unsafe_load(ERB.new(IO.read(file)).result) || {}) if File.exist?(file)
176
180
  end
177
181
  rescue Exception => e
178
182
  raise FileError.new("Error parsing file #{file}, with: #{e.message}")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fittings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edwin Cruz
@@ -92,11 +92,11 @@ files:
92
92
  - ".circleci/config.yml"
93
93
  - ".github/CODEOWNERS"
94
94
  - ".github/PULL_REQUEST_TEMPLATE.md"
95
+ - ".github/workflows/scheduled_cci.yml"
95
96
  - ".gitignore"
96
97
  - ".ruby-gemset"
97
98
  - ".ruby-version"
98
99
  - ".travis.yml"
99
- - CHANGELOG.md
100
100
  - CODE_OF_CONDUCT.md
101
101
  - Gemfile
102
102
  - LICENSE.txt
@@ -122,14 +122,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
- version: '0'
125
+ version: 2.4.0
126
126
  required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubygems_version: 3.1.4
132
+ rubygems_version: 3.4.0.dev
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Manage settings per environment
data/CHANGELOG.md DELETED
@@ -1,12 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.0.0]
9
-
10
- ### Added
11
-
12
- - Switched to using `Hashie::Mash` for YAML parsing. This provides behavior that is more consistent, while remaining similar. It did not cause any tests to fail, but may be a breaking change depending on how you are using the gem.