etsy 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 52e5bcc56a9eb4df1e1b2e732f296d82034b8b8fee77e17a7d4c567d70e8741e
4
+ data.tar.gz: bde90f57588f337c92a0a97b4c4f1c98757e6e3eff4d0372dcb9bbcd4d7b8103
5
+ SHA512:
6
+ metadata.gz: c974d38d7df6ee9be0df31072dc0cbadc59c762610b12039ad8132febea31273817c281dcd257e9b3334a3855677b8eb770df091caa58e77a5fb080214c0442b
7
+ data.tar.gz: 409997c87e75203d40037069af7deda3814954d33f88e3cc610c8976e7593fa9cad932fbe72025f79a82e1b4ea1a18b5c461ca1f782227d3479218c2e3ad9b1e
data/.travis.yml CHANGED
@@ -1,13 +1,16 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - jruby-19mode
5
- - rbx
6
- - 2.1.5
3
+ - jruby
4
+ - 2.6.8
5
+ - 2.7.4
6
+ - 3.0.2
7
+
8
+ dist: bionic
7
9
 
8
10
  before_install:
9
11
  - gem install bundler
12
+ - sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates -y && sudo update-ca-certificates
10
13
 
11
14
  matrix:
12
15
  allow_failures:
13
- - rvm: rbx
16
+ - rvm: 3.0.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ All changes to the Etsy gem are documented here.
4
+
5
+ ## [0.3.4] - November 3, 2021
6
+
7
+ Getting the gem back to life and ready to migrate to Etsy API v3.
8
+
9
+ ### Added:
10
+ - States for listings as per current documentation (Etsy API v2)
11
+ - id attribute for Image class
12
+ - Change log file is here!
13
+
14
+ ### Changed:
15
+ - Cleaned up the dependencies and updated old gems
16
+ - Updated ruby versions in Travis config
data/Gemfile CHANGED
@@ -1,11 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- if RUBY_VERSION < '1.9'
6
- gem 'activesupport', '< 4.0'
7
- end
8
-
9
- if RUBY_VERSION < '2.0'
10
- gem 'json', '<= 1.5.5'
11
- end
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Etsy
2
2
 
