solo-rails 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Solo
2
2
  module Rails
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
data/lib/solo-rails.rb CHANGED
@@ -3,6 +3,7 @@ require 'cgi'
3
3
  require 'open-uri'
4
4
  require 'chronic'
5
5
  require 'nokogiri'
6
+ require 'rinku'
6
7
 
7
8
  class SoloRails
8
9
 
@@ -75,7 +76,7 @@ class SoloRails
75
76
 
76
77
  url += query_string.join("&")
77
78
 
78
- p "Fetching SOLO data from: #{url}"
79
+ Rails.logger.info "Fetching SOLO data from: #{url}"
79
80
 
80
81
  begin
81
82
  soutron_data = Nokogiri::XML(open(url, :read_timeout => 180))
@@ -220,12 +221,12 @@ class SoloRails
220
221
  when 2 then element.text.to_i
221
222
  when 3 then Date.parse(element.text.to_s)
222
223
  # when 3 then element.text.to_s
223
- when 7 then element.text.to_s
224
- # if element.attribute("desc").value.size > 0 && !element.attribute("desc").value.eql?(element.text.to_s)
225
- # "#{element.attribute("desc")} - #{ActionController::Base.helpers.auto_link(element.text.to_s)}"
226
- # else
227
- # ActionController::Base.helpers.auto_link(element.text.to_s)
228
- # end
224
+ when 7 then
225
+ if element.attribute("desc").value.size > 0 && !element.attribute("desc").value.eql?(element.text.to_s)
226
+ "#{element.attribute("desc")} - #{Rinku.auto_link(element.text.to_s)}"
227
+ else
228
+ Rinku.auto_link(element.text.to_s)
229
+ end
229
230
  when 8 then parse_complex_date(element)
230
231
  else field_type
231
232
  end
@@ -255,6 +256,9 @@ class SoloRails
255
256
  str.gsub(/\s*/,"").underscore
256
257
  end
257
258
 
259
+ def auto_link
260
+ end
261
+
258
262
  end
259
263
 
260
264
  # Allows object.fieldname searches, returning nil rather than exception if key does not exist - PG 2011-01-20
data/solo-rails.gemspec CHANGED
@@ -22,4 +22,5 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "rspec"
23
23
  s.add_runtime_dependency "nokogiri"
24
24
  s.add_runtime_dependency "chronic"
25
+ s.add_runtime_dependency "rinku"
25
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-16 00:00:00.000000000 Z
12
+ date: 2012-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70119535693840 !ruby/object:Gem::Requirement
16
+ requirement: &70330186248940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70119535693840
24
+ version_requirements: *70330186248940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &70119535693020 !ruby/object:Gem::Requirement
27
+ requirement: &70330186248260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70119535693020
35
+ version_requirements: *70330186248260
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: chronic
38
- requirement: &70119535692060 !ruby/object:Gem::Requirement
38
+ requirement: &70330186247660 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,18 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70119535692060
46
+ version_requirements: *70330186247660
47
+ - !ruby/object:Gem::Dependency
48
+ name: rinku
49
+ requirement: &70330186246940 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *70330186246940
47
58
  description: Provides methods to query Soutron Solo catalog from Ruby
48
59
  email:
49
60
  - github@modagoo.co.uk