thefox-ext 0.1.0
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.
- checksums.yaml +7 -0
- data/README.md +10 -0
- data/lib/thefox-ext/ext/string.rb +26 -0
- data/lib/thefox-ext/version.rb +7 -0
- data/lib/thefox-ext.rb +3 -0
- data/thefox-ext.gemspec +23 -0
- data/thefox-ext.sublime-project +10 -0
- metadata +50 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5bfbfef7a72df5d3ec2810922560aee991678a68
|
4
|
+
data.tar.gz: f7af2bb9e3a23cb0660f68982a3d571187c0d8c2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 577eb4d3c388fb7d375028ce3831616e30ba5ac1d42ada04e79cbd608dea7e8d7ae2fa4b70b9934bda8eb67ffa94b815650f529c97c8e6fa9a88409bcc647d2e
|
7
|
+
data.tar.gz: ef68625eb343269f149896ced5a49063f16cf0650bff20dfe8cebc217f7ac27598cc31679b0959bf4c0b2afb2a850c6090fa29cf5e7f23c28946f0cc83648cab
|
data/README.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# Extended Ruby Classes
|
2
|
+
|
3
|
+
Extended and useful helper classes for Ruby.
|
4
|
+
|
5
|
+
## License
|
6
|
+
Copyright (C) 2015 Christian Mayer <http://fox21.at>
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
9
|
+
|
10
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
class String
|
3
|
+
def titlecase
|
4
|
+
self
|
5
|
+
.split(/ /)
|
6
|
+
.map{ |word| word.capitalize }
|
7
|
+
.join(' ')
|
8
|
+
end
|
9
|
+
|
10
|
+
def is_utf8?
|
11
|
+
begin
|
12
|
+
self.unpack('U*')
|
13
|
+
rescue
|
14
|
+
return false
|
15
|
+
end
|
16
|
+
return true
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_utf8
|
20
|
+
if is_utf8?
|
21
|
+
self.force_encoding('UTF-8')
|
22
|
+
else
|
23
|
+
self.force_encoding('ISO-8859-1').encode('UTF-8')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/thefox-ext.rb
ADDED
data/thefox-ext.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: UTF-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
require 'thefox-ext/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = 'thefox-ext'
|
10
|
+
spec.version = TheFox::Ext::VERSION
|
11
|
+
spec.date = TheFox::Ext::DATE
|
12
|
+
spec.author = 'Christian Mayer'
|
13
|
+
spec.email = 'christian@fox21.at'
|
14
|
+
|
15
|
+
spec.summary = %q{Extended Ruby Classes}
|
16
|
+
spec.description = %q{Extended and useful helper classes for Ruby.}
|
17
|
+
spec.homepage = 'https://github.com/TheFox/ext.rb'
|
18
|
+
spec.license = 'GPL-3.0'
|
19
|
+
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject{ |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
spec.required_ruby_version = '>=2.2.0'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: thefox-ext
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Christian Mayer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-06 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Extended and useful helper classes for Ruby.
|
14
|
+
email: christian@fox21.at
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- README.md
|
20
|
+
- lib/thefox-ext.rb
|
21
|
+
- lib/thefox-ext/ext/string.rb
|
22
|
+
- lib/thefox-ext/version.rb
|
23
|
+
- thefox-ext.gemspec
|
24
|
+
- thefox-ext.sublime-project
|
25
|
+
homepage: https://github.com/TheFox/ext.rb
|
26
|
+
licenses:
|
27
|
+
- GPL-3.0
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.2.0
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 2.4.7
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: Extended Ruby Classes
|
49
|
+
test_files: []
|
50
|
+
has_rdoc:
|