3
3
  [![Build Status](https://secure.travis-ci.org/kytrinyx/etsy.png)](http://travis-ci.org/kytrinyx/etsy)
4
- [![Dependency Status](https://gemnasium.com/kytrinyx/etsy.png)](https://gemnasium.com/kytrinyx/etsy)
5
4
 
6
5
  ## Description
7
6
 
@@ -15,7 +14,7 @@ Installing the latest stable version is simple:
15
14
 
16
15
  If you want to be on the bleeding edge, install from GitHub:
17
16
 
18
- $ git clone git://github.com/kytrinyx/etsy.git
17
+ $ git clone git://github.com/iamfmjk/etsy.git
19
18
  $ cd etsy
20
19
  $ rake install
21
20
 
@@ -94,7 +93,7 @@ Authenticated calls can now be made by passing an access token and secret:
94
93
  Etsy.myself(access.token, access.secret)
95
94
 
96
95
  The key and secret have to be passed in for the authenticated calls.
97
-
96
+
98
97
  auth = {:access_token=>access.token, :access_secret=>access.secret}
99
98
  Etsy::Transaction.find_all_by_shop_id(shop_id, auth.merge(options))
100
99
 
data/etsy.gemspec CHANGED
@@ -2,8 +2,8 @@
2
2
  require File.expand_path('../lib/etsy/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.authors = ["Patrick Reagan", "Katrina Owen"]
6
- gem.email = ["reaganpr@gmail.com", "katrina.owen@gmail.com"]
5
+ gem.authors = ["Iuliia Kolomiiets", "Patrick Reagan", "Katrina Owen"]
6
+ gem.email = ["etsygeminfo@gmail.com, reaganpr@gmail.com", "katrina.owen@gmail.com" ]
7
7
  gem.description = %q{A friendly Ruby interface to the Etsy API}
8
8
  gem.summary = %q{Provides a friendly ruby-like wrapper for the Etsy API}
9
9
  gem.homepage = "http://github.com/kytrinyx/etsy"
@@ -20,9 +20,9 @@ Gem::Specification.new do |gem|
20
20
  gem.rubygems_version = "1.8.10"
21
21
 
22
22
  gem.add_dependency "json", ">= 1.5.0"
23
- gem.add_dependency "oauth", "~> 0.4.0"
23
+ gem.add_dependency "oauth", ">= 0.5.5"
24
24
 
25
- gem.add_development_dependency "rake", "~> 10.0.4"
25
+ gem.add_development_dependency "rake", "~> 12.3.3"
26
26
  gem.add_development_dependency "jnunemaker-matchy", "~> 0.4.0"
27
27
  gem.add_development_dependency 'shoulda', "~> 3.4.0"
28
28
  gem.add_development_dependency 'mocha', "~> 0.13.3"
@@ -30,5 +30,5 @@ Gem::Specification.new do |gem|
30
30
  # on shoulda/context.rb:7
31
31
  # But then when you load active_support, shoulda-context decides
32
32
  # to load MiniTest
33
- gem.add_development_dependency 'test-unit', "~>3.2.5"
33
+ gem.add_development_dependency 'test-unit', "~>3.5.0"
34
34
  end
data/lib/etsy/image.rb CHANGED
@@ -14,6 +14,7 @@ module Etsy
14
14
 
15
15
  include Etsy::Model
16
16
 
17
+ attribute :id, :from => :listing_image_id
17
18
  attribute :square, :from => :url_75x75
18
19
  attribute :small, :from => :url_170x135
19
20
  attribute :thumbnail, :from => :url_570xN
data/lib/etsy/listing.rb CHANGED
@@ -26,14 +26,19 @@ module Etsy
26
26
  # [removed?] Has this listing been removed?
27
27
  # [sold_out?] Is this listing sold out?
28
28
  # [expired?] Has this listing expired?
29
- # [alchemy?] Is this listing an Alchemy item? (i.e. requested by an Etsy user)
29
+ # [edit?] Is this listing inactive?
30
+ # [draft?] Is this listing in draft mode / not yet published?
31
+ # [private?] Is this a private listing?
32
+ # [unavailable?] Has this listing been removed by Etsy admins?
33
+
30
34
  #
31
35
  class Listing
32
36
 
33
37
  include Etsy::Model
34
38
 
35
- STATES = %w(active removed sold_out expired alchemy)
36
- VALID_STATES = [:active, :expired, :inactive, :sold, :featured, :draft, :sold_out]
39
+ STATES = %w(active removed sold_out expired edit draft private unavailable)
40
+ #TODO: re-check valid states
41
+ VALID_STATES = [:active, :draft, :expired, :featured, :inactive, :sold, :sold_out]
37
42
 
38
43
  attribute :id, :from => :listing_id
39
44
  attribute :view_count, :from => :views
@@ -249,7 +254,7 @@ module Etsy
249
254
  end
250
255
 
251
256
  def is_supply
252
- !!@result.fetch("is_supply")
257
+ @result.fetch('is_supply') == 'true'
253
258
  end
254
259
 
255
260
  private
data/lib/etsy/request.rb CHANGED
@@ -22,13 +22,13 @@ module Etsy
22
22
  request = Request.new(resource_path, parameters)
23
23
  Response.new(request.put)
24
24
  end
25
-
25
+
26
26
  def self.delete(resource_path, parameters = {})
27
27
  request = Request.new(resource_path, parameters)
28
28
  Response.new(request.delete)
29
29
  end
30
-
31
-
30
+
31
+
32
32
 
33
33
  # Create a new request for the resource with optional parameters
34
34
  def initialize(resource_path, parameters = {})
@@ -75,7 +75,7 @@ module Etsy
75
75
  def put
76
76
  client.put(endpoint_url)
77
77
  end
78
-
78
+
79
79
  def delete
80
80
  client.delete(endpoint_url)
81
81
  end
@@ -104,7 +104,7 @@ module Etsy
104
104
  k.nil? || v.nil? || (k.respond_to?(:empty?) && k.empty?) || (v.respond_to?(:empty?) && v.empty?)
105
105
  }.map { |k, v| "#{to_url(k.to_s)}=#{to_url(v)}" }.join('&')
106
106
  else
107
- URI.escape(val.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
107
+ URI.encode_www_form_component(val.to_s)
108
108
  end
109
109
  end
110
110
 
data/lib/etsy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Etsy
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -23,7 +23,8 @@
23
23
  "brightness": 100,
24
24
  "is_black_and_white": false,
25
25
  "url": "http://www.etsy.com/listing/59495892/initials-carved-into-tree-love-stamp",
26
- "views": 37
26
+ "views": 37,
27
+ "is_supply": "false"
27
28
  },
28
29
  {
29
30
  "listing_id": 59495804,
@@ -48,7 +49,8 @@
48
49
  "brightness": 100,
49
50
  "is_black_and_white": false,
50
51
  "url": "http://www.etsy.com/listing/59495804/faux-bois-heart-hand-carved-stamp",
51
- "views": 78
52
+ "views": 78,
53
+ "is_supply": "true"
52
54
  }],
53
55
  "params": {
54
56
  "limit": "2",
@@ -66,4 +68,4 @@
66
68
  "category": null
67
69
  },
68
70
  "type": "Listing"
69
- }
71
+ }
data/test/test_helper.rb CHANGED
@@ -2,7 +2,6 @@
2
2
  $:.reject! { |e| e.include? 'TextMate' }
3
3
 
4
4
  require 'rubygems'
5
- require 'active_support' # workaround load issue with shoulda in rubinius
6
5
  require 'test/unit'
7
6
  require 'shoulda'
8
7
  require 'matchy'
@@ -28,6 +28,10 @@ module Etsy
28
28
  @image = Image.new(data.first)
29
29
  end
30
30
 
31
+ should "have a value for :id" do
32
+ @image.id.should == 185073072
33
+ end
34
+
31
35
  should "have a value for :square" do
32
36
  @image.square.should == "http://ny-image0.etsy.com/il_75x75.185073072.jpg"
33
37
  end
@@ -78,7 +78,6 @@ module Etsy
78
78
  Listing.stubs(:find).with([1, 2], {:other => :params}).returns(['listings'])
79
79
 
80
80
  Listing.find_all_by_shop_id(1, :state => :sold, :other => :params).should == ['listings']
81
-
82
81
  end
83
82
 
84
83
  should "not ask the API for listings if there are no transactions" do
@@ -188,9 +187,13 @@ module Etsy
188
187
  should "have a value for :black_and_white?" do
189
188
  @listing.black_and_white?.should == false
190
189
  end
190
+
191
+ should "have a value for :is_supply?" do
192
+ @listing.is_supply.should == false
193
+ end
191
194
  end
192
195
 
193
- %w(active removed sold_out expired alchemy).each do |state|
196
+ %w(active removed sold_out expired edit draft private unavailable).each do |state|
194
197
  should "know that the listing is #{state}" do
195
198
  listing = Listing.new
196
199
  listing.expects(:state).with().returns(state.sub('_', ''))
metadata CHANGED
@@ -1,139 +1,126 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
5
- prerelease:
4
+ version: 0.3.4
6
5
  platform: ruby
7
6
  authors:
7
+ - Iuliia Kolomiiets
8
8
  - Patrick Reagan
9
9
  - Katrina Owen
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-07-26 00:00:00.000000000 Z
13
+ date: 2021-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
17
17
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
18
  requirements:
20
- - - ! '>='
19
+ - - ">="
21
20
  - !ruby/object:Gem::Version
22
21
  version: 1.5.0
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
25
  requirements:
28
- - - ! '>='
26
+ - - ">="
29
27
  - !ruby/object:Gem::Version
30
28
  version: 1.5.0
31
29
  - !ruby/object:Gem::Dependency
32
30
  name: oauth
33
31
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
32
  requirements:
36
- - - ~>
33
+ - - ">="
37
34
  - !ruby/object:Gem::Version
38
- version: 0.4.0
35
+ version: 0.5.5
39
36
  type: :runtime
40
37
  prerelease: false
41
38
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
39
  requirements:
44
- - - ~>
40
+ - - ">="
45
41
  - !ruby/object:Gem::Version
46
- version: 0.4.0
42
+ version: 0.5.5
47
43
  - !ruby/object:Gem::Dependency
48
44
  name: rake
49
45
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
46
  requirements:
52
- - - ~>
47
+ - - "~>"
53
48
  - !ruby/object:Gem::Version
54
- version: 10.0.4
49
+ version: 12.3.3
55
50
  type: :development
56
51
  prerelease: false
57
52
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
53
  requirements:
60
- - - ~>
54
+ - - "~>"
61
55
  - !ruby/object:Gem::Version
62
- version: 10.0.4
56
+ version: 12.3.3
63
57
  - !ruby/object:Gem::Dependency
64
58
  name: jnunemaker-matchy
65
59
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
60
  requirements:
68
- - - ~>
61
+ - - "~>"
69
62
  - !ruby/object:Gem::Version
70
63
  version: 0.4.0
71
64
  type: :development
72
65
  prerelease: false
73
66
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
67
  requirements:
76
- - - ~>
68
+ - - "~>"
77
69
  - !ruby/object:Gem::Version
78
70
  version: 0.4.0
79
71
  - !ruby/object:Gem::Dependency
80
72
  name: shoulda
81
73
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
74
  requirements:
84
- - - ~>
75
+ - - "~>"
85
76
  - !ruby/object:Gem::Version
86
77
  version: 3.4.0
87
78
  type: :development
88
79
  prerelease: false
89
80
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
81
  requirements:
92
- - - ~>
82
+ - - "~>"
93
83
  - !ruby/object:Gem::Version
94
84
  version: 3.4.0
95
85
  - !ruby/object:Gem::Dependency
96
86
  name: mocha
97
87
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
88
  requirements:
100
- - - ~>
89
+ - - "~>"
101
90
  - !ruby/object:Gem::Version
102
91
  version: 0.13.3
103
92
  type: :development
104
93
  prerelease: false
105
94
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
95
  requirements:
108
- - - ~>
96
+ - - "~>"
109
97
  - !ruby/object:Gem::Version
110
98
  version: 0.13.3
111
99
  - !ruby/object:Gem::Dependency
112
100
  name: test-unit
113
101
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
102
  requirements:
116
- - - ~>
103
+ - - "~>"
117
104
  - !ruby/object:Gem::Version
118
- version: 3.2.5
105
+ version: 3.5.0
119
106
  type: :development
120
107
  prerelease: false
121
108
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
109
  requirements:
124
- - - ~>
110
+ - - "~>"
125
111
  - !ruby/object:Gem::Version
126
- version: 3.2.5
112
+ version: 3.5.0
127
113
  description: A friendly Ruby interface to the Etsy API
128
114
  email:
129
- - reaganpr@gmail.com
115
+ - etsygeminfo@gmail.com, reaganpr@gmail.com
130
116
  - katrina.owen@gmail.com
131
117
  executables: []
132
118
  extensions: []
133
119
  extra_rdoc_files: []
134
120
  files:
135
- - .gitignore
136
- - .travis.yml
121
+ - ".gitignore"
122
+ - ".travis.yml"
123
+ - CHANGELOG.md
137
124
  - Gemfile
138
125
  - LICENSE
139
126
  - README.md
@@ -235,27 +222,25 @@ files:
235
222
  homepage: http://github.com/kytrinyx/etsy
236
223
  licenses:
237
224
  - MIT
225
+ metadata: {}
238
226
  post_install_message:
239
227
  rdoc_options: []
240
228
  require_paths:
241
229
  - lib
242
230
  required_ruby_version: !ruby/object:Gem::Requirement
243
- none: false
244
231
  requirements:
245
- - - ! '>='
232
+ - - ">="
246
233
  - !ruby/object:Gem::Version
247
234
  version: '0'
248
235
  required_rubygems_version: !ruby/object:Gem::Requirement
249
- none: false
250
236
  requirements:
251
- - - ! '>='
237
+ - - ">="
252
238
  - !ruby/object:Gem::Version
253
239
  version: '0'
254
240
  requirements: []
255
- rubyforge_project:
256
- rubygems_version: 1.8.23
241
+ rubygems_version: 3.1.2
257
242
  signing_key:
258
- specification_version: 3
243
+ specification_version: 4
259
244
  summary: Provides a friendly ruby-like wrapper for the Etsy API
260
245
  test_files:
261
246
  - test/fixtures/about/getAbout.json