Skip to content

Commit 7e52c15

Browse files
Restore meta files, some minor updates
** Why are these changes being introduced: * The choice to start this branch by wiping the directory and creating a new gem from `rails new plugin` meant that some meta files which are unrelated have been removed (such as the code of conduct and makefile) * Some minor parts of other files are not optimal (quoting of strings, for example) ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/engx-175 ** How does this address that need: * This restores some meta files from the project root, as well as some values from the gemspec file. * The project readme is updated, with an additional step under the usage section. * Some minor changes to the gemspec file, as well as the contents of lib/ ** Document any side effects to this change: * None
1 parent dc4978e commit 7e52c15

11 files changed

Lines changed: 459 additions & 47 deletions

File tree

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at jprevost@mit.edu. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
source "https://rubygems.org"
1+
source 'https://rubygems.org'
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
# Specify your gem's dependencies in mitlibraries-theme.gemspec.
4+
# Specify your gem's dependencies in mitlibraries-theme.gemspec
55
gemspec
66

77
gem "sqlite3"

Gemfile.lock

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
PATH
2+
remote: .
3+
specs:
4+
mitlibraries-theme (0.9.0)
5+
rails (>= 6, < 8)
6+
sassc-rails (~> 2)
7+
8+
GEM
9+
remote: https://rubygems.org/
10+
specs:
11+
actioncable (7.0.3.1)
12+
actionpack (= 7.0.3.1)
13+
activesupport (= 7.0.3.1)
14+
nio4r (~> 2.0)
15+
websocket-driver (>= 0.6.1)
16+
actionmailbox (7.0.3.1)
17+
actionpack (= 7.0.3.1)
18+
activejob (= 7.0.3.1)
19+
activerecord (= 7.0.3.1)
20+
activestorage (= 7.0.3.1)
21+
activesupport (= 7.0.3.1)
22+
mail (>= 2.7.1)
23+
net-imap
24+
net-pop
25+
net-smtp
26+
actionmailer (7.0.3.1)
27+
actionpack (= 7.0.3.1)
28+
actionview (= 7.0.3.1)
29+
activejob (= 7.0.3.1)
30+
activesupport (= 7.0.3.1)
31+
mail (~> 2.5, >= 2.5.4)
32+
net-imap
33+
net-pop
34+
net-smtp
35+
rails-dom-testing (~> 2.0)
36+
actionpack (7.0.3.1)
37+
actionview (= 7.0.3.1)
38+
activesupport (= 7.0.3.1)
39+
rack (~> 2.0, >= 2.2.0)
40+
rack-test (>= 0.6.3)
41+
rails-dom-testing (~> 2.0)
42+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
43+
actiontext (7.0.3.1)
44+
actionpack (= 7.0.3.1)
45+
activerecord (= 7.0.3.1)
46+
activestorage (= 7.0.3.1)
47+
activesupport (= 7.0.3.1)
48+
globalid (>= 0.6.0)
49+
nokogiri (>= 1.8.5)
50+
actionview (7.0.3.1)
51+
activesupport (= 7.0.3.1)
52+
builder (~> 3.1)
53+
erubi (~> 1.4)
54+
rails-dom-testing (~> 2.0)
55+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
56+
activejob (7.0.3.1)
57+
activesupport (= 7.0.3.1)
58+
globalid (>= 0.3.6)
59+
activemodel (7.0.3.1)
60+
activesupport (= 7.0.3.1)
61+
activerecord (7.0.3.1)
62+
activemodel (= 7.0.3.1)
63+
activesupport (= 7.0.3.1)
64+
activestorage (7.0.3.1)
65+
actionpack (= 7.0.3.1)
66+
activejob (= 7.0.3.1)
67+
activerecord (= 7.0.3.1)
68+
activesupport (= 7.0.3.1)
69+
marcel (~> 1.0)
70+
mini_mime (>= 1.1.0)
71+
activesupport (7.0.3.1)
72+
concurrent-ruby (~> 1.0, >= 1.0.2)
73+
i18n (>= 1.6, < 2)
74+
minitest (>= 5.1)
75+
tzinfo (~> 2.0)
76+
builder (3.2.4)
77+
concurrent-ruby (1.1.10)
78+
crass (1.0.6)
79+
debug (1.6.2)
80+
irb (>= 1.3.6)
81+
reline (>= 0.3.1)
82+
digest (3.1.0)
83+
erubi (1.11.0)
84+
ffi (1.15.5)
85+
globalid (1.0.0)
86+
activesupport (>= 5.0)
87+
i18n (1.12.0)
88+
concurrent-ruby (~> 1.0)
89+
io-console (0.5.11)
90+
irb (1.4.1)
91+
reline (>= 0.3.0)
92+
loofah (2.18.0)
93+
crass (~> 1.0.2)
94+
nokogiri (>= 1.5.9)
95+
mail (2.7.1)
96+
mini_mime (>= 0.1.1)
97+
marcel (1.0.2)
98+
method_source (1.0.0)
99+
mini_mime (1.1.2)
100+
minitest (5.16.3)
101+
net-imap (0.2.3)
102+
digest
103+
net-protocol
104+
strscan
105+
net-pop (0.1.1)
106+
digest
107+
net-protocol
108+
timeout
109+
net-protocol (0.1.3)
110+
timeout
111+
net-smtp (0.3.1)
112+
digest
113+
net-protocol
114+
timeout
115+
nio4r (2.5.8)
116+
nokogiri (1.13.8-x86_64-darwin)
117+
racc (~> 1.4)
118+
racc (1.6.0)
119+
rack (2.2.4)
120+
rack-test (2.0.2)
121+
rack (>= 1.3)
122+
rails (7.0.3.1)
123+
actioncable (= 7.0.3.1)
124+
actionmailbox (= 7.0.3.1)
125+
actionmailer (= 7.0.3.1)
126+
actionpack (= 7.0.3.1)
127+
actiontext (= 7.0.3.1)
128+
actionview (= 7.0.3.1)
129+
activejob (= 7.0.3.1)
130+
activemodel (= 7.0.3.1)
131+
activerecord (= 7.0.3.1)
132+
activestorage (= 7.0.3.1)
133+
activesupport (= 7.0.3.1)
134+
bundler (>= 1.15.0)
135+
railties (= 7.0.3.1)
136+
rails-dom-testing (2.0.3)
137+
activesupport (>= 4.2.0)
138+
nokogiri (>= 1.6)
139+
rails-html-sanitizer (1.4.3)
140+
loofah (~> 2.3)
141+
railties (7.0.3.1)
142+
actionpack (= 7.0.3.1)
143+
activesupport (= 7.0.3.1)
144+
method_source
145+
rake (>= 12.2)
146+
thor (~> 1.0)
147+
zeitwerk (~> 2.5)
148+
rake (13.0.6)
149+
reline (0.3.1)
150+
io-console (~> 0.5)
151+
sassc (2.4.0)
152+
ffi (~> 1.9)
153+
sassc-rails (2.1.2)
154+
railties (>= 4.0.0)
155+
sassc (>= 2.0)
156+
sprockets (> 3.0)
157+
sprockets-rails
158+
tilt
159+
sprockets (4.1.1)
160+
concurrent-ruby (~> 1.0)
161+
rack (> 1, < 3)
162+
sprockets-rails (3.4.2)
163+
actionpack (>= 5.2)
164+
activesupport (>= 5.2)
165+
sprockets (>= 3.0.0)
166+
sqlite3 (1.4.4)
167+
strscan (3.0.4)
168+
thor (1.2.1)
169+
tilt (2.0.11)
170+
timeout (0.3.0)
171+
tzinfo (2.0.5)
172+
concurrent-ruby (~> 1.0)
173+
websocket-driver (0.7.5)
174+
websocket-extensions (>= 0.1.0)
175+
websocket-extensions (0.1.5)
176+
zeitwerk (2.6.0)
177+
178+
PLATFORMS
179+
x86_64-darwin-19
180+
181+
DEPENDENCIES
182+
debug (~> 1)
183+
mitlibraries-theme!
184+
sprockets-rails
185+
sqlite3
186+
187+
BUNDLED WITH
188+
2.3.7

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 MIT Libraries
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

