Class: Buildify::AssemblyVersion
- Inherits:
-
Object
- Object
- Buildify::AssemblyVersion
- Includes:
- Rake::DSL
- Defined in:
- lib/buildify/assembly_version.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ AssemblyVersion
constructor
A new instance of AssemblyVersion.
- #version_assemblies ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ AssemblyVersion
Returns a new instance of AssemblyVersion.
7 8 9 |
# File 'lib/buildify/assembly_version.rb', line 7 def initialize(opts = {}) = opts end |
Instance Method Details
#version_assemblies ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/buildify/assembly_version.rb', line 11 def version_assemblies() [:paths].each do |path| if path.include? '.vb' File.open(path, 'w') do |f| f.puts "Imports System.Reflection" f.puts "Imports System.Runtime.InteropServices" f.puts "<assembly: AssemblyCompany(\"" + [:company_name] + "\")>" f.puts "<assembly: AssemblyProduct(\"" + [:product_name] + "\")>" f.puts "<assembly: AssemblyCopyright(\"Copyright " + Time.now.year.to_s + " " + [:company_name] + "\")>" f.puts "<assembly: AssemblyVersion(\"" + [:version] + "\")>" f.puts "<assembly: AssemblyFileVersion(\"" + [:version] + "\")>" end end if path.include? '.cs' File.open(path, 'w') do |f| f.puts "using System.Reflection;" f.puts "using System.Runtime.InteropServices;" f.puts "[assembly: AssemblyCompany(\"" + [:company_name] + "\")]" f.puts "[assembly: AssemblyProduct(\"" + [:product_name] + "\")]" f.puts "[assembly: AssemblyCopyright(\"Copyright " + Time.now.strftime("%Y") + " " + [:company_name] + "\")]" f.puts "[assembly: AssemblyVersion(\"" + [:version] + "\")]" f.puts "[assembly: AssemblyFileVersion(\"" + [:version] + "\")]" end end end end |