visual_studio 0.0.0.5 → 0.0.0.6

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: a6aaa1737a0db9d1ec348f2076a8e1c29b4bad09
4
- data.tar.gz: 0ba390804d52e478e005492b32a351fe23a69a3a
3
+ metadata.gz: 40f26054ca552b0d0f0215323683f4fdbe850693
4
+ data.tar.gz: 980f9dff84fbbe766fee4692939d3fce7c3476f3
5
5
  SHA512:
6
- metadata.gz: 45e9a9716350c82a74f707ff0085994719f2f604e4c3ba06d112fbc01cd98ffab4d2be19aac77207c5bd0e91fb6029ebc016f16821e081eec707a0e76fcff9c9
7
- data.tar.gz: 80249bc85d3f3b2fbf0c3f96ede80a0e279c2a6fb97f8ecd8ad04e3d533d479d6114ff7b8845bf0a488dc156221f26511c8025a0a5822a6125ef70c3b1791728
6
+ metadata.gz: e6f49ec8e989dd15173293ee3c19ca242c454b29aba857c444c27c7ebf34c62054e7f9935f7b118c248bf14e39a4d41d9696b388a04108e0b8e4db5c5bdfc442
7
+ data.tar.gz: fec2c8dfd37b1f174a470d18c287cb164df32a785b51600ebaace30a217e70934927b94d0f4374019aa499c6ce0c114fa7778e02d7b103bb761bcdefcbf7e13f
@@ -27,6 +27,7 @@ module VisualStudio
27
27
 
28
28
  require 'visual_studio/install'
29
29
  require 'visual_studio/product'
30
+ require 'visual_studio/environment'
30
31
 
31
32
  require 'visual_studio/sdks/windows'
32
33
 
@@ -0,0 +1,34 @@
1
+ module VisualStudio
2
+ module Environment
3
+ SEARCH_DIRECTORIES = ['PATH', 'INCLUDE', 'LIB', 'LIBPATH']
4
+
5
+ def self.merge(base, overlay)
6
+ # TODO(mtwilliams): Verify match-up between VCInstallDir and VisualStudioVersion?
7
+ # TODO(mtwilliams): Rederive environment variables based on VCInstallDir and/or WindowsSdkDir.
8
+ env = base.to_h.merge(overlay.to_h) do |variable, base, overlay|
9
+ if SEARCH_DIRECTORIES.include? variable
10
+ # TODO(mtwilliams): Detect new Visual Studio or Windows SDK related
11
+ # paths and replace the old ones based on that.
12
+ base = base.split(';')
13
+ overlay = overlay.split(';')
14
+
15
+ cwd = base.include?('.') || overlay.include?('.')
16
+
17
+ # HACK(mtwilliams): We're using File.expand_path here to "normalize"
18
+ # paths to prevent duplicates, but this could very likely have
19
+ # disastrous effects.
20
+ base = base.reject{|p| p=='.'}.map{|p| File.expand_path(p)}
21
+ overlay = overlay.reject{|p| p=='.'}.map{|p| File.expand_path(p)}
22
+
23
+ path = base | overlay
24
+ path = ['.'] + path if cwd
25
+
26
+ path.join(';')
27
+ else
28
+ # Default to the overlay, or right-hand side.
29
+ overlay
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -41,7 +41,7 @@ module VisualStudio
41
41
  end
42
42
 
43
43
  module VERSION #:nodoc:
44
- MAJOR, MINOR, PATCH, PRE = [0, 0, 0, 5]
44
+ MAJOR, MINOR, PATCH, PRE = [0, 0, 0, 6]
45
45
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
46
46
  end
47
47
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visual_studio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.5
4
+ version: 0.0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-27 00:00:00.000000000 Z
11
+ date: 2015-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -65,6 +65,7 @@ files:
65
65
  - README.md
66
66
  - Rakefile
67
67
  - lib/visual_studio.rb
68
+ - lib/visual_studio/environment.rb
68
69
  - lib/visual_studio/gem.rb
69
70
  - lib/visual_studio/helpers/pretty_string.rb
70
71
  - lib/visual_studio/install.rb