gvishnu-string-self 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +23 -0
- data/lib/string_self.rb +26 -0
- metadata +54 -0
data/README
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
String self is a simple tool to create Java FQDN like objects in Ruby.
|
4
|
+
|
5
|
+
Example:
|
6
|
+
|
7
|
+
See test/test_string_self.rb
|
8
|
+
|
9
|
+
expected = "com.vysnu.self_object"
|
10
|
+
assert_equal expected, com.vysnu.self_object
|
11
|
+
|
12
|
+
To install:
|
13
|
+
|
14
|
+
1) Add github as a gem source.
|
15
|
+
2) gem install gvishnu-string-self
|
16
|
+
|
17
|
+
|
18
|
+
---
|
19
|
+
Vishnu Gopal.
|
20
|
+
May 2009.
|
21
|
+
|
22
|
+
This code is released into the public domain.
|
23
|
+
|
data/lib/string_self.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
class StringSelf < String
|
3
|
+
|
4
|
+
attr_accessor :string_queue, :separator
|
5
|
+
|
6
|
+
def initialize(identifier, separator = ".", queue = [])
|
7
|
+
self.string_queue ||= queue
|
8
|
+
self.separator = separator
|
9
|
+
suffix(identifier)
|
10
|
+
super(self.to_s)
|
11
|
+
end
|
12
|
+
|
13
|
+
def suffix(identifier)
|
14
|
+
self.string_queue.push(identifier)
|
15
|
+
end
|
16
|
+
|
17
|
+
def method_missing(meth, args = [])
|
18
|
+
StringSelf.new(meth.to_s, separator, string_queue)
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_s
|
22
|
+
self.string_queue.join(separator)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
metadata
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gvishnu-string-self
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Vishnu Gopal
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-27 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: String self is a simple tool to create Java FQDN like objects in Ruby.
|
17
|
+
email: g.vishnu@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- README
|
26
|
+
- lib/string_self.rb
|
27
|
+
has_rdoc: false
|
28
|
+
homepage: http://github.com/gvishnu/string-self/
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
|
32
|
+
require_paths:
|
33
|
+
- lib
|
34
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: "0"
|
39
|
+
version:
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: "0"
|
45
|
+
version:
|
46
|
+
requirements: []
|
47
|
+
|
48
|
+
rubyforge_project: string-self
|
49
|
+
rubygems_version: 1.2.0
|
50
|
+
signing_key:
|
51
|
+
specification_version: 2
|
52
|
+
summary: String self is a simple tool to create Java FQDN like objects in Ruby.
|
53
|
+
test_files: []
|
54
|
+
|