finishing_moves 0.11 → 0.12

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: f74f4a4c7b4b535c98038c2d33949eb85b2ca1c1
4
- data.tar.gz: da8d8af1fc1b5cc8762ea974fa0c119a8e265dac
3
+ metadata.gz: c9348af415342a03d683aade50c3e3121fae98c6
4
+ data.tar.gz: 902a8a29ba2517248098f40696ce50429ab11afd
5
5
  SHA512:
6
- metadata.gz: 940384f56f1b26edf018f37d04e9569ad9867b9ff2f5c0a97d7ad35c1dfa096e607c45d7d25812cd42db140f1c9bbd693ec28763d9befc034ab9c7fbfbeb4b8c
7
- data.tar.gz: ced413a9fc843b3a2c047a20ebdba6eccdab758659ab98b31637ec33b1bc298db5a1d6af2e5535ceccf60840dce9ccc3c90ec7891e004c8b0e84d26fe559fbe8
6
+ metadata.gz: c7b0813906c9c82d9d5f2989ecff98c55aa56c619bd829039891abc39a053ec59c1f056660e8e27196cac31f94e59b52859cbd20f3be8607e28d339d70e69a2a
7
+ data.tar.gz: 74888d990597d97f8ef92259b98445afebe33cca738e717c6351a2e7c8d87a0f459d7b008ebc71e5d08cea85c532e220051454eef1af09b443f4219468b7b17a
data/README.md CHANGED
@@ -2,11 +2,10 @@
2
2
  [![Gem Version](https://badge.fury.io/rb/finishing_moves.svg)](https://rubygems.org/gems/finishing_moves)
3
3
  [![Build Status](https://travis-ci.org/forgecrafted/finishing_moves.svg?branch=master)](https://travis-ci.org/forgecrafted/finishing_moves)
4
4
  [![Coverage Status](https://coveralls.io/repos/forgecrafted/finishing_moves/badge.svg?branch=master)](https://coveralls.io/r/forgecrafted/finishing_moves?branch=master)
5
- [![Hire Us!](https://img.shields.io/badge/pros-for%20hire-F7931E.svg)](http://www.forgecrafted.com)
6
5
 
7
- Ruby includes a huge amount of default awesomeness that tackles most common development challenges. But every now and then, you find yourself in a situation where an **elaborate-yet-precise** coding maneuver wins the day. Finishing Moves is a collection of methods designed to assist in those just-typical-enough-to-be-annoying scenarios.
6
+ Ruby includes a huge amount of default awesomeness that tackles most common development challenges. But every now and then, you find yourself performing contortions to achieve results that, honestly, **should feel more natural** given the language's design elegance. Finishing Moves is a collection of methods designed to assist in those "why is this awkward?" scenarios.
8
7
 
9
- In gamer terms, if standard Ruby methods are your default moves, Finishing Moves would be mana-consuming techniques. Your cooldown spells. Your grenades (there's never enough grenades!). In the right situation, they kick serious [cyclomatic butt](https://en.wikipedia.org/wiki/Cyclomatic_complexity).
8
+ In the right situation, they kick serious [cyclomatic butt](https://en.wikipedia.org/wiki/Cyclomatic_complexity).
10
9
 
11
10
  ## Installation
12
11
 
@@ -19,14 +18,8 @@ Command line
19
18
  ```
20
19
  gem install 'finishing_moves'
21
20
  ```
22
- [Here's the gem link](https://rubygems.org/gems/finishing_moves), if you like looking at that stuff.
23
21
 
24
- ### Ruby Version
25
-
26
- Tested against **`2.0.0` and above**. Probably works in `1.9.3`.
27
-
28
- ## List of Methods
29
- ###### Complete documentation in the [GitHub wiki](https://github.com/forgecrafted/finishing_moves/wiki)
22
+ ## Functionality
30
23
 
31
24
  **Not sure if this gem is for you?** Check out the methods marked with a :boom: first.
32
25
 
@@ -65,6 +58,10 @@ Tested against **`2.0.0` and above**. Probably works in `1.9.3`.
65
58
  - [Fiscal Calendar Calculations](https://github.com/forgecrafted/finishing_moves/wiki/Fiscal-Calendar-Calculations) :boom:
66
59
  - [Boolean Typecasting](https://github.com/forgecrafted/finishing_moves/wiki/Boolean-Typecasting)
67
60
 
61
+ ### Ruby Version
62
+
63
+ Tested against **`2.0.0` and above**. Probably works in `1.9.3`.
64
+
68
65
  ## Development approach
69
66
 
70
67
  - **Never** override default Ruby behavior, only add functionality.
@@ -87,15 +84,3 @@ Tested against **`2.0.0` and above**. Probably works in `1.9.3`.
87
84
  3. Add your finisher
88
85
  4. Repeat steps 2 and 3 until you see a brilliant luster
89
86
  5. Submit a pull request
90
-
91
- ## Credits
92
-
93
- [![forge software](http://www.forgecrafted.com/logo.png)](http://www.forgecrafted.com)
94
-
95
- Finishing Moves is maintained and funded by [Forge Software (forgecrafted.com)](http://www.forgecrafted.com)
96
-
97
- If you like our code, please give us a hollar if your company needs outside pro's who can write good code AND run servers at the same time!
98
-
99
- ## License
100
-
101
- Finishing Moves is Copyright Forge Software, LLC. It is free software, and may be redistributed under the terms specified in the LICENSE file.
data/Vagrantfile CHANGED
@@ -6,8 +6,8 @@ FQDN = "#{NAME}.example.com"
6
6
 
7
7
  Vagrant.configure("2") do |config|
8
8
  # "trusty" is 14.04
9
- config.vm.box = "trusty32"
10
- config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box"
9
+ config.vm.box = "trusty64"
10
+ config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
11
11
 
12
12
  # Use the normal insecure key
13
13
  # https://github.com/mitchellh/vagrant/issues/2608
@@ -52,4 +52,16 @@ class Object
52
52
  return false
53
53
  end
54
54
 
55
+ def integer?
56
+ self.is_a? Integer
57
+ end
58
+
59
+ def string?
60
+ self.is_a? String
61
+ end
62
+
63
+ def symbol?
64
+ self.is_a? Symbol
65
+ end
66
+
55
67
  end
@@ -109,7 +109,7 @@ class String
109
109
 
110
110
  def _prep_key_or_slug(keyified = true)
111
111
  result = nil_chain do
112
- the_key = self.clone
112
+ the_key = self.dup
113
113
 
114
114
  # strip all non-alphanumerics
115
115
  the_key.gsub!(/[^0-9a-z]+/i, '_')
@@ -1,3 +1,3 @@
1
1
  module FinishingMoves
2
- VERSION = "0.11"
2
+ VERSION = "0.12"
3
3
  end
data/spec/string_spec.rb CHANGED
@@ -144,6 +144,9 @@ describe String do
144
144
  str = 'FooBarBaz'
145
145
  expect(str.keyify).to eq :foo_bar_baz
146
146
  expect(str).to eq 'FooBarBaz'
147
+
148
+ # should work on frozen values
149
+ expect('FooBarBaz'.freeze.keyify).to eq :foo_bar_baz
147
150
  end
148
151
 
149
152
  it '#keyify!' do
@@ -177,6 +180,9 @@ describe String do
177
180
  expect('!1234FooBAR'.slugify).to eq '1234-foo-bar'
178
181
  expect('1234FooBAR'.slugify).to eq '1234-foo-bar'
179
182
  expect('12345678'.slugify).to eq '12345678'
183
+
184
+ # should work on frozen values
185
+ expect('FooBarBaz'.freeze.slugify).to eq 'foo-bar-baz'
180
186
  end
181
187
 
182
188
  it '#slugify!' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finishing_moves
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.11'
4
+ version: '0.12'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Koehl
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-29 00:00:00.000000000 Z
12
+ date: 2016-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb-readline