giant_bomb 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -1,8 +1,14 @@
1
1
  class Array
2
+ alias_method :blank?, :empty?
3
+
2
4
  def extract_options!
3
5
  last.is_a?(::Hash) ? pop : {}
4
6
  end
5
-
7
+
8
+ end
9
+
10
+ class Hash #:nodoc:
11
+ alias_method :blank?, :empty?
6
12
  end
7
13
 
8
14
  class Float
@@ -15,4 +21,57 @@ class Integer
15
21
  def self.parse(val)
16
22
  Integer(val)
17
23
  end
18
- end
24
+ end
25
+
26
+ class Numeric
27
+ def blank?
28
+ false
29
+ end
30
+ end
31
+
32
+ class Object
33
+ # An object is blank if it's false, empty, or a whitespace string.
34
+ # For example, "", " ", +nil+, [], and {} are blank.
35
+ #
36
+ # This simplifies:
37
+ #
38
+ # if !address.nil? && !address.empty?
39
+ #
40
+ # ...to:
41
+ #
42
+ # if !address.blank?
43
+ def blank?
44
+ respond_to?(:empty?) ? empty? : !self
45
+ end
46
+
47
+ def try(method)
48
+ send method if respond_to? method
49
+ end
50
+
51
+ end
52
+
53
+
54
+ class NilClass
55
+ def blank?
56
+ true
57
+ end
58
+ end
59
+
60
+ class FalseClass
61
+ def blank?
62
+ true
63
+ end
64
+ end
65
+
66
+ class TrueClass
67
+ def blank?
68
+ false
69
+ end
70
+ end
71
+
72
+ class String
73
+ def blank?
74
+ self !~ /\S/
75
+ end
76
+ end
77
+
@@ -23,7 +23,7 @@
23
23
  #
24
24
 
25
25
  require 'logger'
26
- require 'ftools'
26
+ require 'fileutils'
27
27
  require 'tmpdir'
28
28
  require 'pathname'
29
29
  require 'digest/md5'
@@ -207,11 +207,11 @@ module HTTParty #:nodoc:
207
207
  end
208
208
  def set(key, value)
209
209
  Cache.logger.info("Cache: set (#{key})")
210
- File.open( @path.join(key), 'w' ) { |file| file << Marshal.dump(value) }
210
+ File.open( @path.join(key), 'w' ) { |file| Marshal.dump(value, file) }
211
211
  true
212
212
  end
213
213
  def get(key)
214
- data = Marshal.load(File.read( @path.join(key)))
214
+ data = Marshal.load(File.new(@path.join(key)))
215
215
  Cache.logger.info("Cache: #{data.nil? ? "miss" : "hit"} (#{key})")
216
216
  data
217
217
  end
metadata CHANGED
@@ -1,59 +1,58 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: giant_bomb
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.3
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Jon Maddox
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2010-02-03 00:00:00 -05:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-12-24 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: httparty
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
16
+ requirement: &70240378624320 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
23
21
  version: 0.4.3
24
- version:
25
- - !ruby/object:Gem::Dependency
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70240378624320
25
+ - !ruby/object:Gem::Dependency
26
26
  name: fakeweb
27
+ requirement: &70240378623520 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
27
33
  type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
- version:
35
- - !ruby/object:Gem::Dependency
34
+ prerelease: false
35
+ version_requirements: *70240378623520
36
+ - !ruby/object:Gem::Dependency
36
37
  name: thoughtbot-shoulda
38
+ requirement: &70240378622480 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
37
44
  type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: "0"
44
- version:
45
+ prerelease: false
46
+ version_requirements: *70240378622480
45
47
  description: Simple library to talkto the awesome GiantBomb data
46
48
  email: jon@fanzter.com
47
49
  executables: []
48
-
49
50
  extensions: []
50
-
51
- extra_rdoc_files:
51
+ extra_rdoc_files:
52
52
  - LICENSE
53
53
  - README.textile
54
- files:
54
+ files:
55
55
  - .document
56
- - .gitignore
57
56
  - LICENSE
58
57
  - README.textile
59
58
  - Rakefile
@@ -75,35 +74,28 @@ files:
75
74
  - test/game_test.rb
76
75
  - test/giant_bomb_test.rb
77
76
  - test/test_helper.rb
78
- has_rdoc: true
79
77
  homepage: http://github.com/fanzter/giant_bomb
80
78
  licenses: []
81
-
82
79
  post_install_message:
83
- rdoc_options:
84
- - --charset=UTF-8
85
- require_paths:
80
+ rdoc_options: []
81
+ require_paths:
86
82
  - lib
87
- required_ruby_version: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: "0"
92
- version:
93
- required_rubygems_version: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: "0"
98
- version:
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
99
95
  requirements: []
100
-
101
96
  rubyforge_project:
102
- rubygems_version: 1.3.5
97
+ rubygems_version: 1.8.6
103
98
  signing_key:
104
99
  specification_version: 3
105
100
  summary: Simple library to talk to the awesome GiantBomb data
106
- test_files:
107
- - test/game_test.rb
108
- - test/giant_bomb_test.rb
109
- - test/test_helper.rb
101
+ test_files: []
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg