cross_platform_csproj 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/cross_platform_csproj.rb +9 -2
  2. metadata +2 -2
@@ -47,8 +47,15 @@ class CrossPlatformCSProj
47
47
  end
48
48
 
49
49
  def self.saveDocument(document, projectFile)
50
- documentContents = document.to_xml(:indent => 4)
50
+ documentContents = document.to_xml(:indent => 2)
51
51
 
52
+ # Formatting to appease Visual Studio.
53
+ # Visual Studio will self terminating XML blocks (eg: <br/>) with a space (eg: <br />)
54
+ documentContents = documentContents.gsub(/([^\s])\/\>/, '\1 />')
55
+
56
+ # Visual Studio will remove any newline characters on the final line
57
+ documentContents = documentContents.gsub(/\n$/, '')
58
+
52
59
  fileHandle = File.open(projectFile)
53
60
  documentContentsOld = fileHandle.read
54
61
  fileHandle.close
@@ -56,7 +63,7 @@ class CrossPlatformCSProj
56
63
  # Only write to the file if there has been changes. This will allow updateProject to be called many times without Visual Studio from needing to reload the project
57
64
  if documentContentsOld != documentContents
58
65
  fileHandle = File.open(projectFile, 'w')
59
- fileHandle.puts(documentContents)
66
+ fileHandle.print(documentContents)
60
67
  fileHandle.close
61
68
  end
62
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cross_platform_csproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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-03-01 00:00:00.000000000 Z
12
+ date: 2013-07-19 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Offers functions which synchronize the file and folder structure to a
15
15
  CSharp project. Users maintain a cross platform CSharp library using the file system. Running