Skip to content

Commit

Permalink
Rubocop fixes & bump revision
Browse files Browse the repository at this point in the history
  • Loading branch information
McClain Looney committed Mar 2, 2022
1 parent 8fe3e82 commit 79883f0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
9 changes: 1 addition & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
schoolie (0.1.1)
schoolie (0.1.2)
rails (~> 5)

GEM
Expand Down Expand Up @@ -50,7 +50,6 @@ GEM
tzinfo (~> 1.1)
arel (9.0.0)
ast (2.4.2)
bixby (0.1.0)
builder (3.2.4)
byebug (11.1.3)
concurrent-ruby (1.1.9)
Expand Down Expand Up @@ -128,10 +127,6 @@ GEM
parser (>= 3.0.1.1)
rubocop-minitest (0.17.2)
rubocop (>= 0.90, < 2.0)
rubocop-rails (2.13.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
ruby-progressbar (1.11.0)
simplecov (0.16.1)
docile (~> 1.1)
Expand Down Expand Up @@ -163,15 +158,13 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
bixby
byebug
coveralls-ruby
minitest (~> 5.0)
rails (~> 5)
rake (~> 13.0)
rubocop (~> 1.21)
rubocop-minitest
rubocop-rails
schoolie!
simplecov

Expand Down
6 changes: 3 additions & 3 deletions lib/helpers/schoolie_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
module SchoolieHelper
def schoolie_tags(concern, config = Rails.root.join("config/schoolie.yml"))
m = load_map(config)
tags = m[:static].map do |k, v|
tags = m["static"].map do |k, v|
tag.meta(name: k, value: v)
end
tags << m[:attributes].map do |k, v|
tags << m["attributes"].map do |k, v|
tag.meta(name: k, value: concern.send(v))
rescue StandardError
warn("Undefined attribute mapping: #{k} -> #{v}")
Expand All @@ -21,6 +21,6 @@ def schoolie_tags(concern, config = Rails.root.join("config/schoolie.yml"))
private

def load_map(config)
@load_map ||= YAML.safe_load(File.open(config, "r"))
@load_map ||= YAML.safe_load(File.open(config, "r"), [Symbol])
end
end
2 changes: 1 addition & 1 deletion lib/schoolie/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Schoolie
VERSION = "0.1.1"
VERSION = "0.1.2"
end
16 changes: 8 additions & 8 deletions test/fixtures/schoolie.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
:static:
Institution: Emory & University
:attributes:
Title: title
Author: creator
Abstract: abstract
Type: submitting_type
Date: degree_awarded
static:
"Institution": Emory & University
attributes:
"Title": title
"Author": creator
"Abstract": abstract
"Type": submitting_type
"Date": degree_awarded
2 changes: 1 addition & 1 deletion test/schoolie_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ def test_has_a_helper_and_it_escapes_html
def test_doesnt_blow_up_on_missing_method
obj = Object.new
assert_equal "<meta name=\"Institution\" value=\"Emory &amp; University\">",
Foo.new.schoolie_tags(obj, "test/fixtures/schoolie.yml")
Foo.new.schoolie_tags(obj, "test/fixtures/schoolie.yml").strip
end
end

0 comments on commit 79883f0

Please sign in to comment.