data_science_theater_3000 1.0.1.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,8 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_runtime_dependency 'active_support'
21
+ s.add_runtime_dependency 'activesupport', '3.0.3'
22
+ s.add_runtime_dependency 'i18n', '0.4.0'
22
23
  s.add_dependency 'curb'
23
24
  s.add_dependency 'json'
24
25
  s.add_development_dependency "rake"
@@ -29,7 +29,11 @@ module DataScienceTheater3000
29
29
  protected
30
30
  # @api private
31
31
  def dst_request
32
- @dst_request ||= DataScienceToolkit::Request.new(request_method: 'coordinates2politics', request_params: coordinates)
32
+ begin
33
+ @dst_request ||= DataScienceToolkit::Request.new(request_method: 'coordinates2politics', request_params: coordinates)
34
+ rescue
35
+ @dst_request ||= DataScienceToolkit::Request.new(request_method => 'coordinates2politics', request_params => coordinates)
36
+ end
33
37
  end
34
38
 
35
39
  def sanitize coordinates
@@ -26,8 +26,13 @@ module DataScienceTheater3000
26
26
 
27
27
  # @api private
28
28
  def dst_request
29
+ begin
29
30
  @dst_request ||=
30
31
  DataScienceToolkit::PostFileRequest.new(request_method: 'file2text', request_params: file_path, post_key: 'inputfile')
32
+ rescue
33
+ @dst_request ||=
34
+ DataScienceToolkit::PostFileRequest.new(request_method => 'file2text', request_params => file_path, post_key => 'inputfile')
35
+ end
31
36
  end
32
37
  end
33
38
  end
@@ -22,9 +22,9 @@ module DataScienceTheater3000
22
22
  @dst_request ||=
23
23
  case
24
24
  when html_string.length < 7500
25
- DataScienceToolkit::Request.new(request_method: 'html2story', request_params: html_string)
25
+ DataScienceToolkit::Request.new(request_method => 'html2story', request_params => html_string)
26
26
  when html_string.length >= 7500
27
- DataScienceToolkit::PostBodyRequest.new(request_method: 'html2story', request_params: html_string, post_key: 'body')
27
+ DataScienceToolkit::PostBodyRequest.new(request_method => 'html2story', request_params => html_string, post_key => 'body')
28
28
  end
29
29
  end
30
30
  end
@@ -22,9 +22,9 @@ module DataScienceTheater3000
22
22
  @dst_request ||=
23
23
  case
24
24
  when html_string.length < 7500
25
- DataScienceToolkit::Request.new(request_method: 'html2text', request_params: html_string)
25
+ DataScienceToolkit::Request.new(request_method => 'html2text', request_params => html_string)
26
26
  when html_string.length >= 7500
27
- DataScienceToolkit::PostBodyRequest.new(request_method: 'html2text', request_params: html_string, post_key: 'body')
27
+ DataScienceToolkit::PostBodyRequest.new(request_method => 'html2text', request_params => html_string, post_key => 'body')
28
28
  end
29
29
  end
30
30
  end
@@ -22,7 +22,11 @@ module DataScienceTheater3000
22
22
  protected
23
23
  # @api private
24
24
  def dst_request
25
- @dst_request ||= DataScienceToolkit::Request.new(request_method: 'ip2coordinates', request_params: ip)
25
+ begin
26
+ @dst_request ||= DataScienceToolkit::Request.new(request_method: 'ip2coordinates', request_params: ip)
27
+ rescue
28
+ @dst_request ||= DataScienceToolkit::Request.new(request_method => 'ip2coordinates', request_params => ip)
29
+ end
26
30
  end
27
31
  end
28
32
  end
@@ -22,7 +22,7 @@ module DataScienceTheater3000
22
22
  protected
23
23
  # @api private
24
24
  def dst_request
25
- @dst_request ||= DataScienceToolkit::Request.new(request_method: 'street2coordinates', request_params: address)
25
+ @dst_request ||= DataScienceToolkit::Request.new(request_method => 'street2coordinates', request_params => address)
26
26
  end
27
27
  end
28
28
  end
@@ -22,7 +22,7 @@ module DataScienceTheater3000
22
22
  # @api private
23
23
  def dst_request
24
24
  @dst_request ||=
25
- DataScienceToolkit::PostBodyRequest.new(request_method: 'text2people', request_params: name, post_key: 'body')
25
+ DataScienceToolkit::PostBodyRequest.new(request_method => 'text2people', request_params => name, post_key => 'body')
26
26
  end
27
27
  end
28
28
  end
@@ -20,7 +20,7 @@ module DataScienceTheater3000
20
20
  # @api private
21
21
  def dst_request
22
22
  @dst_request ||=
23
- DataScienceToolkit::Request.new(request_method: 'text2places', request_params: text_string)
23
+ DataScienceToolkit::Request.new(request_method => 'text2places', request_params => text_string)
24
24
  end
