Skip to content
This repository
Browse code

resolve deprecation due to use of class_inheritable_accessor

makes the gem buildable from source adding a gemspec
  • Loading branch information...
commit f6bd20d48496a0b89b990a3f88085437d0be5520 1 parent 524fb87
Andrea Campolonghi authored December 29, 2011
4  .gitignore
... ...
@@ -1,2 +1,6 @@
  1
+*.gem
  2
+.bundle
  3
+Gemfile.lock
  4
+pkg/*
1 5
 *.log
2 6
 *.sqlite3
1  Rakefile
... ...
@@ -1,3 +1,4 @@
  1
+require 'bundler/gem_tasks'
1 2
 require 'rake'
2 3
 require 'rake/testtask'
3 4
 require 'rake/rdoctask'
4  lib/userstamp.rb
... ...
@@ -1,3 +1,7 @@
  1
+require "userstamp/stamper"
  2
+require "userstamp/stampable"
  3
+require "userstamp/migration_helper"
  4
+
1 5
 module Ddb
2 6
   module Controller
3 7
     # The Userstamp module, when included into a controller, adds a before filter
0  lib/migration_helper.rb → lib/userstamp/migration_helper.rb
File renamed without changes
10  lib/stampable.rb → lib/userstamp/stampable.rb
@@ -26,26 +26,26 @@ def self.included(base) #:nodoc:
26 26
           include InstanceMethods
27 27
 
28 28
           # Should ActiveRecord record userstamps? Defaults to true.
29  
-          class_inheritable_accessor  :record_userstamp
  29
+          class_attribute  :record_userstamp
30 30
           self.record_userstamp = true
31 31
 
32 32
           # Which class is responsible for stamping? Defaults to :user.
33  
-          class_inheritable_accessor  :stamper_class_name
  33
+          class_attribute  :stamper_class_name
34 34
 
35 35
           # What column should be used for the creator stamp?
36 36
           # Defaults to :creator_id when compatibility mode is off
37 37
           # Defaults to :created_by when compatibility mode is on
38  
-          class_inheritable_accessor  :creator_attribute
  38
+          class_attribute  :creator_attribute
39 39
 
40 40
           # What column should be used for the updater stamp?
41 41
           # Defaults to :updater_id when compatibility mode is off
42 42
           # Defaults to :updated_by when compatibility mode is on
43  
-          class_inheritable_accessor  :updater_attribute
  43
+          class_attribute  :updater_attribute
44 44
 
45 45
           # What column should be used for the deleter stamp?
46 46
           # Defaults to :deleter_id when compatibility mode is off
47 47
           # Defaults to :deleted_by when compatibility mode is on
48  
-          class_inheritable_accessor  :deleter_attribute
  48
+          class_attribute  :deleter_attribute
49 49
 
50 50
           self.stampable
51 51
         end
0  lib/stamper.rb → lib/userstamp/stamper.rb
File renamed without changes
3  lib/userstamp/version.rb
... ...
@@ -0,0 +1,3 @@
  1
+module Userstamp
  2
+  VERSION = 2.0
  3
+end
25  userstamp.gemspec
... ...
@@ -0,0 +1,25 @@
  1
+# -*- encoding: utf-8 -*-
  2
+
  3
+$:.push File.expand_path("../lib", __FILE__)
  4
+require "userstamp/version"
  5
+
  6
+Gem::Specification.new do |s|
  7
+  s.name        = "userstamp"
  8
+  s.version     = Userstamp::VERSION
  9
+  s.authors     = ["delynn"]
  10
+  s.email       = [""]
  11
+  s.homepage    = ""
  12
+  s.summary     = ""
  13
+  s.description = %q{This Rails plugin extends ActiveRecord::Base to add automatic updating of created_by and updated_by attributes of your models in much the same way that the ActiveRecord::Timestamp module updates created_(at/on) and updated_(at/on) attributes.}
  14
+
  15
+  s.rubyforge_project = "userstamp"
  16
+
  17
+  s.files         = `git ls-files`.split("\n")
  18
+  s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
  19
+  s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
  20
+  s.require_paths = ["lib"]
  21
+
  22
+  # specify any dependencies here; for example:
  23
+  # s.add_development_dependency "rspec"
  24
+  # s.add_runtime_dependency "rest-client"
  25
+end

0 notes on commit f6bd20d

Please sign in to comment.
Something went wrong with that request. Please try again.