itrigga-core_ext 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -1,3 +1,4 @@
1
- require 'core_ext/array'
2
- require 'core_ext/hash'
3
- require 'core_ext/string'
1
+ Dir[File.join(File.dirname(File.expand_path(__FILE__)),"core_ext","*.rb")].each {|f| require f }
2
+
3
+
4
+
@@ -0,0 +1,5 @@
1
+ class NilClass #:nodoc:
2
+ def blank?
3
+ true
4
+ end
5
+ end
@@ -14,6 +14,15 @@ class String
14
14
 
15
15
  def to_active_record_condition
16
16
  "%#{self.trim.gsub(/[[:space:]]+/, '%')}%"
17
+ end
17
18
 
19
+ def blank?
20
+ self !~ /\S/
21
+ rescue ArgumentError => e
22
+ if e.message =~ /^(invalid\ byte\ sequence|incompatible\ character\ encodings)/
23
+ empty?
24
+ else
25
+ raise e
26
+ end
18
27
  end
19
28
 
20
29
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itrigga-core_ext
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Al Davidson
@@ -16,10 +16,11 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-08-01 00:00:00 +01:00
19
+ date: 2011-08-10 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
+ type: :development
23
24
  prerelease: false
24
25
  name: bundler
25
26
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -34,8 +35,8 @@ dependencies:
34
35
  - 0
35
36
  version: 1.0.0
36
37
  requirement: *id001
37
- type: :development
38
38
  - !ruby/object:Gem::Dependency
39
+ type: :development
39
40
  prerelease: false
40
41
  name: jeweler
41
42
  version_requirements: &id002 !ruby/object:Gem::Requirement
@@ -50,8 +51,8 @@ dependencies:
50
51
  - 4
51
52
  version: 1.6.4
52
53
  requirement: *id002
53
- type: :development
54
54
  - !ruby/object:Gem::Dependency
55
+ type: :development
55
56
  prerelease: false
56
57
  name: rcov
57
58
  version_requirements: &id003 !ruby/object:Gem::Requirement
@@ -64,8 +65,8 @@ dependencies:
64
65
  - 0
65
66
  version: "0"
66
67
  requirement: *id003
67
- type: :development
68
68
  - !ruby/object:Gem::Dependency
69
+ type: :development
69
70
  prerelease: false
70
71
  name: rspec
71
72
  version_requirements: &id004 !ruby/object:Gem::Requirement
@@ -78,8 +79,8 @@ dependencies:
78
79
  - 0
79
80
  version: "0"
80
81
  requirement: *id004
81
- type: :development
82
82
  - !ruby/object:Gem::Dependency
83
+ type: :development
83
84
  prerelease: false
84
85
  name: fastercsv
85
86
  version_requirements: &id005 !ruby/object:Gem::Requirement
@@ -94,7 +95,6 @@ dependencies:
94
95
  - 4
95
96
  version: 1.5.4
96
97
  requirement: *id005
97
- type: :development
98
98
  description: "Adds methods for \n Hash: \n - symbolize_keys\n - recursive_symbolize_keys\n Array:\n - to_csv (requires FasterCSV gem)\n - select_with_index\n - to_auto_complete_list\n - active_record_type_condition_rendering\n "
99
99
  email: aldavidson@itrigga.com
100
100
  executables: []
@@ -115,6 +115,7 @@ files:
115
115
  - lib/itrigga/core_ext.rb
116
116
  - lib/itrigga/core_ext/array.rb
117
117
  - lib/itrigga/core_ext/hash.rb
118
+ - lib/itrigga/core_ext/nil.rb
118
119
  - lib/itrigga/core_ext/string.rb
119
120
  - pkg/core_ext-0.1.0.gem
120
121
  - pkg/itrigga-core_ext-0.1.0.gem