0

I need to add Copyright information on top of each and every file of my Rails source code. For Eg. Just like Xcode does when you do ios development.

Like:

**********
// Copyright (c) 2012 
// List of Authors
*********
uday
  • 8,544
  • 4
  • 30
  • 54
  • Do you mean how can you add this automatically, or how you can do it in the first place? Comments in Ruby begin with `#`. – tadman Dec 03 '12 at 19:15
  • 1
    This is a function of your editing software, or something you can easily script using a batch or shell script. It's not something you want Rails to do automatically. I recommend it be moved to http://superuser.com/. – the Tin Man Dec 03 '12 at 19:28
  • 1
    @tadman It right now has hundreds of files so I cannot manually doing it. – uday Dec 03 '12 at 20:46
  • +1 for @theTinMan, you need to write a macro or something in your editor to do this by default when you edit a file/create. A good editor is Notepad++. – knownasilya Dec 03 '12 at 22:01

3 Answers3

2

The usual way to do this is to include a file in the base of the project called LICENSE, and include all the copyright information for all files in the project there.

Veraticus
  • 15,944
  • 3
  • 41
  • 45
0

It really depends on your editor of choice, which you should specify. Many editors support some sort of file templates and, as an example, here's how to do it in Rubymine.

mjbraun
  • 117
  • 5
  • My editor is sublime text2. I dint know if there exists macro for it. I never looked into it. – uday Jan 08 '13 at 11:23
-1

For views, you can put it at the top of the app/views/layouts/application.html.erb file, and that should include it in every view, except for partials (those you have to do by hand I think).

Not sure there is a way to do it automatically for anything else.. Might be wrong though.

knownasilya
  • 5,998
  • 4
  • 36
  • 59