schoolie 0.1.0 → 0.1.2

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: 95ee9af604607b99f83b25807c01206eb2857f3d072373dc2f28a2890fca936d
4
- data.tar.gz: f150dd1f8a49c4ce353f80664fe1b926821031707c75d2cc254cb298bffe7aff
3
+ metadata.gz: a242116cac43cc3deaebac1e2baa11548e77ee7b53840832abc011fd76242b81
4
+ data.tar.gz: 235885b2b5945c48dabfaeb2806cd268fae3ecdf4b7c46f16e4ad8b19f9dcbb2
5
5
  SHA512:
6
- metadata.gz: f73c0467e3c360bc7b935b59b3c6a84458324bf9fc655f4b2a0cb7a517fa35e5ca2f43a5e7643ae768abe67ee28e271fd4dd726435184d7615450d19178eeda2
7
- data.tar.gz: 267770e9c8345dd36eca6e422e4579c8ca54dfc08411cf846c803621cdcef15a8960ff5382be413d927334dc7a4472e7cd0b1c2fd6d0d11957138bd6bb1cdeb6
6
+ metadata.gz: 6b00b1c4d8788b169279b2a85867762b05c3d45b38a2f79313adf35758ea72244660471e2be379b9cb299a0141f67804313d4eb76eb900f442b91e9cf68bf654
7
+ data.tar.gz: 23a9e2060c67fd8056d1a5a3c7738ddd47ea763143bb1c2235981ab898f08a2cf3fd27d675c940b55bef29dd53d45c5c19eea20e3c1e76200d99dc237620f29c
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: circleci
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.6
3
3
  NewCops: enable
4
+ SuggestExtensions: false
4
5
 
5
6
  Style/StringLiterals:
6
7
  Enabled: true
data/Gemfile CHANGED
@@ -5,11 +5,13 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in schoolie.gemspec
6
6
  gemspec
7
7
 
8
+ gem "actionview", "~>5"
8
9
  group :development, :test do
9
- gem "rake", "~> 13.0"
10
+ gem "byebug"
11
+ gem "coveralls-ruby", require: false
10
12
  gem "minitest", "~> 5.0"
11
-
13
+ gem "rake", "~> 13.0"
12
14
  gem "rubocop", "~> 1.21"
13
15
  gem "rubocop-minitest"
14
- gem "byebug"
16
+ gem "simplecov", require: false
15
17
  end
data/Gemfile.lock CHANGED
@@ -1,17 +1,54 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- schoolie (0.1.0)
4
+ schoolie (0.1.2)
5
+ actionview (~> 5)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
10
+ actionview (5.2.6.2)
11
+ activesupport (= 5.2.6.2)
12
+ builder (~> 3.1)
13
+ erubi (~> 1.4)
14
+ rails-dom-testing (~> 2.0)
15
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
16
+ activesupport (5.2.6.2)
17
+ concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ i18n (>= 0.7, < 2)
19
+ minitest (~> 5.1)
20
+ tzinfo (~> 1.1)
9
21
  ast (2.4.2)
22
+ builder (3.2.4)
10
23
  byebug (11.1.3)
24
+ concurrent-ruby (1.1.9)
25
+ coveralls-ruby (0.2.0)
26
+ json (>= 1.8, < 3)
27
+ simplecov (~> 0.16.1)
28
+ term-ansicolor (~> 1.3)
29
+ thor (>= 0.19.4, < 2.0)
30
+ tins (~> 1.6)
31
+ crass (1.0.6)
32
+ docile (1.4.0)
33
+ erubi (1.10.0)
34
+ i18n (1.10.0)
35
+ concurrent-ruby (~> 1.0)
36
+ json (2.6.1)
37
+ loofah (2.14.0)
38
+ crass (~> 1.0.2)
39
+ nokogiri (>= 1.5.9)
11
40
  minitest (5.15.0)
41
+ nokogiri (1.13.3-x86_64-linux)
42
+ racc (~> 1.4)
12
43
  parallel (1.21.0)
13
44
  parser (3.1.0.0)
14
45
  ast (~> 2.4.1)
46
+ racc (1.6.0)
47
+ rails-dom-testing (2.0.3)
48
+ activesupport (>= 4.2.0)
49
+ nokogiri (>= 1.6)
50
+ rails-html-sanitizer (1.4.2)
51
+ loofah (~> 2.3)
15
52
  rainbow (3.1.1)
16
53
  rake (13.0.6)
17
54
  regexp_parser (2.2.1)
@@ -30,18 +67,35 @@ GEM
30
67
  rubocop-minitest (0.17.2)
31
68
  rubocop (>= 0.90, < 2.0)
32
69
  ruby-progressbar (1.11.0)
70
+ simplecov (0.16.1)
71
+ docile (~> 1.1)
72
+ json (>= 1.8, < 3)
73
+ simplecov-html (~> 0.10.0)
74
+ simplecov-html (0.10.2)
75
+ sync (0.5.0)
76
+ term-ansicolor (1.7.1)
77
+ tins (~> 1.0)
78
+ thor (1.2.1)
79
+ thread_safe (0.3.6)
80
+ tins (1.31.0)
81
+ sync
82
+ tzinfo (1.2.9)
83
+ thread_safe (~> 0.1)
33
84
  unicode-display_width (2.1.0)
34
85
 
35
86
  PLATFORMS
36
87
  x86_64-linux
37
88
 
38
89
  DEPENDENCIES
90
+ actionview (~> 5)
39
91
  byebug
92
+ coveralls-ruby
40
93
  minitest (~> 5.0)
41
94
  rake (~> 13.0)
42
95
  rubocop (~> 1.21)
