Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding multiple missing icons #983

Merged
merged 22 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Ruby and Rubocop versions; fix linting issues
  • Loading branch information
camertron committed Jan 22, 2024
commit f11c53068829398e22ad8b1601e534cf2db17c4f
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2
- uses: actions/download-artifact@v4
with:
name: octicons-build
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2
- uses: actions/download-artifact@v4
with:
name: octicons-gem
Expand All @@ -153,7 +153,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2
- uses: actions/download-artifact@v4
with:
name: octicons-gem
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2

- name: Install dependencies
run: |
Expand Down
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ inherit_gem:
rubocop-github:
- config/default.yml
- config/rails.yml
AllCops:
NewCops: enable
5 changes: 3 additions & 2 deletions lib/octicons_gem/Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# frozen_string_literal: true
source "https://rubygems.org"

gemspec

group :development, :test do
gem "minitest"
gem "rake"
gem "rubocop", "0.59"
gem "rubocop-github", "0.12.0"
gem "rubocop", "~> 1.0"
gem "rubocop-github", "0.20.0"
end
1 change: 1 addition & 0 deletions lib/octicons_gem/Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "rake/testtask"
require "rubocop/rake_task"
require "bundler/gem_tasks"
Expand Down
1 change: 1 addition & 0 deletions lib/octicons_gem/lib/octicons.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "octicons/version"
require "octicons/octicon"
require "json"
Expand Down
1 change: 1 addition & 0 deletions lib/octicons_gem/lib/octicons/octicon.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Octicons
class Octicon
DEFAULT_HEIGHT = 16
Expand Down
1 change: 1 addition & 0 deletions lib/octicons_gem/lib/octicons/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module Octicons
VERSION = "19.8.0".freeze
end
1 change: 1 addition & 0 deletions lib/octicons_gem/octicons.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require File.expand_path("../lib/octicons/version", __FILE__)

Gem::Specification.new do |s|
Expand Down
3 changes: 2 additions & 1 deletion lib/octicons_gem/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require "minitest/autorun"
require "octicons"

def octicon(symbol, options = {})
::Octicons::Octicon.new(symbol, options)
Octicons::Octicon.new(symbol, options)
end
3 changes: 2 additions & 1 deletion lib/octicons_gem/test/octicon_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_relative "./helper"
# frozen_string_literal: true
require_relative "helper"

describe Octicons::Octicon do
it "fails when the octicon doesn't exist" do
Expand Down
3 changes: 2 additions & 1 deletion lib/octicons_gem/test/octicons_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_relative "./helper"
# frozen_string_literal: true
require_relative "helper"

describe Octicons do
it "loads all icons on initialization" do
Expand Down
6 changes: 4 additions & 2 deletions lib/octicons_helper/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec
Expand All @@ -8,6 +10,6 @@ gem "rails"
group :development, :test do
gem "minitest"
gem "rake"
gem "rubocop", "0.59"
gem "rubocop-github", "0.12.0"
gem "rubocop", "~> 1.0"
gem "rubocop-github", "0.20.0"
end
2 changes: 2 additions & 0 deletions lib/octicons_helper/Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rake/testtask"
require "rubocop/rake_task"
require "bundler/gem_tasks"
Expand Down
2 changes: 2 additions & 0 deletions lib/octicons_helper/lib/octicons_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "octicons_helper/version"
require "octicons_helper/helper"
require "octicons_helper/railtie" if defined?(Rails)
2 changes: 2 additions & 0 deletions lib/octicons_helper/lib/octicons_helper/helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "octicons"
require "action_view"

Expand Down
2 changes: 2 additions & 0 deletions lib/octicons_helper/lib/octicons_helper/railtie.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rails"

module OcticonsHelper
Expand Down
2 changes: 2 additions & 0 deletions lib/octicons_helper/lib/octicons_helper/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module OcticonsHelper
VERSION = "19.8.0".freeze
end
2 changes: 2 additions & 0 deletions lib/octicons_helper/octicons_helper.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.expand_path("../lib/octicons_helper/version", __FILE__)

Gem::Specification.new do |s|
Expand Down
2 changes: 2 additions & 0 deletions lib/octicons_helper/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "minitest/autorun"
require "octicons_helper"

Expand Down
22 changes: 4 additions & 18 deletions lib/octicons_helper/test/octicons_helper_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require_relative "./helper"
# frozen_string_literal: true

require_relative "helper"

describe OcticonsHelper do
describe "rendering" do
Expand All @@ -20,23 +22,7 @@

it "caches SVGs for two calls with the same arguments" do
OcticonsHelper.octicons_helper_cache = {}

mock = Minitest::Mock.new
def mock.path
@@call_count ||= 0
@@call_count += 1

raise "Octicon library called twice" if @@call_count > 1

"foo"
end
def mock.options; end

Octicons::Octicon.stub :new, mock do
octicon("alert")
octicon("alert")
end

assert octicon("alert").object_id == octicon("alert").object_id
OcticonsHelper.octicons_helper_cache = {}
end
end
Expand Down
3 changes: 3 additions & 0 deletions lib/octicons_jekyll/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ inherit_gem:

Naming/FileName:
Enabled: false

AllCops:
NewCops: enable
5 changes: 3 additions & 2 deletions lib/octicons_jekyll/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
source "https://rubygems.org"

gemspec
Expand All @@ -7,6 +8,6 @@ gem "octicons", "19.8.0"
group :development, :test do
gem "minitest"
gem "rake"
gem "rubocop", "0.59"
gem "rubocop-github", "0.12.0"
gem "rubocop", "~> 1.0"
gem "rubocop-github", "0.20.0"
end
1 change: 1 addition & 0 deletions lib/octicons_jekyll/Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "rake/testtask"
require "rubocop/rake_task"
require "bundler/gem_tasks"
Expand Down
1 change: 1 addition & 0 deletions lib/octicons_jekyll/jekyll-octicons.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require File.expand_path("../lib/jekyll-octicons/version", __FILE__)

Gem::Specification.new do |s|
Expand Down
1 change: 1 addition & 0 deletions lib/octicons_jekyll/lib/jekyll-octicons.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "octicons"
require "jekyll-octicons/version"
require "liquid"
Expand Down
1 change: 1 addition & 0 deletions lib/octicons_jekyll/lib/jekyll-octicons/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Prevent bundler errors
module Liquid; class Tag; end; end

Expand Down
1 change: 1 addition & 0 deletions lib/octicons_jekyll/test/helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "minitest/autorun"
require "jekyll-octicons"

Expand Down
3 changes: 2 additions & 1 deletion lib/octicons_jekyll/test/octicon_tag_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_relative "./helper"
# frozen_string_literal: true
require_relative "helper"

describe Jekyll::Octicons do
describe "parsing" do
Expand Down
Loading