runge 0.0.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/lib/runge.rb +15 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1e7867903cd5d13541795717ce62e26fc1534a95
|
4
|
+
data.tar.gz: 2fe68abd59bf67f1e500f1b15132d35f9195afad
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9cef58291f964487df1c5f981f54e435b46ec28c97a94117c63b2a7eef207d9029dabbde3d69c631b2dd5e599afd41949b5f95ba5ba5796cc8da24eb9a1e8b39
|
7
|
+
data.tar.gz: b94c9e188266d998739fdedf7336473706000fe60f277291f66f1858b20ec0bcf05c31a28b61a8da3c4bff90e3b7eef72c757d12648e4d3fb9376b8ab17b06bb
|
data/lib/runge.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
class Runge
|
2
|
+
# munge each string
|
3
|
+
def self.munge_string(string)
|
4
|
+
# don't mutate short strings
|
5
|
+
return string if string.length == 1 || string.length == 2
|
6
|
+
# don't mutate integers
|
7
|
+
return string if string.to_i > 0
|
8
|
+
# munge each string
|
9
|
+
string.split("").each_with_index { |x, i| x.succ! if i.odd? }.join
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.munge(string)
|
13
|
+
string.split(/(\W)/).map { |x| Runge.munge_string(x) }.join
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: runge
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jake Worth
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A data munger, written in Ruby
|
14
|
+
email: jake@worth-chicago.co
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/runge.rb
|
20
|
+
homepage:
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.0.14
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: A data munger, written in Ruby
|
44
|
+
test_files: []
|