mh_extensions 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG.rdoc +2 -0
- data/Manifest +1 -0
- data/Rakefile +1 -1
- data/lib/activerecord_ext.rb +32 -0
- data/lib/mh_extensions.rb +2 -0
- data/mh_extensions.gemspec +3 -3
- metadata +3 -1
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.rdoc
CHANGED
data/Manifest
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('mh_extensions', '0.1.
|
5
|
+
Echoe.new('mh_extensions', '0.1.4') do |p|
|
6
6
|
p.description = "Package of usefull ruby basic classes (and not only) extensions"
|
7
7
|
p.url = "https://github.com/mensfeld/MH-Extensions"
|
8
8
|
p.author = "Maciej Mensfeld"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module ArMH
|
2
|
+
module Extensions
|
3
|
+
|
4
|
+
def self.included(base)
|
5
|
+
base.extend AddActsAsMethod
|
6
|
+
end
|
7
|
+
|
8
|
+
module AddActsAsMethod
|
9
|
+
|
10
|
+
# Should new element be first || last
|
11
|
+
def mh_extensions(*sources)
|
12
|
+
class_eval <<-END
|
13
|
+
include ArMH::Extensions::InstanceMethods
|
14
|
+
END
|
15
|
+
|
16
|
+
if self.column_names.include?('created_by') && self.column_names.include?('updated_by')
|
17
|
+
self.send(:define_method, "created_by=".to_sym) do |author|
|
18
|
+
self.updated_by=author if self.updated_by.nil? || self.updated_by.length == 0
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
module InstanceMethods
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
ActiveRecord::Base.send(:include, ArMH::Extensions)
|
31
|
+
|
32
|
+
|
data/lib/mh_extensions.rb
CHANGED
data/mh_extensions.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{mh_extensions}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Maciej Mensfeld"]
|
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.date = %q{2011-04-17}
|
11
11
|
s.description = %q{Package of usefull ruby basic classes (and not only) extensions}
|
12
12
|
s.email = %q{maciej@mensfeld.pl}
|
13
|
-
s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md", "lib/acts_as_tree_ext.rb", "lib/array.rb", "lib/browser_detector.rb", "lib/date_ext.rb", "lib/hash.rb", "lib/mh_extensions.rb", "lib/rand.rb", "lib/range.rb", "lib/string.rb", "lib/string_ext.rb", "lib/txt_file_handler.rb"]
|
14
|
-
s.files = ["CHANGELOG.rdoc", "Gemfile", "MIT-LICENSE", "Manifest", "README.md", "Rakefile", "init.rb", "lib/acts_as_tree_ext.rb", "lib/array.rb", "lib/browser_detector.rb", "lib/date_ext.rb", "lib/hash.rb", "lib/mh_extensions.rb", "lib/rand.rb", "lib/range.rb", "lib/string.rb", "lib/string_ext.rb", "lib/txt_file_handler.rb", "mh_extensions.gemspec"]
|
13
|
+
s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md", "lib/activerecord_ext.rb", "lib/acts_as_tree_ext.rb", "lib/array.rb", "lib/browser_detector.rb", "lib/date_ext.rb", "lib/hash.rb", "lib/mh_extensions.rb", "lib/rand.rb", "lib/range.rb", "lib/string.rb", "lib/string_ext.rb", "lib/txt_file_handler.rb"]
|
14
|
+
s.files = ["CHANGELOG.rdoc", "Gemfile", "MIT-LICENSE", "Manifest", "README.md", "Rakefile", "init.rb", "lib/activerecord_ext.rb", "lib/acts_as_tree_ext.rb", "lib/array.rb", "lib/browser_detector.rb", "lib/date_ext.rb", "lib/hash.rb", "lib/mh_extensions.rb", "lib/rand.rb", "lib/range.rb", "lib/string.rb", "lib/string_ext.rb", "lib/txt_file_handler.rb", "mh_extensions.gemspec"]
|
15
15
|
s.homepage = %q{https://github.com/mensfeld/MH-Extensions}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Mh_extensions", "--main", "README.md"]
|
17
17
|
s.require_paths = ["lib"]
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: mh_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Maciej Mensfeld
|
@@ -44,6 +44,7 @@ extensions: []
|
|
44
44
|
extra_rdoc_files:
|
45
45
|
- CHANGELOG.rdoc
|
46
46
|
- README.md
|
47
|
+
- lib/activerecord_ext.rb
|
47
48
|
- lib/acts_as_tree_ext.rb
|
48
49
|
- lib/array.rb
|
49
50
|
- lib/browser_detector.rb
|
@@ -63,6 +64,7 @@ files:
|
|
63
64
|
- README.md
|
64
65
|
- Rakefile
|
65
66
|
- init.rb
|
67
|
+
- lib/activerecord_ext.rb
|
66
68
|
- lib/acts_as_tree_ext.rb
|
67
69
|
- lib/array.rb
|
68
70
|
- lib/browser_detector.rb
|
metadata.gz.sig
CHANGED
Binary file
|