middleman-somemoji 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +55 -0
- data/.github/workflows/ruby.yml +29 -0
- data/README.md +2 -1
- data/Rakefile +1 -1
- data/features/emoji.feature +5 -7
- data/features/twemoji.feature +5 -6
- data/fixtures/emoji-app/config.rb +5 -1
- data/lib/middleman-somemoji/converter.rb +10 -5
- data/lib/middleman-somemoji/extension.rb +3 -6
- data/lib/middleman-somemoji/version.rb +1 -1
- data/middleman-somemoji.gemspec +4 -3
- metadata +30 -19
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2b933bae9882d0b44015240a6358cf2b52ad0cfed1503599cfba4562655b1532
|
4
|
+
data.tar.gz: 92462e3865dbde44d07d8d435b41f1c9798bda435370aa58d4f912ab35fb79a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca7f6932b8e2898542f4118f47fcfaadec465adfc348cd955fc6377cbe8f8a7743e5c2b8ece7c57df7101a60efa7f2b538b4729b4019f092dc4a0fff293ba95d
|
7
|
+
data.tar.gz: 799f92ebf5734d190725764de527893196d9b9370d28b0dd0d978a73033f78b49d7839492938796c0a28102ce8e17915e362a715cb920d8b4c8f4740aed4ca4a
|
@@ -0,0 +1,55 @@
|
|
1
|
+
common_steps: &common_steps
|
2
|
+
working_directory: ~/repo
|
3
|
+
steps:
|
4
|
+
- checkout
|
5
|
+
- run: gem install bundler --force
|
6
|
+
- run:
|
7
|
+
name: install dependencies
|
8
|
+
command: |
|
9
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
10
|
+
- run: bundle exec rake
|
11
|
+
version: 2
|
12
|
+
jobs:
|
13
|
+
test-ruby3.0:
|
14
|
+
docker:
|
15
|
+
- image: circleci/ruby:3.0-buster
|
16
|
+
<<: *common_steps
|
17
|
+
test-ruby2.7:
|
18
|
+
docker:
|
19
|
+
- image: circleci/ruby:2.7-buster
|
20
|
+
<<: *common_steps
|
21
|
+
test-ruby2.6:
|
22
|
+
docker:
|
23
|
+
- image: circleci/ruby:2.6-buster
|
24
|
+
<<: *common_steps
|
25
|
+
test-ruby2.5:
|
26
|
+
docker:
|
27
|
+
- image: circleci/ruby:2.5-buster
|
28
|
+
<<: *common_steps
|
29
|
+
test-ruby2.4:
|
30
|
+
docker:
|
31
|
+
- image: circleci/ruby:2.4-buster
|
32
|
+
<<: *common_steps
|
33
|
+
workflows:
|
34
|
+
version: 2
|
35
|
+
test:
|
36
|
+
jobs:
|
37
|
+
- test-ruby3.0
|
38
|
+
- test-ruby2.7
|
39
|
+
- test-ruby2.6
|
40
|
+
- test-ruby2.5
|
41
|
+
- test-ruby2.4
|
42
|
+
cron:
|
43
|
+
jobs:
|
44
|
+
- test-ruby3.0
|
45
|
+
- test-ruby2.7
|
46
|
+
- test-ruby2.6
|
47
|
+
- test-ruby2.5
|
48
|
+
- test-ruby2.4
|
49
|
+
triggers:
|
50
|
+
- schedule:
|
51
|
+
cron: "0 0 * * 0"
|
52
|
+
filters:
|
53
|
+
branches:
|
54
|
+
only:
|
55
|
+
- master
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: test
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- master
|
6
|
+
pull_request:
|
7
|
+
branches:
|
8
|
+
- '*'
|
9
|
+
schedule:
|
10
|
+
- cron: '0 0 * * 0'
|
11
|
+
jobs:
|
12
|
+
build:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
ruby: ['3.0', '2.7', '2.6', '2.5', '2.4']
|
17
|
+
name: Ruby ${{ matrix.ruby }}
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@master
|
20
|
+
- name: Setup ruby ${{ matrix.ruby }}
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
architecture: 'x64'
|
25
|
+
- name: Build and test with Rake
|
26
|
+
run: |
|
27
|
+
gem install bundler
|
28
|
+
bundle install --jobs 4 --retry 3
|
29
|
+
bundle exec rake
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# middleman-somemoji
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![CircleCI](https://circleci.com/gh/unasuke/middleman-somemoji/tree/master.svg?style=shield)](https://circleci.com/gh/unasuke/middleman-somemoji/tree/master)
|
4
|
+
[![test](https://github.com/unasuke/middleman-somemoji/actions/workflows/ruby.yml/badge.svg?branch=master)](https://github.com/unasuke/middleman-somemoji/actions/workflows/ruby.yml)
|
4
5
|
|
5
6
|
middleman-somemoji is a emoji extension for Middleman.
|
6
7
|
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ Bundler::GemHelper.install_tasks
|
|
4
4
|
require 'cucumber/rake/task'
|
5
5
|
|
6
6
|
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
7
|
-
t.cucumber_opts = '--color --tags
|
7
|
+
t.cucumber_opts = '--color --tags="not @wip" --strict'
|
8
8
|
end
|
9
9
|
|
10
10
|
require 'rake/clean'
|
data/features/emoji.feature
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
Feature: Emoji
|
2
2
|
Scenario: Should convert :heart: to img tag
|
3
|
-
Given a
|
4
|
-
|
5
|
-
|
6
|
-
Then
|
7
|
-
Then
|
8
|
-
Then I should see "/images/emoji/unicode/2764-fe0f.png"
|
9
|
-
#Then I should see %(img alt="❤️" class="emoji" src="/images/emoji/unicode/2764-fe0f.png")
|
3
|
+
Given a successfully built app at "emoji-app"
|
4
|
+
When I cd to "build"
|
5
|
+
Then the file "index.html" should contain "❤️"
|
6
|
+
Then the file "index.html" should contain "emoji"
|
7
|
+
Then the file "index.html" should contain "/images/emoji_one/unicode/2764-fe0f.png"
|
data/features/twemoji.feature
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
Feature: Twemoji
|
2
2
|
Scenario: Should convert :smile: to img tag
|
3
|
-
Given a
|
4
|
-
|
5
|
-
|
6
|
-
Then
|
7
|
-
Then
|
8
|
-
Then I should see "/images/twemoji/unicode/1f604.svg"
|
3
|
+
Given a successfully built app at "twemoji-app"
|
4
|
+
When I cd to "build"
|
5
|
+
Then the file "index.html" should contain "😄"
|
6
|
+
Then the file "index.html" should contain "twemoji"
|
7
|
+
Then the file "index.html" should contain "/images/twemoji/unicode/1f604.svg"
|
@@ -3,17 +3,22 @@ require 'somemoji'
|
|
3
3
|
module Middleman
|
4
4
|
module Somemoji
|
5
5
|
class Converter
|
6
|
-
def initialize(
|
7
|
-
@body = body
|
6
|
+
def initialize(options)
|
8
7
|
@provider = options[:provider]
|
9
8
|
@format = options[:format]
|
10
9
|
@emoji_class = options[:emoji_class]
|
11
10
|
@emojis_dir = options[:emojis_dir]
|
12
11
|
end
|
13
12
|
|
14
|
-
def convert
|
15
|
-
|
16
|
-
|
13
|
+
def convert(app)
|
14
|
+
files = Dir.glob(File.join(app.config[:build_dir], "**", "*.html"))
|
15
|
+
files.each do |file|
|
16
|
+
body = eval("::Somemoji::#{@provider}_emoji_collection").replace_code(File.read(file)) do |emoji|
|
17
|
+
%(<img alt="#{emoji.character}" class="#{@emoji_class}" src="#{@emojis_dir}/#{emoji.base_path}.#{@format}">)
|
18
|
+
end
|
19
|
+
File.open(file, 'w') do |f|
|
20
|
+
f.write body
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
@@ -11,14 +11,11 @@ module Middleman
|
|
11
11
|
|
12
12
|
def initialize(app, options_hash={}, &block)
|
13
13
|
super
|
14
|
-
|
15
|
-
require 'somemoji'
|
16
|
-
|
17
14
|
@options = options
|
15
|
+
end
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
end
|
17
|
+
def after_build(builder)
|
18
|
+
::Middleman::Somemoji::Converter.new(@options).convert(app)
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
data/middleman-somemoji.gemspec
CHANGED
@@ -20,11 +20,12 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ['lib']
|
21
21
|
|
22
22
|
# The version of middleman-core your extension depends on
|
23
|
-
s.add_runtime_dependency 'middleman-core', '
|
23
|
+
s.add_runtime_dependency 'middleman-core', '~> 4'
|
24
|
+
s.add_runtime_dependency 'middleman-cli', '~> 4'
|
24
25
|
s.add_runtime_dependency 'somemoji'
|
25
26
|
|
26
|
-
s.add_development_dependency 'bundler'
|
27
|
-
s.add_development_dependency 'rake'
|
27
|
+
s.add_development_dependency 'bundler'
|
28
|
+
s.add_development_dependency 'rake'
|
28
29
|
s.add_development_dependency 'rdoc'
|
29
30
|
s.add_development_dependency 'yard'
|
30
31
|
s.add_development_dependency 'cucumber'
|
metadata
CHANGED
@@ -1,27 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-somemoji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: middleman-cli
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '4'
|
27
41
|
- !ruby/object:Gem::Dependency
|
@@ -42,30 +56,30 @@ dependencies:
|
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - "
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - "
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
75
|
+
version: '0'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - "
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rdoc
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,8 +172,9 @@ executables: []
|
|
158
172
|
extensions: []
|
159
173
|
extra_rdoc_files: []
|
160
174
|
files:
|
175
|
+
- ".circleci/config.yml"
|
176
|
+
- ".github/workflows/ruby.yml"
|
161
177
|
- ".gitignore"
|
162
|
-
- ".travis.yml"
|
163
178
|
- Gemfile
|
164
179
|
- LICENSE.txt
|
165
180
|
- README.md
|
@@ -196,12 +211,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
211
|
- !ruby/object:Gem::Version
|
197
212
|
version: '0'
|
198
213
|
requirements: []
|
199
|
-
|
200
|
-
rubygems_version: 2.6.11
|
214
|
+
rubygems_version: 3.1.6
|
201
215
|
signing_key:
|
202
216
|
specification_version: 4
|
203
217
|
summary: Convert emoji (e.g. :heart:) to <img> tag.
|
204
|
-
test_files:
|
205
|
-
- features/emoji.feature
|
206
|
-
- features/support/env.rb
|
207
|
-
- features/twemoji.feature
|
218
|
+
test_files: []
|