spanned 0.1.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d7e1672f3f4e4fd398377af8b9a26da09d3c4206a4801380e98a4b44bb6ad02d
4
+ data.tar.gz: 3ddf4129259707ac420942d915c2a131be15b0fb0140fc1a72358bd1978bcd4d
5
+ SHA512:
6
+ metadata.gz: aefc9f66c26dc3d53c96650bd61f680f7a3c8a2b997d7705067cfe363970292b8a15fdc04f3fbb719e91587e5bd6fbbfbdf6071a9267424b84a25d07fdf69d80
7
+ data.tar.gz: 5f39a812fa344be83ec8621d248a08fcdadfcedbe1ad517e48631f7168cbdba974c01f478735237a113442dd648b2177fa590e78b6202682c98a6d361958fe4b
@@ -0,0 +1,38 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
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: ['2.6']
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/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /.idea/
10
+ *.gem
data/.rubocop.yml ADDED
@@ -0,0 +1,20 @@
1
+ Layout/IndentationStyle:
2
+ Enabled: false
3
+ Layout/IndentationWidth:
4
+ Enabled: false
5
+ Layout/FirstHashElementIndentation:
6
+ Enabled: false
7
+ Layout/LineLength:
8
+ Enabled: false
9
+ Layout/ArgumentAlignment:
10
+ Enabled: false
11
+ Layout/FirstArrayElementIndentation:
12
+ Enabled: false
13
+ Style/NumericLiterals:
14
+ Enabled: false
15
+ Style/AndOr:
16
+ Enabled: false
17
+ Metrics/BlockLength:
18
+ Enabled: false
19
+ Metrics/MethodLength:
20
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ ## Initial release
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in spanned.gemspec
8
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,47 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ spanned (0.1.0.pre.beta)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ irb (1.0.0)
11
+ json (2.6.3)
12
+ minitest (5.18.0)
13
+ parallel (1.23.0)
14
+ parser (3.2.2.1)
15
+ ast (~> 2.4.1)
16
+ rainbow (3.1.1)
17
+ rake (13.0.6)
18
+ regexp_parser (2.8.0)
19
+ rexml (3.2.5)
20
+ rubocop (1.50.2)
21
+ json (~> 2.3)
22
+ parallel (~> 1.10)
23
+ parser (>= 3.2.0.0)
24
+ rainbow (>= 2.2.2, < 4.0)
25
+ regexp_parser (>= 1.8, < 3.0)
26
+ rexml (>= 3.2.5, < 4.0)
27
+ rubocop-ast (>= 1.28.0, < 2.0)
28
+ ruby-progressbar (~> 1.7)
29
+ unicode-display_width (>= 2.4.0, < 3.0)
30
+ rubocop-ast (1.28.1)
31
+ parser (>= 3.2.1.0)
32
+ ruby-progressbar (1.13.0)
33
+ unicode-display_width (2.4.2)
34
+
35
+ PLATFORMS
36
+ ruby
37
+
38
+ DEPENDENCIES
39
+ bundler (>= 2.2.33)
40
+ irb
41
+ minitest (~> 5.0)
42
+ rake (~> 13.0)
43
+ rubocop
44
+ spanned!
45
+
46
+ BUNDLED WITH
47
+ 2.4.13
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Aydar N. (Sublime Merge MBP)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # Spanned
2
+ Helps wrap text in spans with classes
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ # Handcrafted by Aydar N.
2
+ # 2023
3
+ #
4
+ # me@aydar.media
5
+ #
6
+
7
+ # frozen_string_literal: true
8
+
9
+ require 'bundler/gem_tasks'
10
+ require 'rake/testtask'
11
+
12
+ Rake::TestTask.new(:test) do |t|
13
+ t.libs << 'test'
14
+ t.libs << 'lib'
15
+ t.test_files = FileList['test/**/*_test.rb'].exclude('test/**/*_bench_test.rb')
16
+ end
17
+
18
+ desc 'Run all tests'
19
+ task default: :test
20
+
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'spanned'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spanned
4
+ VERSION = '0.1.0-beta'
5
+ end
data/lib/spanned.rb ADDED
@@ -0,0 +1,29 @@
1
+ # Handcrafted by Aydar N.
2
+ # 2023
3
+ #
4
+ # me@aydar.media
5
+ #
6
+
7
+ # frozen_string_literal: true
8
+
9
+ # Contains main methods
10
+ module Spanned
11
+
12
+ class Error < StandardError; end
13
+
14
+ # Wraps every char of text in spans
15
+ # == Parameters:
16
+ # +text+:: +Str+: Text to include spans in
17
+ # +span_class+:: Optional +Str+: class to apply to every span
18
+ # == Returns:
19
+ # +Str+:: Formatted text
20
+ def self.explode(text, span_class: nil)
21
+ r = ''
22
+ open = span_class.nil? ? %(<span>) : %(<span class="#{span_class}">)
23
+ text.each_char do |i|
24
+ r += "#{open}#{i}</span>"
25
+ end
26
+ r
27
+ end
28
+
29
+ end
data/lightgraf.gemspec ADDED
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'spanned/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'spanned'
9
+ spec.version = Spanned::VERSION
10
+ spec.authors = ['Aydar N.']
11
+ spec.email = ['me@aydar.media']
12
+
13
+ spec.required_ruby_version = '>= 2.6.3'
14
+
15
+ spec.summary = 'Helps wrap text in spans with classes'
16
+ spec.description = 'Helpful if you are adding hover events on every letter or word of text'
17
+ spec.homepage = 'https://rubygems.org/gems/spanned'
18
+ spec.license = 'MIT'
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ end
25
+ spec.bindir = 'exe'
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ['lib']
28
+
29
+ spec.add_development_dependency 'bundler', '>= 2.2.33'
30
+ spec.add_development_dependency 'irb'
31
+ spec.add_development_dependency 'minitest', '~> 5.0'
32
+ spec.add_development_dependency 'rake', '~> 13.0'
33
+ spec.add_development_dependency 'rubocop'
34
+ end
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spanned
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.pre.beta
5
+ platform: ruby
6
+ authors:
7
+ - Aydar N.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.2.33
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.2.33
27
+ - !ruby/object:Gem::Dependency
28
+ name: irb
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '13.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '13.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Helpful if you are adding hover events on every letter or word of text
84
+ email:
85
+ - me@aydar.media
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".github/workflows/ruby.yml"
91
+ - ".gitignore"
92
+ - ".rubocop.yml"
93
+ - CHANGELOG.md
94
+ - Gemfile
95
+ - Gemfile.lock
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
99
+ - bin/console
100
+ - bin/setup
101
+ - lib/spanned.rb
102
+ - lib/spanned/version.rb
103
+ - lightgraf.gemspec
104
+ homepage: https://rubygems.org/gems/spanned
105
+ licenses:
106
+ - MIT
107
+ metadata: {}
108
+ post_install_message:
109
+ rdoc_options: []
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 2.6.3
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">"
120
+ - !ruby/object:Gem::Version
121
+ version: 1.3.1
122
+ requirements: []
123
+ rubygems_version: 3.3.7
124
+ signing_key:
125
+ specification_version: 4
126
+ summary: Helps wrap text in spans with classes
127
+ test_files: []