passworks 0.0.1 → 0.0.2
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Rakefile +8 -1
- data/lib/passworks/request_proxy.rb +10 -10
- data/lib/passworks/version.rb +1 -1
- data/passworks.gemspec +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e228956e308b9106c06b47e6a98dfdcbe75abd5
|
4
|
+
data.tar.gz: 658a22d96039d37794e5547df43a91955296650d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e73735c8ef5dd8c7a5871c0648a06e4ef532d5142d418a022ea5dec3c2642ab9d3d664a3c16a1c339fd719e8a7e5620c46c4ad4689eaa61582836897233a663
|
7
|
+
data.tar.gz: a80c649284f072c38275d59dfc428c07af333fb8ebd81e0c25e8566e764724f51656440fa8c3ab674a868a7138f63e418d6bbd9f56b43ce1ff02c57b56feb12d
|
data/CHANGELOG.md
CHANGED
@@ -3,5 +3,8 @@
|
|
3
3
|
This file is a manually maintained list of changes for each release. Feel free to add your
|
4
4
|
changes here when sending pull requests. Also send corrections if you spot any mistakes.
|
5
5
|
|
6
|
+
## v0.0.2 (2014-10-31)
|
7
|
+
* Bug fix: Fixed typo in the code that prevent creating an Asset
|
8
|
+
|
6
9
|
## v0.0.1 (2014-10-30)
|
7
10
|
* Initial release
|
data/Rakefile
CHANGED
@@ -52,9 +52,9 @@ module Passworks
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# Creates a campaing instance (Assests, Boarding Passes, Coupons, Generics and Store Cards) or a passe depending of the caller context
|
55
|
-
# @param
|
56
|
-
# @param
|
57
|
-
# @option
|
55
|
+
# @param data [Hash] data Campaign or pass data
|
56
|
+
# @param params [Hash] params Extra arguments to send with the request
|
57
|
+
# @option params [Boolean] merge: (true) Merge passed pass data with the campaign incase you are creating a passe instance.
|
58
58
|
# @example Create a coupon (campaign)
|
59
59
|
# client.coupons.create({
|
60
60
|
# name: 'My First Coupon',
|
@@ -63,25 +63,25 @@ module Passworks
|
|
63
63
|
# @example Create a "empty" passe for the first coupon campaign
|
64
64
|
# client.coupons.all(per_page: 1).first.passes.create()
|
65
65
|
# @return [Passworks::CampaignResource or Passworks::PassResource] depending of the calling a {Passworks::CampaignResource} or {Passworks::PassResource} is returned.
|
66
|
-
def create(
|
66
|
+
def create(data={}, params={})
|
67
67
|
|
68
68
|
if collection_name.to_s == 'assets' && collection_uuid.nil?
|
69
|
-
raise Passworks::Exceptions::FileNotFound.new("Can't find file #{
|
70
|
-
|
69
|
+
raise Passworks::Exceptions::FileNotFound.new("Can't find file #{data[:file]}") unless data.has_key?(:file) && File.exists?(data[:file])
|
70
|
+
data[:file] = ::Faraday::UploadIO.new(data[:file], "image/#{data[:file].split('.').last.downcase}")
|
71
71
|
end
|
72
72
|
|
73
73
|
if collection_uuid
|
74
74
|
content = {
|
75
75
|
body: {
|
76
|
-
'pass' =>
|
77
|
-
}.merge(
|
76
|
+
'pass' => data
|
77
|
+
}.merge(params)
|
78
78
|
}
|
79
79
|
fetch_url = "#{collection_url}/passes"
|
80
80
|
else
|
81
81
|
content = {
|
82
82
|
body: {
|
83
|
-
single_name.to_sym =>
|
84
|
-
}.merge(
|
83
|
+
single_name.to_sym => data
|
84
|
+
}.merge(params)
|
85
85
|
}
|
86
86
|
fetch_url = collection_url
|
87
87
|
end
|
data/lib/passworks/version.rb
CHANGED
data/passworks.gemspec
CHANGED
@@ -8,8 +8,8 @@ require 'passworks/version'
|
|
8
8
|
Gem::Specification.new do |spec|
|
9
9
|
spec.name = "passworks"
|
10
10
|
spec.version = Passworks::VERSION
|
11
|
-
spec.authors = ["Luis Mendes", "Miguel Verissimo"]
|
12
|
-
spec.email = ["luis@passworks.io", "miguel@passworks.io"]
|
11
|
+
spec.authors = ["Luis Mendes", "Miguel Verissimo", "Tiago Parreira"]
|
12
|
+
spec.email = ["luis@passworks.io", "miguel@passworks.io", "tiago@passworks.io"]
|
13
13
|
spec.summary = %q{Passworks API client}
|
14
14
|
spec.description = %q{Provides a simple interface to Passworks API}
|
15
15
|
spec.homepage = "https://www.passworks.io"
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis Mendes
|
8
8
|
- Miguel Verissimo
|
9
|
+
- Tiago Parreira
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
13
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: faraday
|
@@ -141,6 +142,7 @@ description: Provides a simple interface to Passworks API
|
|
141
142
|
email:
|
142
143
|
- luis@passworks.io
|
143
144
|
- miguel@passworks.io
|
145
|
+
- tiago@passworks.io
|
144
146
|
executables: []
|
145
147
|
extensions: []
|
146
148
|
extra_rdoc_files: []
|