chic 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/pr-updated.yml +29 -0
- data/chic.gemspec +1 -1
- data/lib/chic/formats.rb +2 -1
- data/lib/chic/formatter.rb +10 -2
- data/lib/chic/presents.rb +1 -1
- data/lib/chic/version.rb +1 -1
- data/lib/chic.rb +2 -0
- metadata +10 -10
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f1e33c29c46b9b252242a63738d36d8c0df73c376e28fb48cbd523714c1457b
|
4
|
+
data.tar.gz: 3fc457a2964db0476da406ec8fb65e218708a71664401214021ad10f169a1d2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351e6e91852b4d8d99c49e0e17e5a5be9b27a0f8fe945efde4557710deae561db4aa02eb2498f17246d19d8fe1ec33dc855ee122e7659bce5c239d090e52a8b8
|
7
|
+
data.tar.gz: cdfd46826892dd382bc5bd04484eadccce465b5577102df406bd56d1228f56a8d18113fbba93929a73c33c646c536b73771135c74b6b543fbb812416b725ebc3
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: pr-updated
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
types:
|
5
|
+
- opened
|
6
|
+
- synchronize
|
7
|
+
jobs:
|
8
|
+
run_lint:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v4
|
12
|
+
- name: Set up Ruby
|
13
|
+
uses: ruby/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
bundler-cache: true
|
16
|
+
ruby-version: 3.2.2
|
17
|
+
- name: Run Rubocop
|
18
|
+
run: bundle exec rubocop lib
|
19
|
+
run_tests:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v4
|
23
|
+
- name: Set up Ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
bundler-cache: true
|
27
|
+
ruby-version: 3.2.2
|
28
|
+
- name: Test
|
29
|
+
run: bundle exec rake test
|
data/chic.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.required_ruby_version = '>= 2.7'
|
27
27
|
|
28
|
-
spec.add_development_dependency 'bundler', '~> 2.
|
28
|
+
spec.add_development_dependency 'bundler', '~> 2.4'
|
29
29
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
30
30
|
spec.add_development_dependency 'rake', '~> 13.0'
|
31
31
|
spec.add_development_dependency 'rubocop', '~> 0.71'
|
data/lib/chic/formats.rb
CHANGED
@@ -110,7 +110,8 @@ module Chic
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def format(value, with: nil, **options)
|
113
|
-
|
113
|
+
formatter_context = respond_to?(:context) ? context : nil
|
114
|
+
_formatter_class(with).new(value, formatter_context).tap do |formatter|
|
114
115
|
options.each do |option, argument|
|
115
116
|
formatter.public_send(option, argument) if formatter.respond_to?(option)
|
116
117
|
end
|
data/lib/chic/formatter.rb
CHANGED
@@ -2,11 +2,19 @@
|
|
2
2
|
|
3
3
|
module Chic
|
4
4
|
class Formatter < SimpleDelegator
|
5
|
-
|
6
|
-
|
5
|
+
attr_reader :context
|
6
|
+
|
7
|
+
def initialize(object, context = nil)
|
8
|
+
super(object)
|
9
|
+
@context = context
|
10
|
+
end
|
7
11
|
|
8
12
|
def object
|
9
13
|
__getobj__
|
10
14
|
end
|
15
|
+
|
16
|
+
def to_s
|
17
|
+
object.to_s
|
18
|
+
end
|
11
19
|
end
|
12
20
|
end
|
data/lib/chic/presents.rb
CHANGED
data/lib/chic/version.rb
CHANGED
data/lib/chic.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lawrance Shepstone
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: '2.4'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: '2.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,16 +66,16 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.71'
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email:
|
71
71
|
- lawrance@collabcollective.com
|
72
72
|
executables: []
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
+
- ".github/workflows/pr-updated.yml"
|
76
77
|
- ".gitignore"
|
77
78
|
- ".rubocop.yml"
|
78
|
-
- ".travis.yml"
|
79
79
|
- CODE_OF_CONDUCT.md
|
80
80
|
- Gemfile
|
81
81
|
- LICENSE.txt
|
@@ -104,7 +104,7 @@ homepage: https://github.com/collcoll/chic
|
|
104
104
|
licenses:
|
105
105
|
- MIT
|
106
106
|
metadata: {}
|
107
|
-
post_install_message:
|
107
|
+
post_install_message:
|
108
108
|
rdoc_options: []
|
109
109
|
require_paths:
|
110
110
|
- lib
|
@@ -119,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
123
|
-
signing_key:
|
122
|
+
rubygems_version: 3.4.10
|
123
|
+
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Opinionated presentation layer comprised of presenters and formatters.
|
126
126
|
test_files: []
|