virtualfs 0.1.0 → 0.1.1

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.
data/Gemfile.lock CHANGED
@@ -1,17 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- virtualfs (0.0.2)
4
+ virtualfs (0.1.0)
5
5
  github_api (~> 0.8)
6
+ unicode (~> 0.4.4)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
11
  diff-lcs (1.1.3)
11
12
  fakefs (0.4.2)
12
- faraday (0.8.4)
13
+ faraday (0.8.5)
13
14
  multipart-post (~> 1.1)
14
- github_api (0.8.7)
15
+ github_api (0.8.11)
15
16
  faraday (~> 0.8.1)
16
17
  hashie (~> 1.2.0)
17
18
  multi_json (~> 1.4)
@@ -21,16 +22,18 @@ GEM
21
22
  httpauth (0.2.0)
22
23
  jwt (0.1.5)
23
24
  multi_json (>= 1.0)
24
- multi_json (1.5.0)
25
+ multi_json (1.5.1)
26
+ multi_xml (0.5.3)
25
27
  multipart-post (1.1.5)
26
28
  nokogiri (1.5.6)
27
- oauth2 (0.8.0)
29
+ oauth2 (0.9.0)
28
30
  faraday (~> 0.8)
29
31
  httpauth (~> 0.1)
30
32
  jwt (~> 0.1.4)
31
33
  multi_json (~> 1.0)
34
+ multi_xml (~> 0.5)
32
35
  rack (~> 1.2)
33
- rack (1.4.4)
36
+ rack (1.5.2)
34
37
  rspec (2.12.0)
35
38
  rspec-core (~> 2.12.0)
36
39
  rspec-expectations (~> 2.12.0)
@@ -39,6 +42,7 @@ GEM
39
42
  rspec-expectations (2.12.1)
40
43
  diff-lcs (~> 1.1.3)
41
44
  rspec-mocks (2.12.1)
45
+ unicode (0.4.4)
42
46
 
43
47
  PLATFORMS
44
48
  ruby
@@ -2,6 +2,7 @@ require 'virtualfs/backend'
2
2
 
3
3
  require 'base64'
4
4
  require 'stringio'
5
+ require 'unicode'
5
6
  require 'github_api'
6
7
 
7
8
  module VirtualFS
@@ -50,7 +51,14 @@ module VirtualFS
50
51
 
51
52
  def internal_items
52
53
  cache do
53
- @gh.trees.get(@user, @repo, @branch, :recursive => true).tree.reduce({}) { |hash, item| hash[item.path] = item; hash }
54
+ @gh.trees.get(@user, @repo, @branch, :recursive => true).tree.reduce({}) do |hash, item|
55
+ # Handle decomposed UTF-8 in Github's response
56
+ item.path = fix_utf8(item.path)
57
+
58
+ # Make a hash
59
+ hash[item.path] = item
60
+ hash
61
+ end
54
62
  end
55
63
  end
56
64
 
@@ -67,5 +75,9 @@ module VirtualFS
67
75
  Base64.decode64 @gh.blobs.get(@user, @repo, sha).content
68
76
  end
69
77
  end
78
+
79
+ def fix_utf8(string)
80
+ Unicode::normalize_C(string.gsub(/^"|"$/, '').gsub(/\\(\d{3})/) { $1.to_i(8).chr }.force_encoding('utf-8'))
81
+ end
70
82
  end
71
83
  end
@@ -1,3 +1,3 @@
1
1
  module VirtualFS
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/virtualfs.gemspec CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.version = VirtualFS::VERSION
16
16
 
17
17
  gem.add_dependency 'github_api', '~> 0.8'
18
+ gem.add_dependency 'unicode', '~> 0.4.4'
18
19
 
19
20
  gem.add_development_dependency 'rspec', '~> 2.12'
20
21
  gem.add_development_dependency 'fakefs', '~> 0.4'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: virtualfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-21 00:00:00.000000000 Z
12
+ date: 2013-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: github_api
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.8'
30
+ - !ruby/object:Gem::Dependency
31
+ name: unicode
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.4.4
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.4.4
30
46
  - !ruby/object:Gem::Dependency
31
47
  name: rspec
32
48
  requirement: !ruby/object:Gem::Requirement