25
25
  end
26
26
  end
@@ -22,9 +22,9 @@ module DataScienceTheater3000
22
22
  @dst_request ||=
23
23
  case
24
24
  when text_string.length < 7500
25
- DataScienceToolkit::Request.new(request_method: 'text2times', request_params: text_string)
25
+ DataScienceToolkit::Request.new(request_method => 'text2times', request_params => text_string)
26
26
  when text_string.length >= 7500
27
- DataScienceToolkit::PostBodyRequest.new(request_method: 'text2times', request_params: text_string, post_key: 'body')
27
+ DataScienceToolkit::PostBodyRequest.new(request_method => 'text2times', request_params => text_string, post_key => 'body')
28
28
  end
29
29
  end
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module DataScienceTheater3000
2
- VERSION = "1.0.1.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_science_theater_3000
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,22 +10,33 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-01-29 00:00:00.000000000Z
13
+ date: 2012-01-31 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: active_support
17
- requirement: &6139020 !ruby/object:Gem::Requirement
16
+ name: activesupport
17
+ requirement: &16993480 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
- - - ! '>='
20
+ - - =
21
21
  - !ruby/object:Gem::Version
22
- version: '0'
22
+ version: 3.0.3
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *16993480
26
+ - !ruby/object:Gem::Dependency
27
+ name: i18n
28
+ requirement: &16992640 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - =
32
+ - !ruby/object:Gem::Version
33
+ version: 0.4.0
23
34
  type: :runtime
24
35
  prerelease: false
25
- version_requirements: *6139020
36
+ version_requirements: *16992640
26
37
  - !ruby/object:Gem::Dependency
27
38
  name: curb
28
- requirement: &6137940 !ruby/object:Gem::Requirement
39
+ requirement: &16991900 !ruby/object:Gem::Requirement
29
40
  none: false
30
41
  requirements:
31
42
  - - ! '>='
@@ -33,10 +44,10 @@ dependencies:
33
44
  version: '0'
34
45
  type: :runtime
35
46
  prerelease: false
36
- version_requirements: *6137940
47
+ version_requirements: *16991900
37
48
  - !ruby/object:Gem::Dependency
38
49
  name: json
39
- requirement: &6136860 !ruby/object:Gem::Requirement
50
+ requirement: &16991060 !ruby/object:Gem::Requirement
40
51
  none: false
41
52
  requirements:
42
53
  - - ! '>='
@@ -44,10 +55,10 @@ dependencies:
44
55
  version: '0'
45
56
  type: :runtime
46
57
  prerelease: false
47
- version_requirements: *6136860
58
+ version_requirements: *16991060
48
59
  - !ruby/object:Gem::Dependency
49
60
  name: rake
50
- requirement: &6135940 !ruby/object:Gem::Requirement
61
+ requirement: &16990400 !ruby/object:Gem::Requirement
51
62
  none: false
52
63
  requirements:
53
64
  - - ! '>='
@@ -55,10 +66,10 @@ dependencies:
55
66
  version: '0'
56
67
  type: :development
57
68
  prerelease: false
58
- version_requirements: *6135940
69
+ version_requirements: *16990400
59
70
  - !ruby/object:Gem::Dependency
60
71
  name: minitest
61
- requirement: &6135400 !ruby/object:Gem::Requirement
72
+ requirement: &16989920 !ruby/object:Gem::Requirement
62
73
  none: false
63
74
  requirements:
64
75
  - - ! '>='
@@ -66,10 +77,10 @@ dependencies:
66
77
  version: '0'
67
78
  type: :development
68
79
  prerelease: false
69
- version_requirements: *6135400
80
+ version_requirements: *16989920
70
81
  - !ruby/object:Gem::Dependency
71
82
  name: webmock
72
- requirement: &6134580 !ruby/object:Gem::Requirement
83
+ requirement: &16989300 !ruby/object:Gem::Requirement
73
84
  none: false
74
85
  requirements:
75
86
  - - ! '>='
@@ -77,10 +88,10 @@ dependencies:
77
88
  version: '0'
78
89
  type: :development
79
90
  prerelease: false
80
- version_requirements: *6134580
91
+ version_requirements: *16989300
81
92
  - !ruby/object:Gem::Dependency
82
93
  name: ruby-debug19
83
- requirement: &6129840 !ruby/object:Gem::Requirement
94
+ requirement: &16988640 !ruby/object:Gem::Requirement
84
95
  none: false
85
96
  requirements:
86
97
  - - ! '>='
@@ -88,7 +99,7 @@ dependencies:
88
99
  version: '0'
89
100
  type: :development
90
101
  prerelease: false
91
- version_requirements: *6129840
102
+ version_requirements: *16988640
92
103
  description: Ruby interface to issue Data Science Toolkit API calls.
93
104
  email:
94
105
  - tad@isotope11.com