passtools 0.4.4 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -16,3 +16,5 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .rvmrc
19
+ .DS_Store
20
+ .idea
data/README.md CHANGED
@@ -7,12 +7,13 @@
7
7
 
8
8
  ## Installation
9
9
 
10
- Via rubygems.org:
10
+ ### Via rubygems.org:
11
11
 
12
12
  `$ gem install passtools`
13
13
 
14
+ ####      - or -
14
15
 
15
- Using Bundler:
16
+ ### Using Bundler:
16
17
 
17
18
  Add this line to your application's Gemfile:
18
19
 
@@ -37,7 +38,7 @@ You can also configure individual values directly via accessors:
37
38
 
38
39
  `Passtools.api_key = "i_am_an_api_key"`
39
40
 
40
- Once configured, there are 7 methods available to interact with the Passtools api. Returned JSON is parsed to provide Ruby data objects.
41
+ Once configured, there are 9 methods available to interact with the Passtools api. Returned JSON is parsed to provide Ruby data objects.
41
42
 
42
43
  `Passtools::Template.list`
43
44
 
@@ -64,6 +65,22 @@ Returns detail information for individual pass
64
65
  Creates a new Pass based on specified template. Data is a nested hash containing data for
65
66
  fields, see data returned from the Pass.show call for structure.
66
67
 
68
+
69
+ `Passtools::Pass.add_locations(pass_id, data)`
70
+
71
+ Add up to 10 'Relevant Locations' to pass. Data is a list containing data for
72
+ locations, for example:
73
+
74
+ `data = [{"latitude"=>37.4471107, "longitude"=>-122.16206219999998,
75
+ "streetAddress1"=>"408 Florence St", "streetAddress2"=>"",
76
+ "city"=>"Palo Alto", "region"=>"CA", "regionCode"=>"94301",
77
+ "country"=>"US", "relevantText"=>"Palo Alto Office!"}]`
78
+
79
+
80
+ `Passtools::Pass.delete_location(pass_id, location_id)`
81
+
82
+ Delete one 'Relevant Location' from pass. Location to be deleted should be specified by ID, available in data returned from the Psss.show call.
83
+
67
84
  `Passtools::Pass.update(pass_id, data)`
68
85
 
69
86
  Updates pass data
@@ -25,6 +25,15 @@ module Passtools
25
25
  put("/pass/#{pass_id}", { :json => json } )
26
26
  end
27
27
 
28
+ def self.add_locations(pass_id,location_list)
29
+ json = MultiJson.dump(location_list)
30
+ post("/pass/#{pass_id}/locations", { :json => json } )
31
+ end
32
+
33
+ def self.delete_location(pass_id,location_id)
34
+ delete_request("/pass/#{pass_id}/location/#{location_id}" )
35
+ end
36
+
28
37
  def self.download(pass_id)
29
38
  download_file("/pass/#{pass_id}/download", 'PassToolsPass.pkpass')
30
39
  end
@@ -1,3 +1,3 @@
1
1
  module Passtools
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,119 +1,120 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: passtools
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 3
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 6
10
+ version: 0.4.6
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - David Verba
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-11-29 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2013-02-11 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: rest-client
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 1.6.7
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
- requirements:
25
+ requirements:
27
26
  - - ~>
28
- - !ruby/object:Gem::Version
27
+ - !ruby/object:Gem::Version
28
+ hash: 1
29
+ segments:
30
+ - 1
31
+ - 6
32
+ - 7
29
33
  version: 1.6.7
30
- - !ruby/object:Gem::Dependency
31
- name: multi_json
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: 1.3.6
38
34
  type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: multi_json
39
38
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
- requirements:
41
+ requirements:
43
42
  - - ~>
44
- - !ruby/object:Gem::Version
43
+ - !ruby/object:Gem::Version
44
+ hash: 23
45
+ segments:
46
+ - 1
47
+ - 3
48
+ - 6
45
49
  version: 1.3.6
46
- - !ruby/object:Gem::Dependency
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
47
53
  name: pry
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :development
55
54
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: rspec
64
- requirement: !ruby/object:Gem::Requirement
55
+ requirement: &id003 !ruby/object:Gem::Requirement
65
56
  none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 0
63
+ version: "0"
70
64
  type: :development
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
67
+ name: rspec
71
68
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- - !ruby/object:Gem::Dependency
79
- name: webmock
80
- requirement: !ruby/object:Gem::Requirement
69
+ requirement: &id004 !ruby/object:Gem::Requirement
81
70
  none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
77
+ version: "0"
86
78
  type: :development
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
81
+ name: webmock
87
82
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
- - !ruby/object:Gem::Dependency
95
- name: fakefs
96
- requirement: !ruby/object:Gem::Requirement
83
+ requirement: &id005 !ruby/object:Gem::Requirement
97
84
  none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 3
89
+ segments:
90
+ - 0
91
+ version: "0"
102
92
  type: :development
93
+ version_requirements: *id005
94
+ - !ruby/object:Gem::Dependency
95
+ name: fakefs
103
96
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
97
+ requirement: &id006 !ruby/object:Gem::Requirement
105
98
  none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ hash: 3
103
+ segments:
104
+ - 0
105
+ version: "0"
106
+ type: :development
107
+ version_requirements: *id006
110
108
  description: Ruby wrapper to access the Passtools API
111
- email:
109
+ email:
112
110
  - david@halcyonengineering.com
113
111
  executables: []
112
+
114
113
  extensions: []
114
+
115
115
  extra_rdoc_files: []
116
- files:
116
+
117
+ files:
117
118
  - .gitignore
118
119
  - .rspec
119
120
  - Gemfile
@@ -130,33 +131,41 @@ files:
130
131
  - spec/passtools/template_spec.rb
131
132
  - spec/spec_helper.rb
132
133
  - spec/support/passtools_helpers.rb
133
- homepage: ''
134
+ homepage: ""
134
135
  licenses: []
136
+
135
137
  post_install_message:
136
138
  rdoc_options: []
137
- require_paths:
139
+
140
+ require_paths:
138
141
  - lib
139
- required_ruby_version: !ruby/object:Gem::Requirement
142
+ required_ruby_version: !ruby/object:Gem::Requirement
140
143
  none: false
141
- requirements:
142
- - - ! '>='
143
- - !ruby/object:Gem::Version
144
- version: '0'
145
- required_rubygems_version: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ hash: 3
148
+ segments:
149
+ - 0
150
+ version: "0"
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
152
  none: false
147
- requirements:
148
- - - ! '>='
149
- - !ruby/object:Gem::Version
150
- version: '0'
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ hash: 3
157
+ segments:
158
+ - 0
159
+ version: "0"
151
160
  requirements: []
161
+
152
162
  rubyforge_project:
153
163
  rubygems_version: 1.8.24
154
164
  signing_key:
155
165
  specification_version: 3
156
166
  summary: Passtools API gem
157
- test_files:
167
+ test_files:
158
168
  - spec/passtools/pass_spec.rb
159
169
  - spec/passtools/template_spec.rb
160
170
  - spec/spec_helper.rb
161
171
  - spec/support/passtools_helpers.rb
162
- has_rdoc: