snake_camel 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31c620ba5acdb1165247d486517d21ba8a4002a6
4
- data.tar.gz: f35f25b38e1adc6da865b0a4898af854a8373ef3
3
+ metadata.gz: a5f12416d094b8ebaab8fc60554dc898803b9bdf
4
+ data.tar.gz: 93618a836907ec6a43b241470b3261f24dd2eb06
5
5
  SHA512:
6
- metadata.gz: e3a908bdb57725bd140e6d21bbd5cc362cf769de4d610844704af5a80a5e0c35e578cbae04260bd8c123764042c7bb8bed7cccb0da0d6e3afda199abbaf76899
7
- data.tar.gz: b12bba3871b5cb86d4b10b6acd0fc908528c4bb46b20646bedd89afdab1fa1f6d0f3bfadd337621ba51e3fd46040a37b80038ff5b18c30b39865ee9e6eaebcd8
6
+ metadata.gz: ebe851acfb76d59f5773c799591be80592c0748ffc7a1897ac7aec3f07814eaa83e71394da33650e9f4f821fd220604829c68718f86720a20986527cb77e15dc
7
+ data.tar.gz: b17223e14b3235ec8bdd12679aaccb8cb2dbc8ee514dca1c78ee5375e0a9bbd28f438c56a88872d2a4758ae50674d8f48ef29109c001e9d96a2a71b4704a81af
data/README.md CHANGED
@@ -29,6 +29,10 @@ Or install it yourself as:
29
29
 
30
30
  - camelcase!
31
31
 
32
+ - constant_name ('hello/world_sup' #=> Hello::WorldSup)
33
+
34
+ - path_name ('Hello::WorldSup #=> hello/world_sup')
35
+
32
36
 
33
37
  ## Usage
34
38
 
@@ -23,5 +23,9 @@ module SnakeCamel
23
23
  SnakeCamel::Methods.constant_name(self)
24
24
  end
25
25
 
26
+ def path_name
27
+ SnakeCamel::Methods.path_name(self)
28
+ end
29
+
26
30
  end
27
31
  end
@@ -22,5 +22,10 @@ module SnakeCamel
22
22
  string.split(File::Separator).map { |part| camelcase(part) }.join('::')
23
23
  end
24
24
 
25
+ def path_name(camelcase_string)
26
+ return snakecase(camelcase_string).insert(0, File::Separator) unless camelcase_string.match(/::/)
27
+ camelcase_string.split("::").map { |part| snakecase(part) }.join(File::Separator)
28
+ end
29
+
25
30
  end
26
31
  end
@@ -1,3 +1,3 @@
1
1
  module SnakeCamel
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snake_camel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Balint Bejczi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-09 00:00:00.000000000 Z
11
+ date: 2016-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -98,5 +98,5 @@ rubyforge_project:
98
98
  rubygems_version: 2.2.2
99
99
  signing_key:
100
100
  specification_version: 4
101
- summary: conversation between CamelCase and snake_case
101
+ summary: converion between CamelCase and snake_case
102
102
  test_files: []