passworks 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: 7ba2d0f9da5b52d98c7e8d28467ba75e7d7984f1
4
- data.tar.gz: 74f29a1668f6560cb74ab045a94d90c9eb756146
3
+ metadata.gz: 2e228956e308b9106c06b47e6a98dfdcbe75abd5
4
+ data.tar.gz: 658a22d96039d37794e5547df43a91955296650d
5
5
  SHA512:
6
- metadata.gz: c5ddfe8be5badfd3462c239c88f27b9c0d99a2b68a8587f84e57ab455ba86e5bdf41335e5664ad983496d3ca2d27ab3b582674265f73c94315630a387e65703c
7
- data.tar.gz: 8ced775e48072afb76a94f1f368b42e111e4498d4ac9d10fde61cac5c2496a8a13b1050859935e83ed9a0dff39f30fa2901ae3d1b03e57538b6b4304ac41a888
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
@@ -1,2 +1,9 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
2
3
 
4
+ Rake::TestTask.new :spec do |test|
5
+ test.test_files = Dir['spec/**/*_spec.rb']
6
+ test.verbose = true
7
+ end
8
+
9
+ task default: :spec
@@ -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 campaing_or_pass_data [Hash] campaing_or_pass_data Campaign or pass data
56
- # @param extra_args [Hash] extra_args Extra arguments to send with the request
57
- # @option extra_args [Boolean] merge: (true) Merge passed pass data with the campaign incase you are creating a passe instance.
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(campaing_or_pass_data={}, extra_args={})
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 #{hash[:file]}") unless hash.has_key?(:file) && File.exists?(hash[:file])
70
- hash[:file] = ::Faraday::UploadIO.new(hash[:file], "image/#{hash[:file].split('.').last.downcase}")
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' => campaing_or_pass_data
77
- }.merge(extra_args)
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 => campaing_or_pass_data
84
- }.merge(extra_args)
83
+ single_name.to_sym => data
84
+ }.merge(params)
85
85
  }
86
86
  fetch_url = collection_url
87
87
  end
@@ -1,3 +1,3 @@
1
1
  module Passworks
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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-30 00:00:00.000000000 Z
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: []