team_hub 0.0.1 → 0.0.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 +4 -4
- data/lib/team_hub.rb +1 -0
- data/lib/team_hub/private_assets.rb +56 -0
- data/lib/team_hub/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf9264e56da5d9be22d45f491d56ac435c73ffb
|
4
|
+
data.tar.gz: 42a5c4d8323cf76de801cd8488af0a3e7dc68c13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b39d7741bb71d0b418d0152b3b3db9bcd134244e968928029e0d6dd0d828f9869c87b8b0fd2f1172e56f1420a0fb7488472414b0701a4d649668658276465e9
|
7
|
+
data.tar.gz: 2915afc5a15fba0e241c0b376f5fa4d7a7b108fd87740557903108394bd64b80b058c6e7e37edcaf3ae420c0259c7f366dbcce838d72f511da2eb597c466a803
|
data/lib/team_hub.rb
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
# team_hub - Components for creating a team Hub using Jekyll
|
2
|
+
#
|
3
|
+
# Written in 2015 by Mike Bland (michael.bland@gsa.gov)
|
4
|
+
# on behalf of the 18F team, part of the US General Services Administration:
|
5
|
+
# https://18f.gsa.gov/
|
6
|
+
#
|
7
|
+
# To the extent possible under law, the author(s) have dedicated all copyright
|
8
|
+
# and related and neighboring rights to this software to the public domain
|
9
|
+
# worldwide. This software is distributed without any warranty.
|
10
|
+
#
|
11
|
+
# You should have received a copy of the CC0 Public Domain Dedication along
|
12
|
+
# with this software. If not, see
|
13
|
+
# <https://creativecommons.org/publicdomain/zero/1.0/>.
|
14
|
+
#
|
15
|
+
# @author Mike Bland (michael.bland@gsa.gov)
|
16
|
+
|
17
|
+
module TeamHub
|
18
|
+
|
19
|
+
# Operations for managing private asset files.
|
20
|
+
class PrivateAssets
|
21
|
+
|
22
|
+
# Copies private items into the _site directory.
|
23
|
+
#
|
24
|
+
# More correctly, it prepares private items for copying, which happens at
|
25
|
+
# site generation time.
|
26
|
+
# +site+:: Jekyll site object
|
27
|
+
def self.copy_to_site(site)
|
28
|
+
copy_directory_to_site site, site.config['team_img_dir']
|
29
|
+
end
|
30
|
+
|
31
|
+
# Determines whether or not a private asset is present.
|
32
|
+
# +site+:: Jekyll site data
|
33
|
+
# +relative_path+:: path of asset relative to private_data_path config
|
34
|
+
def self.exists? (site, relative_path)
|
35
|
+
File.exists? File.join(
|
36
|
+
site.source, site.config['private_data_path'], relative_path)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Copies a directory of private data assets into the generated site.
|
40
|
+
# @param site [Jekyll::Site] Jekyll site object
|
41
|
+
# @param dir_to_copy [string] directory within
|
42
|
+
# site.config['private_data_path'] to copy into the generated site
|
43
|
+
def self.copy_directory_to_site(site, dir_to_copy)
|
44
|
+
private_root = File.join(site.source, site.config['private_data_path'])
|
45
|
+
source_dir = File.join(private_root, dir_to_copy)
|
46
|
+
return unless Dir.exists? source_dir
|
47
|
+
Dir.open(source_dir) do |dir|
|
48
|
+
dir.each do |filename|
|
49
|
+
next if ['.', '..'].include? filename
|
50
|
+
site.static_files << ::Jekyll::StaticFile.new(
|
51
|
+
site, private_root, dir_to_copy, filename)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/team_hub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: team_hub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Bland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hash-joiner
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: test_temp_file_helper
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: |-
|
112
126
|
Contains resuable components extracted from the 18F Hub implementation for creating a team hub using Jekyll. See the 18F Public Hub for a running example:
|
113
127
|
https://18f.gsa.gov/hub/
|
@@ -123,6 +137,7 @@ files:
|
|
123
137
|
- lib/team_hub.rb
|
124
138
|
- lib/team_hub/canonicalizer.rb
|
125
139
|
- lib/team_hub/page.rb
|
140
|
+
- lib/team_hub/private_assets.rb
|
126
141
|
- lib/team_hub/version.rb
|
127
142
|
homepage: https://github.com/18F/team_hub
|
128
143
|
licenses:
|