zookal_magento_rest_api 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf6d8162f9afab5ccd2ded8c08185cb69f4947bc
4
- data.tar.gz: 138417e1bf08fbfda6f85fbeac1f2eba8d7a4052
3
+ metadata.gz: c9c7c1423f6897af0039dcf6372b99a39a49281c
4
+ data.tar.gz: 83779b82196132076aef3074a4a28541cd4ed2d9
5
5
  SHA512:
6
- metadata.gz: 2c0443d11fac83e0af948f798c28466468a6f42f56891ec3589aa0b61525f5a46030bc23d433c46404f3e2d1399cff4c942c5db0271873ef9fb45fdd8c22dc7c
7
- data.tar.gz: 913e5ab08f2a9c5e94ef11da5ffd0b514a8f988c9867de497b1d8484f8ea207fee42e0371b61e0b0e1c2c2b27283b76d1ad9bd0bd31fd9b6fd2ac0e5cb677ebb
6
+ metadata.gz: 1d80553779530be363f323509ed1daf1cf8523e769de750e3be607a5f0f43589d6f1156a59c05aab3cf9791dc54feac11fddd8f99fd4e6d77e50cb4c75eac229
7
+ data.tar.gz: e439ece1923f3dfd2310c16d8b6165add6050ff2e85ff5779d35c7779d0a9e9326bd29d0d57bbbbaf965744d9ad86e3408c95ee3ef1c1b87c6468ecffc9f2c4a
data/README.md CHANGED
@@ -20,14 +20,16 @@ Or install it yourself as:
20
20
 
21
21
  Create a file `config/initializers/zookal_magento_rest_api.rb` with the following content and restart Rails after saving the file:
22
22
 
23
- ZookalMagentoRestApi.configure do |config|
24
- config.consumer_key = "123dsfdsafQ231" # from Magento Admin panel
25
- config.consumer_secret = "23dfsfFdsfsdee" # from Magento Admin panel
26
- config.site = "https://www.zookal.com" # without trailing slash and no redirects (e.g. root domain to www)
27
- config.access_key = "3434412373rf" # from prior authentication
28
- config.access_secret = "df23sdfsf23a" # from prior authentication
29
- config.url_params = "utm_source=some-company&utm_medium=affiliate&utm_campaign=newsletter-01-2014" # optional
30
- end
23
+ ```ruby
24
+ ZookalMagentoRestApi.configure do |config|
25
+ config.consumer_key = "123dsfdsafQ231" # from Magento Admin panel
26
+ config.consumer_secret = "23dfsfFdsfsdee" # from Magento Admin panel
27
+ config.site = "https://www.zookal.com" # without trailing slash and no redirects (e.g. root domain to www)
28
+ config.access_key = "3434412373rf" # from prior authentication
29
+ config.access_secret = "df23sdfsf23a" # from prior authentication
30
+ config.url_params = "utm_source=some-company&utm_medium=affiliate&utm_campaign=newsletter-01-2014" # optional
31
+ end
32
+ ```
31
33
 
32
34
  *Important*: Make sure the URL in the site configuration is without trailing slash and has no redirect (e.g. `https://zookal.com` redirects to `https://www.zookal.com`). Otherwise you'll get a 301 Redirect error for each request.
33
35
 
