frubby 0.1 → 0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e1959be0287a4d7aa58750c95f9d7c47950276a
4
- data.tar.gz: ba4d2fda00d9448fd3e0f391702f9ecc80dc5857
3
+ metadata.gz: 4ee756b4b3eb139632aeb7bcdfec190d6903f7cd
4
+ data.tar.gz: 0acce9ed215d7e63a2941142da8abc8c27a15ba7
5
5
  SHA512:
6
- metadata.gz: 94912e4b4295e745a14ce8ed0da8e9181e036c8be84c3d7e9573b71e2f17581def9f66f4bc933691798da78a046d5ce23dee9c17d16bc0ced7f6604a1485dddb
7
- data.tar.gz: 57964fd29671c732200135e0d0cea4602725660b60f166f678989ca24444d038ac1f3ef0949fdd5c7ab5d8ad7c9b55ed9afc2fc17d7d4c7f22cd0cbbf618f29e
6
+ metadata.gz: 3679e9c1c593a2666631fd437f917caef259690f5164b0ceccf8988e7f59a7e33bc3090a33a60b9e5e4e523fe11e7fd00cdd20a06fcff3c2e3749fae63e628dc
7
+ data.tar.gz: 58b8b2852b3aee6fe446c314caa769c9cd2032eecadbfb15e6473c95a906196cf9bbd48e08b07121db4f1b0558f2a1c4cac428280904cfc701d46b3680a584d1
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- frubby (0.1)
4
+ frubby (0.3)
5
5
  fuzzy_match
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  fuzzy_match (2.1.0)
11
- minitest (5.5.0)
11
+ minitest (5.5.1)
12
12
  rake (10.4.2)
13
13
 
14
14
  PLATFORMS
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # frubby
2
- Bring fuzzy_match directly into ruby.
1
+ # frubby [![Build Status](https://travis-ci.org/fazibear/frubby.svg?branch=master)](https://travis-ci.org/fazibear/frubby) [![Code Climate](https://codeclimate.com/github/fazibear/frubby/badges/gpa.svg)](https://codeclimate.com/github/fazibear/frubby)
2
+ Bring fuzzy_match directly into ruby. Now typos makes no difference.
3
3
 
4
4
  ### Install
5
5
 
@@ -26,7 +26,7 @@ class FancyTestClass
26
26
  end
27
27
 
28
28
  def inc_five
29
- @count +=5
29
+ @count += 5
30
30
  end
31
31
 
32
32
  def count
@@ -41,7 +41,7 @@ fr.in_fv
41
41
  piuts fr.cunt # => 7
42
42
  ```
43
43
 
44
- ### Licence
44
+ ### License
45
45
 
46
46
  Copyright (c) 2015 Michał Kalbarczyk
47
47
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'frubby'
3
- s.version = '0.1'
3
+ s.version = '0.3'
4
4
  s.license = 'MIT'
5
5
  s.summary = 'Add color methods to String class'
6
6
  s.description = 'Ruby String class extension. Adds methods to set text color, background color and, text effects on ruby console and command line output, using ANSI escape sequences.'
@@ -1,12 +1,12 @@
1
1
  module Frubby
2
2
  module ConstMissing
3
3
  def const_missing(const)
4
- _constants = (Object.constants + constants).flatten
4
+ _constants = Object.constants + constants
5
5
  _constant = FuzzyMatch.new(_constants).find(const)
6
6
 
7
- puts "#{const} => #{_constant}" if $DEBUG
7
+ warn "[frubby] const_missing: #{const} -> #{_constant}" if $DEBUG
8
8
 
9
- _constant ? const_get(_constant) : raise('const_missing')
9
+ _constant ? const_get(_constant) : super
10
10
  end
11
11
  end
12
12
  end
@@ -11,14 +11,14 @@ module Frubby
11
11
  KERNEL_METHODS = Kernel.methods.delete_if {|m| m.match /^[A-Z]/}
12
12
 
13
13
  def method_missing(method_sym, *args, &block)
14
- return if EXCLUDED_METHODS.include? method_sym
14
+ return super if EXCLUDED_METHODS.include? method_sym
15
15
 
16
- _methods = (KERNEL_METHODS + methods).flatten
16
+ _methods = KERNEL_METHODS + methods
17
17
  _method = FuzzyMatch.new(_methods).find(method_sym.to_s)
18
18
 
19
- puts "#{method_sym.to_s} -> #{_method.to_s}" if $DEBUG
19
+ warn "[frubby] method_missing: #{method_sym} -> #{_method}" if $DEBUG
20
20
 
21
- _method.is_a?(Symbol) ? send(_method.to_s, *args, &block) : raise('method_missing')
21
+ _method.is_a?(Symbol) ? send(_method.to_sym, *args, &block) : super
22
22
  end
23
23
  end
24
24
  end
@@ -5,19 +5,23 @@ module Frubby
5
5
  begin
6
6
  end
7
7
  path
8
+ to_ary
9
+ to_io
10
+ to_hash
11
+ to_str
8
12
  ]
9
13
 
10
14
  KERNEL_METHODS = Kernel.methods.delete_if {|m| m.match /^[A-Z]/}
11
15
 
12
16
  def respond_to_missing?(method_name, include_private = false)
13
- return false if EXCLUDED_RESPOND_TOS.include? method_name.to_sym
17
+ return super if EXCLUDED_RESPOND_TOS.include? method_name.to_sym
14
18
 
15
- _methods = (KERNEL_METHODS + methods).flatten
19
+ _methods = KERNEL_METHODS + methods
16
20
  _method = FuzzyMatch.new(_methods).find(method_name.to_sym)
17
21
 
18
- puts "#{method_name} ~> #{_method}" if $DEBUG
22
+ warn "[frubby] respond_to_missing: #{method_name} ~> #{_method}" if $DEBUG
19
23
 
20
- _method.is_a?(Symbol)
24
+ _method.is_a?(Symbol) ? true : super
21
25
  end
22
26
  end
23
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frubby
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Kalbarczyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-11 00:00:00.000000000 Z
11
+ date: 2015-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fuzzy_match
@@ -69,7 +69,6 @@ files:
69
69
  - lib/frubby/const_missing.rb
70
70
  - lib/frubby/method_missing.rb
71
71
  - lib/frubby/respond_to_missing.rb
72
- - test.rb
73
72
  - test/test.rb
74
73
  - test/test_const_missing.rb
75
74
  - test/test_method_missing.rb
data/test.rb DELETED
@@ -1,29 +0,0 @@
1
- require 'frubby'
2
-
3
- class FancyTestClass
4
- def initialize
5
- @count = 0
6
- end
7
-
8
- def inc
9
- @count += 1
10
- end
11
-
12
- def dec
13
- @count -= 1
14
- end
15
-
16
- def inc_five
17
- @count +=5
18
- end
19
-
20
- def count
21
- @count
22
- end
23
- end
24
-
25
- fr = FncyTstClas.new
26
- fr.incc
27
- fr.in
28
- fr.in_fv
29
- piuts fr.cunt # => 7