Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing superfluous andand dependency.

Same functionality is now provided by ActiveSupport.
  • Loading branch information...
commit 7f1ae07023767aeead14b324d725e386ac010917 1 parent 3840058
Joseph Pearson authored
1  .rvmrc
View
@@ -0,0 +1 @@
+rvm use ree@onix
1  lib/onix.rb
View
@@ -4,7 +4,6 @@
require 'cgi'
require 'singleton'
require 'roxml'
-require 'andand'
module ONIX
module Version #:nodoc:
42 lib/onix/wrappers/apa_product.rb
View
@@ -26,7 +26,7 @@ def measurement_system=(value)
# retrieve the current EAN
def ean
- identifier(3).andand.id_value
+ identifier(3).try(:id_value)
end
# set a new EAN
@@ -36,7 +36,7 @@ def ean=(isbn)
# retrieve the proprietary ID
def proprietary_id
- identifier(1).andand.id_value
+ identifier(1).tr(:id_value)
end
# set a new proprietary ID
@@ -46,7 +46,7 @@ def proprietary_id=(isbn)
# retrieve the current ISBN 10
def isbn10
- identifier(2).andand.id_value
+ identifier(2).try(:id_value)
end
# set a new ISBN 10
@@ -56,7 +56,7 @@ def isbn10=(isbn)
# retrieve the current ISBN 13
def isbn13
- identifier(15).andand.id_value
+ identifier(15).try(:id_value)
end
# set a new ISBN 13
@@ -108,7 +108,7 @@ def subtitle=(str)
def series
composite = product.series.first
- composite.andand.title_of_series
+ composite.try(:title_of_series)
end
def series=(val)
@@ -122,7 +122,7 @@ def series=(val)
# retrieve the current publisher website for this particular product
def publisher_website
- website(2).andand.website_link
+ website(2).try(:website_link)
end
# set a new publisher website for this particular product
@@ -132,7 +132,7 @@ def publisher_website=(str)
# retrieve the current supplier website for this particular product
def supplier_website
- website(12).andand.website_link
+ website(12).try(:website_link)
end
# set a new supplier website for this particular product
@@ -181,7 +181,7 @@ def add_bisac_subject(code)
# retrieve the url to the product cover image
def cover_url
- media_file(4).andand.media_file_link
+ media_file(4).try(:media_file_link)
end
# set the url to the product cover image
@@ -193,7 +193,7 @@ def cover_url=(url)
# retrieve the url to the high quality product cover image
def cover_url_hq
- media_file(6).andand.media_file_link
+ media_file(6).try(:media_file_link)
end
# set the url to the high quality product cover image
@@ -205,7 +205,7 @@ def cover_url_hq=(url)
# retrieve the url to the product thumbnail
def thumbnail_url
- media_file(7).andand.media_file_link
+ media_file(7).try(:media_file_link)
end
# set the url to the product cover image
@@ -217,7 +217,7 @@ def thumbnail_url=(url)
# retrieve the main description
def main_description
- other_text(1).andand.text
+ other_text(1).try(:text)
end
# set the main description
@@ -227,7 +227,7 @@ def main_description=(t)
# retrieve the short description
def short_description
- other_text(2).andand.text
+ other_text(2).try(:text)
end
# set the short description
@@ -237,7 +237,7 @@ def short_description=(t)
# retrieve the long description
def long_description
- other_text(3).andand.text
+ other_text(3).try(:text)
end
# set the long description
@@ -263,7 +263,7 @@ def imprint=(str)
# retrieve the publisher
def publisher
- publisher_get(1).andand.publisher_name
+ publisher_get(1).try(:publisher_name)
end
# set a new publisher
@@ -417,7 +417,7 @@ def pack_quantity=(val)
# retrieve the rrp excluding any sales tax
def rrp_exc_sales_tax
- price_get(1).andand.price_amount
+ price_get(1).try(:price_amount)
end
# set the rrp excluding any sales tax
@@ -427,7 +427,7 @@ def rrp_exc_sales_tax=(num)
# retrieve the rrp including any sales tax
def rrp_inc_sales_tax
- price_get(2).andand.price_amount
+ price_get(2).try(:price_amount)
end
# set the rrp including any sales tax
@@ -438,7 +438,7 @@ def rrp_inc_sales_tax=(num)
# just get the first price we can find, regardless of the type.
# useful as a backup for reading files from that don't contain a type
def price
- price_get(nil).andand.price_amount
+ price_get(nil).try(:price_amount)
end
# retrieve the height of the product
@@ -448,7 +448,7 @@ def price
#
def height
# TODO: auto unit conversion
- measurement(1).andand.measurement
+ measurement(1).try(:measurement)
end
# set the height of the book
@@ -471,7 +471,7 @@ def height=(value)
#
def width
# TODO: auto unit conversion
- measurement(2).andand.measurement
+ measurement(2).try(:measurement)
end
# set the width of the product
@@ -494,7 +494,7 @@ def width=(value)
#
def weight
# TODO: auto unit conversion
- measurement(8).andand.measurement
+ measurement(8).try(:measurement)
end
# set the weight of the product
@@ -517,7 +517,7 @@ def weight=(value)
#
def thickness
# TODO: auto unit conversion
- measurement(3).andand.measurement
+ measurement(3).try(:measurement)
end
# set the thickness of the product
1  onix.gemspec
View
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
s.add_dependency('roxml', '~>3.1.6')
s.add_dependency('activesupport', '>= 3.0.5')
s.add_dependency('i18n')
- s.add_dependency('andand')
s.add_dependency('nokogiri', '>=1.4')
s.add_development_dependency("rake")
Please sign in to comment.
Something went wrong with that request. Please try again.