spanned 0.1.0.pre.beta → 0.1.2.pre.beta
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/.github/workflows/ruby.yml +31 -31
- data/CHANGELOG.md +2 -1
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/spanned/version.rb +1 -1
- data/lib/spanned.rb +17 -2
- metadata +3 -3
- /data/{lightgraf.gemspec → spanned.gemspec} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e35776a4275f8b491951d490fec98b0bc6c2ff0968ee0b7dad66a60980b4cf72
|
4
|
+
data.tar.gz: 6671327641e26100d5c168d7a12c13403cebd862280c5cff58c7dfeb4de67b4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fd27082485cda757bd3a1b9f9d6e533143f9c7891adb8d3d24102164cfad8ed595d786db5492900542096406f68cf4d3de9bbcaffdf8990d0dc4e47dc773006
|
7
|
+
data.tar.gz: b42396fcee0d474a7383ced59025236fc0c5bee267333f931cf443ab8e8981b6133fcce54ccf587bcdcd4982f0f684aa09c3b40338b00a3fd448c5ed37741cfe
|
data/.github/workflows/ruby.yml
CHANGED
@@ -5,34 +5,34 @@
|
|
5
5
|
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
6
|
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ "master" ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ "master" ]
|
15
|
+
|
16
|
+
permissions:
|
17
|
+
contents: read
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
test:
|
21
|
+
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
strategy:
|
24
|
+
matrix:
|
25
|
+
ruby-version: ['3.1']
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v3
|
29
|
+
- name: Set up Ruby
|
30
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
31
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
32
|
+
# uses: ruby/setup-ruby@v1
|
33
|
+
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
|
34
|
+
with:
|
35
|
+
ruby-version: ${{ matrix.ruby-version }}
|
36
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
37
|
+
- name: Run tests
|
38
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
##
|
1
|
+
## In this update
|
2
|
+
- Now ignoring tags
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/spanned/version.rb
CHANGED
data/lib/spanned.rb
CHANGED
@@ -15,13 +15,28 @@ module Spanned
|
|
15
15
|
# == Parameters:
|
16
16
|
# +text+:: +Str+: Text to include spans in
|
17
17
|
# +span_class+:: Optional +Str+: class to apply to every span
|
18
|
+
# +ignore+:: Optional +Arr+: chars to skip
|
18
19
|
# == Returns:
|
19
20
|
# +Str+:: Formatted text
|
20
|
-
def self.explode(text, span_class: nil)
|
21
|
+
def self.explode(text, span_class: nil, ignore: nil)
|
21
22
|
r = ''
|
23
|
+
in_tag = false
|
24
|
+
leave_tag = false
|
22
25
|
open = span_class.nil? ? %(<span>) : %(<span class="#{span_class}">)
|
23
26
|
text.each_char do |i|
|
24
|
-
|
27
|
+
if i == '<'
|
28
|
+
in_tag = true
|
29
|
+
elsif i == '>'
|
30
|
+
leave_tag = true
|
31
|
+
elsif leave_tag
|
32
|
+
in_tag = leave_tag = false
|
33
|
+
end
|
34
|
+
r +=
|
35
|
+
if ignore&.include?(i) or in_tag
|
36
|
+
i
|
37
|
+
else
|
38
|
+
"#{open}#{i}</span>"
|
39
|
+
end
|
25
40
|
end
|
26
41
|
r
|
27
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spanned
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aydar N.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,7 +100,7 @@ files:
|
|
100
100
|
- bin/setup
|
101
101
|
- lib/spanned.rb
|
102
102
|
- lib/spanned/version.rb
|
103
|
-
-
|
103
|
+
- spanned.gemspec
|
104
104
|
homepage: https://rubygems.org/gems/spanned
|
105
105
|
licenses:
|
106
106
|
- MIT
|
File without changes
|