to-class 1.1 → 1.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.markdown +1 -1
- data/lib/to-class.rb +3 -2
- data/to-class.gemspec +1 -1
- metadata +8 -23
data/README.markdown
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
To Class
|
2
2
|
========
|
3
3
|
|
4
|
-
This gem adds a `to_class` method to `ActiveSupport::Inflector` and
|
4
|
+
This gem adds a `to_class` method to `ActiveSupport::Inflector`, `Symbol`, and `String` that combines the functionality of ActiveSupport’s [`camelize`](http://rubydoc.info/gems/activesupport/ActiveSupport/Inflector:camelize) and [`constantize`](http://rubydoc.info/gems/activesupport/ActiveSupport/Inflector:constantize) methods—it will convert the object in question to Camel case and then try to find a declared constant with the corresponding name. This allows you to easily get a class from its name with one simple method invokation.
|
5
5
|
|
6
6
|
Full documentation is at [RubyDoc.info](http://rubydoc.info/gems/to-class).
|
7
7
|
|
data/lib/to-class.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require('cody_robbins/to_class')
|
2
2
|
|
3
|
-
[[
|
4
|
-
[
|
3
|
+
[[ActiveSupport::Inflector, CodyRobbins::ToClass],
|
4
|
+
[Symbol, CodyRobbins::ToClass],
|
5
|
+
[String, CodyRobbins::ToClass]].each do |target, library|
|
5
6
|
target.send(:include, library)
|
6
7
|
end
|
data/to-class.gemspec
CHANGED
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to-class
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
version: "1.1"
|
4
|
+
prerelease:
|
5
|
+
version: "1.2"
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Cody Robbins
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-22 00:00:00 -04:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,9 +21,6 @@ dependencies:
|
|
25
21
|
requirements:
|
26
22
|
- - ">="
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
hash: 3
|
29
|
-
segments:
|
30
|
-
- 0
|
31
24
|
version: "0"
|
32
25
|
type: :runtime
|
33
26
|
version_requirements: *id001
|
@@ -67,12 +60,10 @@ has_rdoc: true
|
|
67
60
|
homepage: http://codyrobbins.com/software/to-class
|
68
61
|
licenses: []
|
69
62
|
|
70
|
-
post_install_message:
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
-------------------------------------------------------------
|
75
|
-
|
63
|
+
post_install_message: "\n\
|
64
|
+
-------------------------------------------------------------\n\
|
65
|
+
Follow me on Twitter: http://twitter.com/codyrobbins\n\
|
66
|
+
-------------------------------------------------------------\n\n"
|
76
67
|
rdoc_options: []
|
77
68
|
|
78
69
|
require_paths:
|
@@ -82,23 +73,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
73
|
requirements:
|
83
74
|
- - ">="
|
84
75
|
- !ruby/object:Gem::Version
|
85
|
-
hash: 3
|
86
|
-
segments:
|
87
|
-
- 0
|
88
76
|
version: "0"
|
89
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
78
|
none: false
|
91
79
|
requirements:
|
92
80
|
- - ">="
|
93
81
|
- !ruby/object:Gem::Version
|
94
|
-
hash: 3
|
95
|
-
segments:
|
96
|
-
- 0
|
97
82
|
version: "0"
|
98
83
|
requirements: []
|
99
84
|
|
100
85
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.
|
86
|
+
rubygems_version: 1.6.2
|
102
87
|
signing_key:
|
103
88
|
specification_version: 3
|
104
89
|
summary: Get a class from a symbol or string of its name in one fell swoop.
|