pretty_magic 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 99c7bdcae72b8bf67c0859e4dcfad0380fe794aade6126b598e5d054d07b781e
4
- data.tar.gz: f7b27e6a93e62cf9e450e54470a94f85761bca0972d3a753b05eb4029d869bd9
3
+ metadata.gz: bb14207df21c28cc729a5b92178461c02a41a1c4636996f0a1826cc93935ed91
4
+ data.tar.gz: 4f1df718d69b757a30873b0a08cc16593064f2195fb94c1daa1afa3d2badff1b
5
5
  SHA512:
6
- metadata.gz: 8a138a8a247bbd007d36c5b4bb569bff5ffee068ceb4d372edc22037e749ed06cd2df6e238d6e58644a689c183f0b72b7de4c112f5b19493a6fed2443462896b
7
- data.tar.gz: 46a628bbd16299a73f679e2337810aa0a75789fac9f329ea3e3b8072d6a0339eea82d854f7fa79889eb09065cc10fdfa9abaa7e3a25844f83717ca11663c9925
6
+ metadata.gz: 27e4c928c2ca6a978df8a2118d47d1addda02ae4dd3f0643ed54d675413d7bd3c7017757d5a5f9b32a99a35884a361e33a44163bc48590253052cab0d05f37c2
7
+ data.tar.gz: 1989fdb36d44bcfaa4bb19db4620084e7ac2ee2a8c70a112226e68ce2f39479a2a72eabf67e4eb8f3793bbced8c80cc46e7c0bbf9f730b89c1858c5f945857bb
@@ -0,0 +1,33 @@
1
+ # This is a basic workflow to help you get started with Actions
2
+
3
+ name: CI
4
+
5
+ # Controls when the action will run. Triggers the workflow on push or pull request
6
+ # events but only for the master branch
7
+ on:
8
+ push:
9
+ branches: [ master ]
10
+ pull_request:
11
+ branches: [ master ]
12
+
13
+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
14
+ jobs:
15
+ # This workflow contains a single job called "build"
16
+ build:
17
+ # The type of runner that the job will run on
18
+ runs-on: ubuntu-latest
19
+
20
+ # Steps represent a sequence of tasks that will be executed as part of the job
21
+ steps:
22
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23
+ - uses: actions/checkout@v2
24
+
25
+ # Runs a single command using the runners shell
26
+ - name: Run a one-line script
27
+ run: echo Hello, world!
28
+
29
+ # Runs a set of commands using the runners shell
30
+ - name: Run a multi-line script
31
+ run: |
32
+ echo Add other actions to build,
33
+ echo test, and deploy your project.
@@ -0,0 +1,2 @@
1
+ tasks:
2
+ - init: bundle install
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pretty_magic (0.1.0)
4
+ pretty_magic (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,8 +1,12 @@
1
+ [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/danwiseman/pretty_magic)
2
+
1
3
  # PrettyMagic
2
4
 
3
5
  Pretty Magic takes text in curly brackets as used on the [Scryfall API](https://scryfall.com/docs/api/colors) as well as other text
4
6
  and puts them into `<i>` html tags for use with the [andrewgioia/mana](https://github.com/andrewgioia/mana) and [andrewgioia/keyrune](https://github.com/andrewgioia/keyrune) fonts.
5
7
 
8
+ [![Codeship Status for danwiseman/pretty_magic](https://app.codeship.com/projects/6ca8b980-d10e-0138-83ee-46ba07b94fb7/status?branch=master)](https://app.codeship.com/projects/408163)
9
+
6
10
  ## Installation
7
11
 
8
12
  Add this line to your application's Gemfile:
@@ -29,11 +33,18 @@ Run `PrettyMagic::ManaIcons.guild_symbols("{GUILD}")` to get html tags for the G
29
33
 
30
34
  Run `PrettyMagic::ManaIcons.poleis_symbols("{POLEIS}")` to get html tags for the Poleis Symbols as documented at https://mana.andrewgioia.com/icons.html
31
35
 
36
+ Run `PrettyMagic::ManaIcons.add_icons_to_text("YOUR TEXT WITH TAGS IN IT")` to have all four symbol types ran against a long piece of text. Such as the Oracle
37
+ Text of a card. i.e. `{X}{B/P}: Remove up to X counters from target permanent. For each counter removed this way, Hex Parasite gets +1/+0 until end of turn. ({B/P} can be paid with either {B} or 2 life.)`
38
+
39
+ Run `PrettyMagic::KeyruneIcons.set_symbols("{SET_CODE}")` to get the html tags for the set symbols as documented at https://keyrune.andrewgioia.com/icons.html
40
+
32
41
  Also, ensure the fonts are installed as documented on the fonts' githubs.
33
42
 
34
43
  ## Notes
35
44
 
36
- Keyrune is not yet adapted.
45
+ :information_source: Mana Font: 1.6.0
46
+
47
+ :information_source: Keyrune Font: 3.7.0
37
48
 
38
49
  ## Development
39
50
 
@@ -1,5 +1,6 @@
1
1
  require "pretty_magic/version"
2
2
  require "pretty_magic/mana_icons"
3
+ require "pretty_magic/keyrune_icons"
3
4
 
4
5
  module PrettyMagic
5
6
  class Error < StandardError; end
@@ -0,0 +1,41 @@
1
+ module PrettyMagic
2
+ module KeyruneIcons
3
+ module ClassMethods
4
+ def set_symbols(set_code, options = {})
5
+ options = {color: 'common', size: 1, fixed_width: false, gradient: false}.merge(options)
6
+
7
+ prettySymbol = "ss-" + set_code.downcase[/{(.*?)}/, 1]
8
+
9
+ i_tag(prettySymbol + ' ' + optional_classes(options[:color], options[:size], options[:fixed_width], options[:gradient]))
10
+ end
11
+
12
+ private
13
+
14
+ def i_tag(inner_classes)
15
+ '<i class="ss ' + inner_classes +'"></i>'
16
+ end
17
+
18
+ def optional_classes(color, size, fixed_width, gradient)
19
+
20
+ class_text = ""
21
+
22
+ if(color)
23
+ class_text += "ss-#{color} "
24
+ end
25
+ if(size > 1)
26
+ class_text += "ss-#{size}x "
27
+ end
28
+ if(fixed_width)
29
+ class_text += "ss-fw "
30
+ end
31
+ if(gradient)
32
+ class_text += "ss-grad "
33
+ end
34
+
35
+ class_text
36
+ end
37
+ end
38
+
39
+ extend ClassMethods
40
+ end
41
+ end
@@ -143,7 +143,7 @@ module PrettyMagic
143
143
  class_text += "ms-shadow "
144
144
  end
145
145
  if(size > 1)
146
- class_text += "ms-#{options[:size]}x "
146
+ class_text += "ms-#{size}x "
147
147
  end
148
148
  if(fixed_width)
149
149
  class_text += "ms-fw "
@@ -1,3 +1,3 @@
1
1
  module PrettyMagic
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pretty_magic
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
  - Dan Wiseman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,7 +61,9 @@ executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
+ - ".github/workflows/.gitpod.yml"
64
65
  - ".gitignore"
66
+ - ".gitpod.yml"
65
67
  - ".rspec"
66
68
  - ".travis.yml"
67
69
  - CHANGELOG.md
@@ -74,6 +76,7 @@ files:
74
76
  - bin/console
75
77
  - bin/setup
76
78
  - lib/pretty_magic.rb
79
+ - lib/pretty_magic/keyrune_icons.rb
77
80
  - lib/pretty_magic/mana_icons.rb
78
81
  - lib/pretty_magic/version.rb
79
82
  - pretty_magic.gemspec
@@ -100,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
103
  - !ruby/object:Gem::Version
101
104
  version: '0'
102
105
  requirements: []
103
- rubygems_version: 3.0.6
106
+ rubygems_version: 3.0.8
104
107
  signing_key:
105
108
  specification_version: 4
106
109
  summary: Creates HTML for use with the Mana and KeyRune fonts from Scryfall style