team_hub 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d68f59d2e12ff7fda506fbe9f0b95a68ddb9d841
4
- data.tar.gz: 13a78cadb8f516f949ad2389aeb9e55b4ff2a0d5
3
+ metadata.gz: 6a2e1532188d7aa9cf467096ae16108adbcc62b3
4
+ data.tar.gz: b2d1c1e08bf9878f5b33b4a7b8f17419794b51b6
5
5
  SHA512:
6
- metadata.gz: ac823bcfe7bcb40b8dd8256e1a1767f16723c8a9fa395364403d3638e767e44535f5c08511db3808322ffec8c2fb9ebcad342a69ec44a138d930ce724e6a50e2
7
- data.tar.gz: 2dc13b2c21c0d7653417acc516b074010b80c19a6619f5225ad30a917cb12170a2f5fea6c8eea617d4adc227ea5038629c54273dab8bc717af88f1f023c3806f
6
+ metadata.gz: 46ead64fb0257708f0583ed084e43d1dc523c6538ae647d3ab0e98271cd0893eb2b9edaf1903f5d1679ca3823ba03760a8b49b500da4f836c37d9cd3a817ed77
7
+ data.tar.gz: 29d3900d598e18cd614d89767029b4dc17795d1b46975464bbae33aefc4df19e68deb526b062e017c6a22394d184980ab29884bee50a3bbe7b96d729847aae7d
@@ -25,7 +25,9 @@ module TeamHub
25
25
  # site generation time.
26
26
  # +site+:: Jekyll site object
27
27
  def self.copy_to_site(site)
28
- copy_directory_to_site site, site.config['team_img_dir']
28
+ copy_files(site, site.config['private_data_path'],
29
+ site.config['team_img_dir'])
30
+ copy_files site, site.config['private_pages_path'], 'assets'
29
31
  end
30
32
 
31
33
  # Determines whether or not a private asset is present.
@@ -40,16 +42,14 @@ module TeamHub
40
42
  # @param site [Jekyll::Site] Jekyll site object
41
43
  # @param dir_to_copy [string] directory within
42
44
  # 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
45
+ def self.copy_files(site, relative_root_path, dir_to_copy)
46
+ abs_dir_to_copy_path = File.join(site.source, relative_root_path,
47
+ dir_to_copy)
48
+ begin_path = abs_dir_to_copy_path.size + File::SEPARATOR.size
49
+ Dir[File.join(abs_dir_to_copy_path, '**', '*')].each do |filename|
50
+ next unless File.file? filename
51
+ site.static_files << ::Jekyll::StaticFile.new(
52
+ site, relative_root_path, dir_to_copy, filename[begin_path..-1])
53
53
  end
54
54
  end
55
55
  end
@@ -23,5 +23,5 @@
23
23
  # https://github.com/18F/hub"
24
24
 
25
25
  module TeamHub
26
- VERSION = "0.0.5"
26
+ VERSION = "0.0.6"
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.5
4
+ version: 0.0.6
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-02-25 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hash-joiner