43
96
  rubocop-minitest
44
97
  schoolie!
98
+ simplecov
45
99
 
46
100
  BUNDLED WITH
47
101
  2.2.33
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Schoolie
2
+ [![CircleCI](https://circleci.com/gh/curationexperts/schoolie/tree/main.svg?style=svg)](https://circleci.com/gh/curationexperts/schoolie/tree/main)
3
+ <a href="https://codeclimate.com/github/curationexperts/schoolie/maintainability"><img src="https://api.codeclimate.com/v1/badges/bc6ef5bc9e76c6c3dcc9/maintainability" /></a>
4
+ [![Coverage Status](https://coveralls.io/repos/github/curationexperts/schoolie/badge.svg?branch=main)](https://coveralls.io/github/curationexperts/schoolie?branch=main)
2
5
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/schoolie`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
+ The gem that generates a site map and meta tags for google scholar
6
7
 
7
8
  ## Installation
8
9
 
@@ -22,13 +23,40 @@ Or install it yourself as:
22
23
 
23
24
  ## Usage
24
25
 
25
- TODO: Write usage instructions here
26
+ In order to map your particular metadata into the google scholar fields, create a file in Rails.root/config named schoolie.yml.
26
27
 
27
- ## Development
28
28
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
29
+ This file should contain contents similar to this:
30
+
31
+ ```
32
+ ---
33
+ :static:
34
+ Institution: Emory & University
35
+ :attributes:
36
+ Title: title
37
+ Author: creator
38
+ Abstract: abstract
39
+ Type: submitting_type
40
+ Date: degree_awarded
41
+ ```
30
42
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
43
+ The 'static' section will be written directly into the meta tags as is, attributes will be sent as method calls to the current curation
44
+ concern object, and the value thus returned will be written into the meta tag.
45
+
46
+ Missing methods will be ignored.
47
+
48
+
49
+ ```
50
+ bundle exec rails schoolie:sitemap
51
+ ```
52
+
53
+ This will generate a sitemap in public/sitemap.txt You should refer to this file in your robots.txt
54
+
55
+ NB. this task just uses curl to query solr currently, so make sure you have that installed first
56
+
57
+ ## Development
58
+
59
+ Check out the repo, and bundle install as per normal.
32
60
 
33
61
  ## Contributing
34
62
 
@@ -36,8 +64,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
36
64
 
37
65
  ## License
38
66
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
-
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the Schoolie project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/schoolie/blob/master/CODE_OF_CONDUCT.md).
67
+ The gem is available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).
data/Rakefile CHANGED
@@ -7,6 +7,7 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.libs << "test"
8
8
  t.libs << "lib"
9
9
  t.test_files = FileList["test/**/*_test.rb"]
10
+ t.warning = false
10
11
  end
11
12
 
12
13
  require "rubocop/rake_task"
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yaml"
4
+ # A simple helper that creates <meta> tags required for google scholar information.
5
+ # The default configuration attempts to load from Rails.root/config/schoolie.yml,
6
+ # though can be overridden
7
+ module SchoolieHelper
8
+ def schoolie_tags(concern, config = Rails.root.join("config/schoolie.yml"))
9
+ m = load_map(config)
10
+ tags = m["static"].map do |k, v|
11
+ tag.meta(name: k, value: v)
12
+ end
13
+ tags << m["attributes"].map do |k, v|
14
+ tag.meta(name: k, value: concern.send(v))
15
+ rescue StandardError
16
+ warn("Undefined attribute mapping: #{k} -> #{v}")
17
+ end
18
+ tags.join("\n")
19
+ end
20
+
21
+ private
22
+
23
+ def load_map(config)
24
+ @load_map ||= YAML.safe_load(File.open(config, "r"), [Symbol])
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Schoolie
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/schoolie.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "action_view"
3
4
  require_relative "schoolie/version"
4
-
5
- module Schoolie
6
- class Error < StandardError; end
7
- # Your code goes here...
8
- end
5
+ require_relative "helpers/schoolie_helper"
6
+ ActionView::Base.include SchoolieHelper
metadata CHANGED
@@ -1,59 +1,73 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schoolie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - McClain Looney
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-17 00:00:00.000000000 Z
11
+ date: 2022-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: minitest
14
+ name: actionview
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.15'
19
+ version: '5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: byebug
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.25'
20
34
  type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '5.15'
40
+ version: '1.25'
27
41
  - !ruby/object:Gem::Dependency
28
- name: rake
42
+ name: minitest
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '13.0'
47
+ version: '5.15'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '13.0'
54
+ version: '5.15'
41
55
  - !ruby/object:Gem::Dependency
42
- name: rubocop
56
+ name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '1.25'
61
+ version: '13.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: '1.25'
68
+ version: '13.0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: byebug
70
+ name: rubocop
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
@@ -73,6 +87,7 @@ executables: []
73
87
  extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
90
+ - ".coveralls.yml"
76
91
  - ".rubocop.yml"
77
92
  - Gemfile
78
93
  - Gemfile.lock
@@ -81,6 +96,7 @@ files:
81
96
  - Rakefile
82
97
  - bin/console
83
98
  - bin/setup
99
+ - lib/helpers/schoolie_helper.rb
84
100
  - lib/schoolie.rb
85
101
  - lib/schoolie/version.rb
86
102
  - sig/schoolie.rbs
@@ -107,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
123
  - !ruby/object:Gem::Version
108
124
  version: '0'
109
125
  requirements: []
110
- rubygems_version: 3.2.28
126
+ rubygems_version: 3.3.4
111
127
  signing_key:
112
128
  specification_version: 4
113
129
  summary: A gem to generate sitemaps & meta tags for Samvera repositories