MIT-LICENSE

Lines changed: 0 additions & 20 deletions
This file was deleted.

Makefile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.PHONY: help fetch update cleanup dist publish
2+
SHELL=/bin/bash
3+
GEMSPEC=$(shell ls *.gemspec | head -1)
4+
VERSION=$(shell ruby -e 'puts Gem::Specification::load("$(GEMSPEC)").version')
5+
PROJECT=$(shell ruby -e 'puts Gem::Specification.load("$(GEMSPEC)").name')
6+
GEM=$(PROJECT)-$(VERSION).gem
7+
8+
help: ## Print this message
9+
@awk 'BEGIN { FS = ":.*##"; print "Usage: make <target>\n\nTargets:" } \
10+
/^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
11+
12+
fetch: clean ## Grab latest from theme repo (auto runs clean first)
13+
mkdir -p tmp
14+
curl -o tmp/assets.zip https://codeload.github.com/MITLibraries/mitlib-style/zip/master
15+
unzip -o -d tmp tmp/assets.zip
16+
17+
update: fetch ## Synchronize latest (auto runs clean and fetch first)
18+
# cleanup targets first in case assets were removed
19+
rm -rf vendor/assets/images/
20+
rm -rf vendor/assets/stylesheets/
21+
22+
mkdir vendor/assets/images/
23+
mkdir vendor/assets/stylesheets/
24+
25+
cp -R tmp/mitlib-style-master/_assets/i/* vendor/assets/images
26+
cp -R tmp/mitlib-style-master/_assets/sass/* vendor/assets/stylesheets
27+
28+
rm -rf vendor/assets/stylesheets/apps/
29+
rm -f vendor/assets/stylesheets/ebooks-main.scss
30+
rm -f vendor/assets/stylesheets/guide-helper.scss
31+
rm -f vendor/assets/stylesheets/quicksubmit.sass
32+
33+
# We need to double $ so make doesn't think it's a variable and escape the $ for bash. Hence \$$.
34+
sed -i '' "s+url('#{\$$image-path}/vi-shape7-tp.svg')+image-url('vi-shape7-tp.svg')+g" vendor/assets/stylesheets/elements/*.scss
35+
36+
@tput setaf 2
37+
@tput bold
38+
@echo "Assets updated. Make sure to update version in:"
39+
@echo " lib/mitlibraries/theme/version.rb"
40+
@echo "before building with 'make dist'"
41+
@tput sgr0
42+
43+
clean: ## Delete downloaded zip and extracted files
44+
rm -f tmp/assets.zip
45+
rm -rf tmp/mitlib-style-master
46+
47+
dist: ## Build the gem from the current gemspec
48+
gem build mitlibraries-theme.gemspec
49+
@tput setaf 2
50+
@tput bold
51+
@echo "Finished building gem. To test locally add to your project Gemfile:"
52+
@echo " gem 'mitlibraries-theme', path: '$(shell pwd)'"
53+
@tput sgr0
54+
55+
publish: ## Publish the gem version defined in the gemspec
56+
gem push "$(GEM)"

0 commit comments

Comments
 (0)