printaura 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5c38640a354d5ef950f1505051e5261c253d9fd
4
- data.tar.gz: 7bf76bc161183ff8057bd7ab5cf5af2fdb30f04c
3
+ metadata.gz: 16527dc9e4e8be9ee71a811f15d8db66645231d5
4
+ data.tar.gz: 2da7fa2e041c6e1c61052c0e9a08521f1a5291d9
5
5
  SHA512:
6
- metadata.gz: a4a964740344f6cfe53a435a71b9404856cbad79492189ca064b7cd771a63f03c400ff1b298d502f7fbf0cba4bce0738c6108868e4ff31e5a7440b9197a5ec5d
7
- data.tar.gz: 4d959077f7e3dba6f9eb5bccdf4950e9d4bde70634baa57c324989f4d448cd7e80248ed5f4334301433cafff232bbdd043d4f1de294ed2cc9399ec28eabad30c
6
+ metadata.gz: ed7534395cba497f158e422f05aa4db28f088dc903e2e7d8af68708239b8715b0713670d4335c86dcc5bcbdc9e2066974a0ac8628678b7559ac9f3981fc2bf83
7
+ data.tar.gz: 99fa0b2d5e59f52ca0fba47ed5ea9c69268a7b29f46a214c85be0b28e486bfd782322968e0d881c2e040116072e6efa46122e97a376f7198ce0f95f9802946bf
@@ -1,18 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- printaura (0.0.1)
5
- httparty
4
+ printaura (0.0.9)
5
+ rest-client
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- httparty (0.13.3)
11
- json (~> 1.8)
12
- multi_xml (>= 0.5.2)
13
- json (1.8.2)
14
- multi_xml (0.5.5)
10
+ mime-types (2.4.3)
11
+ netrc (0.8.0)
15
12
  rake (10.4.2)
13
+ rest-client (1.7.2)
14
+ mime-types (>= 1.16, < 3.0)
15
+ netrc (~> 0.7)
16
16
 
17
17
  PLATFORMS
18
18
  ruby
@@ -1,5 +1,6 @@
1
1
  require "printaura/version"
2
2
  require "printaura/product"
3
+ require "printaura/image"
3
4
 
4
5
  module Printaura
5
6
  class Config
@@ -1,4 +1,4 @@
1
- require 'httparty'
1
+ require 'rest-client'
2
2
 
3
3
  module Printaura
4
4
  class Api
@@ -6,11 +6,11 @@ module Printaura
6
6
  #we only really care about the array options
7
7
  options = args.last || {}
8
8
 
9
- postparams= options.update({key: Printaura::Config.API_KEY, hash: Printaura::Config.API_HASH, method: m}).map {|k,v| "#{k}=#{v}"}.join("&")
9
+ postparams= {key: Printaura::Config.API_KEY, hash: Printaura::Config.API_HASH, method: m}.update(options)
10
10
  puts postparams
11
11
 
12
- result = JSON.parse(HTTParty.post("http://www.api.printaura.com/api.php", body: postparams))
13
- puts result
12
+ result = JSON.parse(RestClient.post("http://www.api.printaura.com/api.php", postparams))
13
+
14
14
  raise result["message"] unless result["status"]
15
15
 
16
16
  return result
@@ -0,0 +1,16 @@
1
+ require "printaura/api"
2
+
3
+ module Printaura
4
+ class Image
5
+ attr_accessor :image_id
6
+
7
+ def initialize(filename)
8
+ if filename.is_a?(String)
9
+ filename = File.new(filename)
10
+ end
11
+
12
+ result = Api.uploadimage({file: filename})
13
+ @image_id = nil
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Printaura
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.7"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_dependency "httparty"
23
+ spec.add_dependency "rest-client"
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: printaura
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - oren mazor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-07 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: httparty
42
+ name: rest-client
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -68,6 +68,7 @@ files:
68
68
  - Rakefile
69
69
  - lib/printaura.rb
70
70
  - lib/printaura/api.rb
71
+ - lib/printaura/image.rb
71
72
  - lib/printaura/product.rb
72
73
  - lib/printaura/version.rb
73
74
  - printaura.gemspec