@@ -37,20 +39,26 @@ Information on how to obtain access_key and access_secret can be seen [here](htt
37
39
 
38
40
  Instantiate a client
39
41
 
40
- zookal_magento_client = ZookalMagentoRestApi::Client.new
42
+ ```ruby
43
+ zookal_magento_client = ZookalMagentoRestApi::Client.new
44
+ ```
41
45
 
42
46
  Query a book
43
47
 
44
- book_buy_new = zookal_magento_client.find_by(isbn: 9781442531109, purchase_type: "Buy New")
45
- book_rent = zookal_magento_client.find_by(isbn: 9781442531109, purchase_type: "Rent")
48
+ ```ruby
49
+ book_buy_new = zookal_magento_client.find_by(isbn: 9781442531109, purchase_type: "Buy New")
50
+ book_rent = zookal_magento_client.find_by(isbn: 9781442531109, purchase_type: "Rent")
51
+ ```
46
52
 
47
53
  Check if a book exists
48
54
 
49
- book_buy_new.present?
55
+ ```ruby
56
+ book_buy_new.present?
57
+ ```
50
58
 
51
59
  Get attributes
52
60
 
53
- ```
61
+ ```ruby
54
62
  book_buy_new.url_with_params # Full URL with specified params in `config/zookal_magento_rest_api.rb`
55
63
  book_buy_new.special_price # Price
56
64
  book_buy_new.price # RRP
@@ -65,13 +73,17 @@ book_buy_new.pages # Pages
65
73
 
66
74
  Get list of all attributes in console
67
75
 
68
- $ book_buy_new.instance_variable_get("@table")
76
+ ```ruby
77
+ book_buy_new.instance_variable_get("@table")
78
+ ```
69
79
 
70
80
  Debugging
71
81
 
72
- book_buy_new.meta_status # HTTP status code, 200 for successful request, 4xx for client error, 5xx for server error
73
- book_buy_new.meta_message # HTTP status message, e.g. "OK" for 200 or "Unauthorized" for 401
74
- book_buy_new.meta_errors # Array of detailed error messages, e.g. ["Invalid value for attribute purchase_type", "config.access_secret not specified in initializer file"]
82
+ ```ruby
83
+ book_buy_new.meta_status # HTTP status code, 200 for successful request, 4xx for client error, 5xx for server error
84
+ book_buy_new.meta_message # HTTP status message, e.g. "OK" for 200 or "Unauthorized" for 401
85
+ book_buy_new.meta_errors # Array of detailed error messages, e.g. ["Invalid value for attribute purchase_type", "config.access_secret not specified in initializer file"]
86
+ ```
75
87
 
76
88
  ## Contributing
77
89
 
@@ -1,3 +1,3 @@
1
1
  module ZookalMagentoRestApi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zookal_magento_rest_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Imstepf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-10 00:00:00.000000000 Z
11
+ date: 2014-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth
@@ -125,14 +125,6 @@ files:
125
125
  - lib/zookal_magento_rest_api/version.rb
126
126
  - spec/spec_helper.rb
127
127
  - spec/zookal_magento_rest_api_spec.rb
128
- - zookal-magento-rest-api/.gitignore
129
- - zookal-magento-rest-api/Gemfile
130
- - zookal-magento-rest-api/LICENSE.txt
131
- - zookal-magento-rest-api/README.md
132
- - zookal-magento-rest-api/Rakefile
133
- - zookal-magento-rest-api/lib/zookal/magento/rest/api.rb
134
- - zookal-magento-rest-api/lib/zookal/magento/rest/api/version.rb
135
- - zookal-magento-rest-api/zookal-magento-rest-api.gemspec
136
128
  - zookal_magento_rest_api.gemspec
137
129
  homepage: https://github.com/Zookal/zookal-magento-rest-api
138
130
  licenses:
@@ -1,22 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.bundle
19
- *.so
20
- *.o
21
- *.a
22
- mkmf.log
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in zookal-magento-rest-api.gemspec
4
- gemspec
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014 Michael Imstepf
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,29 +0,0 @@
1
- # Zookal::Magento::Rest::Api
2
-
3
- TODO: Write a gem description
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'zookal-magento-rest-api'
10
-
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- Or install it yourself as:
16
-
17
- $ gem install zookal-magento-rest-api
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
- ## Contributing
24
-
25
- 1. Fork it ( https://github.com/[my-github-username]/zookal-magento-rest-api/fork )
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create a new Pull Request
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
@@ -1,9 +0,0 @@
1
- module Zookal
2
- module Magento
3
- module Rest
4
- module Api
5
- VERSION = "0.0.1"
6
- end
7
- end
8
- end
9
- end
@@ -1,11 +0,0 @@
1
- require "zookal/magento/rest/api/version"
2
-
3
- module Zookal
4
- module Magento
5
- module Rest
6
- module Api
7
- # Your code goes here...
8
- end
9
- end
10
- end
11
- end
@@ -1,23 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'zookal/magento/rest/api/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "zookal-magento-rest-api"
8
- spec.version = Zookal::Magento::Rest::Api::VERSION
9
- spec.authors = ["Michael Imstepf"]
10
- spec.email = ["michael.imstepf@gmail.com"]
11
- spec.summary = %q{TODO: Write a short summary. Required.}
12
- spec.description = %q{TODO: Write a longer description. Optional.}
13
- spec.homepage = ""
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.6"
22
- spec.add_development_dependency "rake"
23
- end