Class: Npm2Rpm::Changes

Inherits:
Object
  • Object
show all
Defined in:
lib/npm2rpm/changes.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, metadata, options) ⇒ Changes

Returns a new instance of Changes.



4
5
6
7
8
# File 'lib/npm2rpm/changes.rb', line 4

def initialize name, , options
  @name = name
  @metadata = 
  @options = options
end

Instance Method Details

#writeObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/npm2rpm/changes.rb', line 9

def write
  # create .changes file as
  # -------------------------------------------------------------------
  # Sat Oct  5 12:29:03 UTC 2013 - [email protected]
  
  File.open("#{@name}.changes", "w+") do |f|
    f.puts "-------------------------------------------------------------------"
    f.puts "#{@options.date} - #{@options.email}@suse.com"
    f.puts
    f.puts "- Initial version #{@metadata.version}"
  end
end