vv 0.0.19 → 0.0.20

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
  SHA256:
3
- metadata.gz: 7d7d249956dafbb61a0cf6536476cd479bae67efc1dccc2b773669d370524022
4
- data.tar.gz: c41e41e349f4d794cebd0a18dd53478a07e107c13833c98c60c3a039ea4d9a91
3
+ metadata.gz: f74195fa46ae24a1e10dde49b9f8af256f73b13181ec843d8dbd1afc3f17fcf0
4
+ data.tar.gz: dcd20d147b62ef6d04b5bfbd952e3a0b74110b9aefe75a63872c8467ee8909e9
5
5
  SHA512:
6
- metadata.gz: 65536e4f19eb17fcb51c0bb854477734ce87d190faa0b9c7d608080d4fc0d5b83a327c0655d32f69232749bb7f22cc0e12e16b0c70fe05e48bd9fedfec394fe7
7
- data.tar.gz: 3053771b5ea761d03cfb35190cad3924cf98f905477a4fd29747cbcddf63b25bba80bb3973493474aff4fd3866a8cc31ec18dbe4dabba78fa4ab4578d8b48705
6
+ metadata.gz: 626d2fe8d870cff9e4f6b5a97e8986a2a45b925f133df4efeb57d10385e9caebab427c9e280dde0cb4908050414fc7217ffc18ff66959d05eb14803abadadce8
7
+ data.tar.gz: b7e50f23643d1eb1206fffc1e865e52c261df5558a661cbde2007dfc294cd969ea9a612294ad196ba67fc4b3626fc963c2208e534fcc4487596915a9fb16b358
@@ -3,6 +3,7 @@ module VV
3
3
 
4
4
  def self.included(base)
5
5
  base.extend(ClassMethods)
6
+ base.alias_method :includes?, :include?
6
7
  end
7
8
 
8
9
  module ClassMethods
@@ -2,9 +2,15 @@ module VV
2
2
  module StringMethods
3
3
 
4
4
  def self.included(base)
5
- base.extend(ClassMethods)
6
- base.extend(SharedInstanceAndClassMethods)
7
- base.include(SharedInstanceAndClassMethods)
5
+ base.instance_eval do
6
+ extend(ClassMethods)
7
+ extend(SharedInstanceAndClassMethods)
8
+ include(SharedInstanceAndClassMethods)
9
+
10
+ alias_method :starts_with?, :start_with?
11
+ alias_method :ends_with?, :end_with?
12
+ alias_method :includes?, :include?
13
+ end
8
14
  end
9
15
 
10
16
  module ClassMethods
@@ -103,18 +109,6 @@ module VV
103
109
 
104
110
  # Instance methods start
105
111
 
106
- def includes? *args
107
- self.include?(*args)
108
- end
109
-
110
- def starts_with? *args
111
- self.start_with?(*args)
112
- end
113
-
114
- def ends_with? *args
115
- self.end_with?(*args)
116
- end
117
-
118
112
  def shift
119
113
  self.slice!(0)
120
114
  end
@@ -501,6 +495,28 @@ module VV
501
495
  true
502
496
  end
503
497
 
498
+ def query
499
+ string_fragments = self.split("#")[0].split("?")
500
+ message = "Query string contains multiple question marks"
501
+
502
+ fail message if string_fragments.count > 2
503
+ substring = string_fragments[-1]
504
+ response = {}
505
+
506
+ substring.split("&").each do |key_value_pair|
507
+ key, value = key_value_pair.split(String.equals_sign)
508
+ if key.ends_with? "[]"
509
+ _key = key[0..-3]
510
+ response[_key] ||= Array.new
511
+ response[_key] << value
512
+ else
513
+ response[key] = value
514
+ end
515
+ end
516
+
517
+ response
518
+ end
519
+
504
520
  def last(limit = 1)
505
521
  if limit == 0
506
522
  ""
@@ -80,6 +80,7 @@ module VV
80
80
  || ( echo && \\
81
81
  echo "Warning: A file in lib/ is not tracked by git" && \\
82
82
  echo )
83
+ rm -f Gemfile.lock
83
84
  rm -f #{name}-*.gem
84
85
  gem uninstall --ignore-dependencies --all #{name}
85
86
  bundle
data/lib/vv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module VV
2
- VERSION = '0.0.19'
2
+ VERSION = '0.0.20'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Aysan