sashimi 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +12 -0
- data/README +4 -0
- data/lib/sashimi/core_ext/class.rb +31 -0
- data/lib/sashimi/core_ext.rb +1 -0
- data/lib/sashimi/version.rb +9 -0
- data/sashimi.gemspec +3 -3
- data/test/unit/core_ext/class_test.rb +22 -0
- data/test/unit/version_test.rb +8 -0
- metadata +13 -6
data/CHANGELOG
CHANGED
data/README
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
class Class
|
2
|
+
# Dinamically creates a proxy for given class methods.
|
3
|
+
#
|
4
|
+
# Example:
|
5
|
+
#
|
6
|
+
# class Repository
|
7
|
+
# def self.path
|
8
|
+
# @@path
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
# class_method_proxy :path
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# It produces:
|
15
|
+
# # Proxy method for <tt>Repository#path</tt>
|
16
|
+
# def path
|
17
|
+
# self.class.path
|
18
|
+
# end
|
19
|
+
# private :path
|
20
|
+
def class_method_proxy(*method_names)
|
21
|
+
method_names.each do |m|
|
22
|
+
self.class_eval %{
|
23
|
+
# Proxy method for <tt>#{self.class.name}##{m}</tt>
|
24
|
+
def #{m}(*args)
|
25
|
+
self.class.#{m}(*args)
|
26
|
+
end
|
27
|
+
private :#{m}
|
28
|
+
}, __FILE__, __LINE__
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Dir[File.dirname(__FILE__) + '/core_ext/*.rb'].each{|f| require f}
|
data/sashimi.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "sashimi"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.7"
|
4
4
|
s.date = "2008-06-23"
|
5
5
|
s.summary = "Rails plugins manager"
|
6
6
|
s.author = "Luca Guidi"
|
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.has_rdoc = true
|
11
11
|
s.rubyforge_project = %q{sashimi}
|
12
12
|
s.executables = [ 'sashimi' ]
|
13
|
-
s.files = [
|
14
|
-
s.test_files = [
|
13
|
+
s.files = Dir['**/*'].reject {|f| File.directory?(f)}.sort
|
14
|
+
s.test_files = Dir['test/**/*_test.rb'].reject {|f| File.directory?(f)}.sort
|
15
15
|
s.extra_rdoc_files = ['README', 'CHANGELOG']
|
16
16
|
|
17
17
|
s.add_dependency("activesupport", ["> 0.0.0"])
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'test/test_helper'
|
3
|
+
|
4
|
+
class Repository
|
5
|
+
def self.path
|
6
|
+
@@path ||= 'path'
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.another_path(another_path)
|
10
|
+
another_path
|
11
|
+
end
|
12
|
+
|
13
|
+
class_method_proxy :path, :another_path
|
14
|
+
end
|
15
|
+
|
16
|
+
class ClassTest < Test::Unit::TestCase
|
17
|
+
def test_should_respond_to_proxied_methods
|
18
|
+
repository = Repository.new
|
19
|
+
assert repository.send(:path)
|
20
|
+
assert repository.send(:another_path, 'another_path')
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sashimi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
@@ -33,23 +33,28 @@ extra_rdoc_files:
|
|
33
33
|
files:
|
34
34
|
- CHANGELOG
|
35
35
|
- MIT-LICENSE
|
36
|
-
- Rakefile
|
37
36
|
- README
|
38
|
-
-
|
39
|
-
- setup.rb
|
37
|
+
- Rakefile
|
40
38
|
- bin/sashimi
|
39
|
+
- lib/sashimi.rb
|
41
40
|
- lib/sashimi/commands.rb
|
41
|
+
- lib/sashimi/core_ext.rb
|
42
|
+
- lib/sashimi/core_ext/class.rb
|
42
43
|
- lib/sashimi/plugin.rb
|
44
|
+
- lib/sashimi/repositories.rb
|
43
45
|
- lib/sashimi/repositories/abstract_repository.rb
|
44
46
|
- lib/sashimi/repositories/git_repository.rb
|
45
47
|
- lib/sashimi/repositories/svn_repository.rb
|
46
|
-
- lib/sashimi/
|
47
|
-
-
|
48
|
+
- lib/sashimi/version.rb
|
49
|
+
- sashimi.gemspec
|
50
|
+
- setup.rb
|
48
51
|
- test/test_helper.rb
|
52
|
+
- test/unit/core_ext/class_test.rb
|
49
53
|
- test/unit/plugin_test.rb
|
50
54
|
- test/unit/repositories/abstract_repository_test.rb
|
51
55
|
- test/unit/repositories/git_repository_test.rb
|
52
56
|
- test/unit/repositories/svn_repository_test.rb
|
57
|
+
- test/unit/version_test.rb
|
53
58
|
has_rdoc: true
|
54
59
|
homepage: http://lucaguidi.com/pages/sashimi
|
55
60
|
post_install_message:
|
@@ -77,7 +82,9 @@ signing_key:
|
|
77
82
|
specification_version: 2
|
78
83
|
summary: Rails plugins manager
|
79
84
|
test_files:
|
85
|
+
- test/unit/core_ext/class_test.rb
|
80
86
|
- test/unit/plugin_test.rb
|
81
87
|
- test/unit/repositories/abstract_repository_test.rb
|
82
88
|
- test/unit/repositories/git_repository_test.rb
|
83
89
|
- test/unit/repositories/svn_repository_test.rb
|
90
|
+
- test/unit/version_test.rb
|