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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4df2f63bba276e6f1f8384bc73b23535a90c630
4
- data.tar.gz: 7d509f467496347c158a4bcd54c75e551de893f6
3
+ metadata.gz: 5cf9264e56da5d9be22d45f491d56ac435c73ffb
4
+ data.tar.gz: 42a5c4d8323cf76de801cd8488af0a3e7dc68c13
5
5
  SHA512:
6
- metadata.gz: fdb16d6c49f90a8676593707f711b6b0f50b54101c5a6b907aa955dab3fbfc18b379582e7bd2c2f34a57216186bf1a4b09fc762d7406327eb51015513cd446ac
7
- data.tar.gz: ad82faa6f3cf1f9a41be6a3ceda873ffd32bfffd4329d0fe3f820488d840bd0a9a4358dad6223ef56a88831d9d8c45431ed10de03673b889f4135dcc392469f7
6
+ metadata.gz: 5b39d7741bb71d0b418d0152b3b3db9bcd134244e968928029e0d6dd0d828f9869c87b8b0fd2f1172e56f1420a0fb7488472414b0701a4d649668658276465e9
7
+ data.tar.gz: 2915afc5a15fba0e241c0b376f5fa4d7a7b108fd87740557903108394bd64b80b058c6e7e37edcaf3ae420c0259c7f366dbcce838d72f511da2eb597c466a803
data/lib/team_hub.rb CHANGED
@@ -17,3 +17,4 @@
17
17
  require 'team_hub/canonicalizer'
18
18
  require 'team_hub/version'
19
19
  require 'team_hub/page'
20
+ require 'team_hub/private_assets'
@@ -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
@@ -23,5 +23,5 @@
23
23
  # https://github.com/18F/hub"
24
24
 
25
25
  module TeamHub
26
- VERSION = "0.0.1"
26
+ VERSION = "0.0.2"
27
27
  end
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.1
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 00:00:00.000000000 Z
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: