headingify 1.2.0 → 1.2.1

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: 19c230f8069815d774ce08c44c8ce9fae9a8e5f9
4
- data.tar.gz: 9f57a53a7b61750b719ff9c709bb9e9eade595bf
3
+ metadata.gz: 31b6d22444c239ee297eb53cc596f8aefe0b4562
4
+ data.tar.gz: eed0d4a5ae4760e21e87728275bacdc5e225d4ca
5
5
  SHA512:
6
- metadata.gz: 738d7bf6f2fa74a28f0a6a60fde36b026eb3c38e52c1448d0daf45ea09ece2922d55d49c3badcc83f2d5af80f1f4bc35fff152f1ad4e08286a097f60747f3c4e
7
- data.tar.gz: ac8b0bd78765728901be8fb2d6a01f36b1c8cd94d6513f69a6ccc785451f96895d64762764647af043add06c6bb1a576a8bb1716265c9c80cc616fd6951dc561
6
+ metadata.gz: 31f006f6a2f7d708c70b7117ec20d5dc245e13a1da53cb50b014b63cc37192c5fc52dba98f8473aa16f545b05932fa68b69c6819c94ff4a98647458c5136517b
7
+ data.tar.gz: 7aa13216020ba2a1f92a05af333abe2a663c7ed1ac5a047a3aba15f6fa3288aedab5e0785d8eaa411fed4820f85abccb1ed7b910bfb35cdecad983be03a8d570
@@ -3,9 +3,7 @@
3
3
  require 'headingify'
4
4
 
5
5
  # print help by default
6
- if ARGV.length == 0
7
- print Headingify.help
8
- end
6
+ print Headingify.help if ARGV.length == 0
9
7
 
10
8
  ARGV.each_with_index do |s, i|
11
9
  if s =~ /^-{1,}h$/ || s =~ /^-{1,}help$/
@@ -50,7 +50,17 @@ class String
50
50
 
51
51
  # capitalize only what's necessary
52
52
  working.each_with_index do |s, i|
53
- working[i] = s.gsub /\%/, "" if s.include? "\%"
53
+ if s.include? "\%"
54
+ working[i] = s.delete "\\%"
55
+
56
+ # buckass patch for executable access
57
+ if working[i][0] == "\\" || working[i][working.length - 1] == "\\"
58
+ working[i].delete! "\\"
59
+ end
60
+
61
+ next
62
+ end
63
+
54
64
  next if s =~ /^o'.*$/
55
65
  if blacklist.include?(s) && i == 0; s.capitalize!; next; end
56
66
  blacklist.include?(s) ? s.downcase! : s.capitalize!
@@ -1,14 +1,14 @@
1
1
  module Headingify
2
2
  TITLE = "Ruby String.headingify Core Extension"
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  UPDATE = "2014-12-29"
5
- REVISION = "42"
5
+ REVISION = "43"
6
6
  USAGE = "headingify \"string\" | \"an \\%ESCAPED\\% string\""
7
7
  EXAMPLE_INPUT = "\"garlic is as \\%GOOD\\% as ten mothers\""
8
8
  EXAMPLE_OUTPUT = "Garlic Is as GOOD as Ten Mothers"
9
9
 
10
10
  def self.usage
11
- "Usage: #{USAGE}"
11
+ "usage: #{USAGE}"
12
12
  end
13
13
 
14
14
  def self.example
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: headingify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Calo