ruby-exclaim 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c58fbe14b28a72c3f22279981f5f37c65a31120948f62acfaac8555944281c69
4
- data.tar.gz: 478d295febd82bb1bd4137578983578cb3d105c38bbcf241c48d4abbc13849cf
3
+ metadata.gz: 1c108c1900809559c4fbcd3b1488636b56190630bba66f5cdcaf620170c8d8e2
4
+ data.tar.gz: 61ec43e7d945f0e474bcd8778edc0c2b3119f3afcceaa30549f601f936c2bac0
5
5
  SHA512:
6
- metadata.gz: 7a8a70584a279e7c61d5aef6061c8a80095822f4526325278263b9bfca58ebf94a30e2893840eb98d73144baf1ea3be0d1d14330b0fd00ea05d5cca5724f2936
7
- data.tar.gz: da68180e51ef7c3d919d177d70bf621eda9435d59bf216b2b366c3ae67cda2b20b599d05706e6ca42e9cdadcfd3610b5fa6335598ab03ce3154598797965259c
6
+ metadata.gz: 470364f3b893180ece919ab1ab315ad12315d6a6673e6cb98f42ac03f836caadf6a50431af5dd2046bf527ce2f42ff62129f9462ecd3a51b3d6ec5f7dccb67a2
7
+ data.tar.gz: e12ff894c269e62ff479ad1c31f404a5da049a2273d290ac2f132585731b9bc2167c0893e74a18c9ebad11619b9925790c8991de2546ed78a1e95ac0e03eb5b4
data/.circleci/config.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  version: 2.1
2
+
2
3
  workflows:
3
4
  version: 2
4
5
  ruby-exclaim:
@@ -8,18 +9,19 @@ workflows:
8
9
  jobs:
9
10
  build:
10
11
  docker:
11
- - image: salsify/ruby_ci:2.7.2
12
+ - image: $SALSIFY_ECR_REPO/ruby_ci:3.3.5
13
+ aws_auth:
14
+ aws_access_key_id: $ECR_AWS_ACCESS_KEY_ID
15
+ aws_secret_access_key: $ECR_AWS_SECRET_ACCESS_KEY
12
16
  environment:
13
- RACK_ENV: "test"
14
- RAILS_ENV: "test"
15
17
  CIRCLE_TEST_REPORTS: "test-results"
16
18
  working_directory: ~/ruby-exclaim
17
19
  steps:
18
20
  - checkout
19
21
  - restore_cache:
20
22
  keys:
21
- - v1-gems-ruby-2.7.2-{{ checksum "ruby-exclaim.gemspec" }}-{{ checksum "Gemfile" }}
22
- - v1-gems-ruby-2.7.2-
23
+ - v1-gems-ruby-3.3.5-{{ checksum "ruby-exclaim.gemspec" }}-{{ checksum "Gemfile" }}
24
+ - v1-gems-ruby-3.3.5-
23
25
  - run:
24
26
  name: Install Gems
25
27
  command: |
@@ -28,7 +30,7 @@ jobs:
28
30
  bundle clean
29
31
  fi
30
32
  - save_cache:
31
- key: v1-gems-ruby-2.7.2-{{ checksum "ruby-exclaim.gemspec" }}-{{ checksum "Gemfile" }}
33
+ key: v1-gems-ruby-3.3.5-{{ checksum "ruby-exclaim.gemspec" }}-{{ checksum "Gemfile" }}
32
34
  paths:
33
35
  - "vendor/bundle"
34
36
  - "gemfiles/vendor/bundle"
@@ -0,0 +1 @@
1
+ * @skarger
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.1.1 - 2024-11-18
10
+ ### Fixed
11
+ - Fix various issues related to path segments that appear to be numbers.
12
+
9
13
  ## 0.1.0 - 2021-05-06
10
14
  ### Added
11
15
  - Ability to disable all HTML escaping by setting the `should_escape_html` flag to `false` when instantiating
data/README.md CHANGED
@@ -220,10 +220,8 @@ exclaim_ui.render(env: my_environment)
220
220
 
221
221
  Dot-separated `$bind` paths dig into nested `env` values: `a.b.c` refers to `{ "a" => { "b" => { "c" => "value" } } }`
222
222
 
223
- If a `$bind` path segment is an Integer,
224
- the library will attempt to treat it as an Array index when resolving the value at render time:
225
-
226
- `"my_array.1"` refers to array index 1 in an `env` like `{ "my_array: ["zero", "one", ...] }`
223
+ If the field a `$bind` subpath refers is an Array, the next segment is assumed to be an integer. For example,
224
+ `"my_array.1"` refers to array index 1, value "zero" in an `env` like `{ "my_array: ["zero", "one", ...] }`.
227
225
 
