cafepress_api 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,5 +15,5 @@
15
15
  # along with CafePressAPI. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
  module CafePressAPI
18
- VERSION = "0.2.0"
18
+ VERSION = "0.2.1"
19
19
  end
data/lib/cafepress_api.rb CHANGED
@@ -100,6 +100,14 @@ Or better yet, add the mapping yourself in product_colors.rb and submit it back
100
100
  end
101
101
  end
102
102
 
103
+ # for whatever reason, some products don't have a default color
104
+ begin
105
+ default_color_id = product.get_elements("color[@default='true']").first.attributes['id']
106
+ rescue
107
+ default_color_id = nil
108
+ end
109
+
110
+
103
111
  products << {
104
112
  :name => product.attributes['name'],
105
113
  :default_caption => product.attributes['defaultCaption'],
@@ -108,6 +116,8 @@ Or better yet, add the mapping yourself in product_colors.rb and submit it back
108
116
  :cafepress_design_id => product.get_elements("mediaConfiguration[@perspectives='Front']").first.attributes['designId'],
109
117
  :cafepress_back_design_id => cafepress_back_design_id,
110
118
  :gender => gender, # See comment above
119
+ :cafepress_merchandise_id => product.attributes['merchandiseId'],
120
+ :default_color_id => default_color_id,
111
121
  :image_urls => image_urls
112
122
  }
113
123
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cafepress_api
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
  - Benjamin Lee Smith