scriptify 0.1.1 → 0.2.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
  SHA1:
3
- metadata.gz: 8a62e728fe7d7229d615553d3823e361c68cbd93
4
- data.tar.gz: 22118c80d84ae82d3238bc3a2b04faae58161d68
3
+ metadata.gz: ae47b5f22d47ae4bcb320755b375cf2d33b67ade
4
+ data.tar.gz: 9241f79b6320f3c8ce198b30844c7629321fb379
5
5
  SHA512:
6
- metadata.gz: db740a8c63a34fed30d1ce981972e4b79641dbb535487c488ba1498072ea7973ef1103b75171739a0faa642a8749a2e949bd17a4f38dbd5eae343f3236e689fd
7
- data.tar.gz: d327a6d1e07d14c58bbbea32d49631b54fe096754279c764cbddffeee17dd23fa137456049a2cb5069d6d8e9f68ded4da74090041537eafe1fe64f2a03c1f08b
6
+ metadata.gz: a7d30f97ea1098ee39a58b7317d56bf8d62ae8131f81e89fdd46c036cd8f45b0a4091fdbaa0b8ef412263c271fce81c88796138b368eee5edceafbe193f5d566
7
+ data.tar.gz: 67bfac0882076f81b26faf66dd3f9fba35158a324f7ead13bc2814dd92b568c031427bb797fa209f4dafdef12b1b45b33598a4823d30f4c8e80b74ae7b92b1f9
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at xientyto@gmail.com. All
58
+ reported by contacting the project team at vicente.plata@points.com . All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- scriptify (0.1.0)
4
+ scriptify (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -32,4 +32,4 @@ DEPENDENCIES
32
32
  scriptify!
33
33
 
34
34
  BUNDLED WITH
35
- 1.16.1
35
+ 1.16.2
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  [![Build Status](https://travis-ci.org/xnt/scriptify.svg?branch=master)](https://travis-ci.org/xnt/scriptify)
4
4
  [![Gem Version](https://badge.fury.io/rb/scriptify.svg)](https://badge.fury.io/rb/scriptify)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/41a32a4fe69d448428fd/maintainability)](https://codeclimate.com/github/xnt/scriptify/maintainability)
6
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
7
+ [![first-timers-only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square)](https://www.firsttimersonly.com/)
6
8
 
7
9
  Transforms a text/string into a reasonably accurate uppercase representation.
8
10
 
@@ -64,10 +66,12 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
64
66
 
65
67
  Bug reports and pull requests are welcome on GitHub at https://github.com/xnt/scriptify. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
66
68
 
69
+ **Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
70
+
67
71
  ## License
68
72
 
69
73
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
70
74
 
71
75
  ## Code of Conduct
72
76
 
73
- Everyone interacting in the Scriptify project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/scriptify/blob/master/CODE_OF_CONDUCT.md).
77
+ Everyone interacting in the Scriptify project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/xnt/scriptify/blob/master/CODE_OF_CONDUCT.md).
@@ -8,19 +8,27 @@ module Scriptify
8
8
  }
9
9
 
10
10
  def superscript(opts = {})
11
+ scriptify(ScriptifyCatalog.superscripts, opts)
12
+ end
13
+
14
+ def subscript(opts = {})
15
+ scriptify(ScriptifyCatalog.subscripts, opts)
16
+ end
17
+
18
+ private
19
+ def scriptify(catalog, opts)
11
20
  opts.merge(DEFAULT_OPTS)
12
- superscripted = ""
21
+ scripted = ""
13
22
  self.to_s.split("").each do |c|
14
- superscripted += char_superscript(c, opts)
23
+ scripted += char_script(catalog, c, opts)
15
24
  end
16
- superscripted
25
+ scripted
17
26
  end
18
27
 
19
- private
20
- def char_superscript(char, opts)
28
+ def char_script(catalog, char, opts)
21
29
  sym = char.to_sym
22
- return ScriptifyCatalog.superscripts[sym] if ScriptifyCatalog.superscripts.key?(sym)
23
- return char_superscript(char.downcase, opts) if opts[:fallback_lower] && upcase?(char)
30
+ return catalog[sym] if catalog.key?(sym)
31
+ return char_script(catalog, char.downcase, opts) if opts[:fallback_lower] && upcase?(char)
24
32
  return opts[:replace_unknown] if opts[:replace_unknown]
25
33
  char
26
34
  end
@@ -49,7 +49,36 @@ class ScriptifyCatalog
49
49
  :z => 'ᶻ'
50
50
  }.freeze
51
51
 
52
+ @@SubScripts = {
53
+ :A => 'ₐ',
54
+ :E => 'ₑ',
55
+ :G => 'ᴳ',
56
+ :H => 'ᴴ',
57
+ :I => 'ᵢ',
58
+ :J => 'ⱼ',
59
+ :O => 'ₒ',
60
+ :R => 'ᵣ',
61
+ :U => 'ᵤ',
62
+ :V => 'ᵥ',
63
+ :X => 'ₓ',
64
+ :a => 'ₐ',
65
+ :e => 'ₑ',
66
+ :g => 'ᴳ',
67
+ :h => 'ᴴ',
68
+ :i => 'ᵢ',
69
+ :j => 'ⱼ',
70
+ :o => 'ₒ',
71
+ :r => 'ᵣ',
72
+ :u => 'ᵤ',
73
+ :v => 'ᵥ',
74
+ :x => 'ₓ'
75
+ }.freeze
76
+
52
77
  def self.superscripts
53
78
  @@SuperScripts
54
79
  end
80
+
81
+ def self.subscripts
82
+ @@SubScripts
83
+ end
55
84
  end
@@ -1,3 +1,3 @@
1
1
  module Scriptify
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scriptify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vicente Plata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-22 00:00:00.000000000 Z
11
+ date: 2018-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.5.2
97
+ rubygems_version: 2.6.14
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Generates subscript and superscript versions of a string.