228
226
  ### Implementing Components and Helpers
229
227
 
@@ -800,7 +798,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then,
800
798
  run `rake spec` to run the tests. You can also run `bin/console` for an
801
799
  interactive prompt that will allow you to experiment.
802
800
 
803
- To install this gem onto your local machine, run `bundle exec rake install`.
801
+ To install this gem onto your local machine, run `bundle exec rake install`.
804
802
 
805
803
  To release a new version, update the version number in `version.rb`. When merged
806
804
  to the default branch, [a GitHub action](.github/workflows/release.yml) will
data/lib/exclaim/bind.rb CHANGED
@@ -14,15 +14,27 @@ module Exclaim
14
14
  def path=(value)
15
15
  @path = value
16
16
  @path_keys = @path.split('.')
17
- @path_keys_for_arrays = @path_keys.map do |string|
18
- Integer(string)
19
- rescue ArgumentError, TypeError
20
- string
21
- end
22
17
  end
23
18
 
24
19
  def evaluate(env)
25
- env.dig(*@path_keys_for_arrays) || env.dig(*@path_keys)
20
+ obj = env
21
+
22
+ @path_keys.each do |key|
23
+ return nil if !obj.is_a?(Hash) && !obj.is_a?(Array)
24
+
25
+ if obj.is_a?(Array)
26
+ key = begin
27
+ Integer(key)
28
+ rescue ArgumentError, TypeError
29
+ return nil
30
+ end
31
+ end
32
+
33
+ obj = obj[key]
34
+ return nil if obj.nil?
35
+ end
36
+
37
+ obj
26
38
  end
27
39
  end
28
40
  end
@@ -14,8 +14,7 @@ module Exclaim
14
14
  extend self
15
15
 
16
16
  def example_implementation_map
17
- @example_implementation_map ||= begin
18
- {
17
+ @example_implementation_map ||= {
19
18
  'each' => EACH_COMPONENT,
20
19
  'image' => IMAGE_COMPONENT,
21
20
  'if' => IF_HELPER,
@@ -25,7 +24,7 @@ module Exclaim
25
24
  'text' => TEXT_COMPONENT,
26
25
  'vbox' => VBOX_COMPONENT
27
26
  }
28
- end
27
+
29
28
  end
30
29
  end
31
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exclaim
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
data/ruby-exclaim.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  # Set 'allowed_push_post' to control where this gem can be published.
21
21
  if spec.respond_to?(:metadata)
22
22
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
23
-
23
+ spec.metadata['rubygems_mfa_required'] = 'true'
24
24
  else
25
25
  raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-exclaim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salsify, Inc
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-06 00:00:00.000000000 Z
11
+ date: 2024-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -104,7 +104,7 @@ extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
106
  - ".circleci/config.yml"
107
- - ".github/workflows/release.yml"
107
+ - ".github/CODEOWNERS"
108
108
  - ".gitignore"
109
109
  - ".overcommit.yml"
110
110
  - ".rspec"
@@ -144,7 +144,8 @@ licenses:
144
144
  - MIT
145
145
  metadata:
146
146
  allowed_push_host: https://rubygems.org
147
- post_install_message:
147
+ rubygems_mfa_required: 'true'
148
+ post_install_message:
148
149
  rdoc_options: []
149
150
  require_paths:
150
151
  - lib
@@ -159,8 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
160
  - !ruby/object:Gem::Version
160
161
  version: '0'
161
162
  requirements: []
162
- rubygems_version: 3.2.11
163
- signing_key:
163
+ rubygems_version: 3.3.26
164
+ signing_key:
164
165
  specification_version: 4
165
166
  summary: Ruby utilities for Exclaim UIs
166
167
  test_files: []
@@ -1,29 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- check_suite:
5
- types: [completed]
6
-
7
- jobs:
8
- release:
9
- name: Check and Release New Version
10
- runs-on: ubuntu-latest
11
- # `github.ref` from the `check_suite` trigger is always the default branch
12
- if: format('refs/heads/{0}', github.event.check_suite.head_branch) == github.ref && github.event.check_suite.conclusion == 'success'
13
- steps:
14
- - name: Checkout Code
15
- uses: actions/checkout@v2
16
- with:
17
- fetch-depth: 2
18
-
19
- - name: Setup Ruby
20
- uses: actions/setup-ruby@v1
21
- with:
22
- ruby-version: 2.6
23
-
24
- - name: Release Gem
25
- id: release-gem
26
- uses: salsify/action-release-gem@v1.1.0
27
- env:
28
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
- RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}