mapsqueak 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mapsqueak.rb +11 -2
  2. metadata +19 -30
data/lib/mapsqueak.rb CHANGED
@@ -30,6 +30,13 @@ class MapSqueakSession
30
30
  signin(username,password) unless username.nil?
31
31
  end
32
32
 
33
+ def create_user(name,email,password)
34
+ # :name, :email, :password, :password_confirmation
35
+ curl_str = "curl -F name=\'#{name}\' -F email=#{email} -F password=\'#{password}\' -F password_confirmation=\'#{password}\' #{self.host}/users"
36
+ $stderr.puts curl_str
37
+ `#{curl_str}`
38
+ end
39
+
33
40
  # sign in by email/password.
34
41
  # note that a remember_token will be saved in a cookie file
35
42
  def sign_in(email,password)
@@ -79,6 +86,8 @@ class MapSqueakSession
79
86
  data = temp_squeak.send("to_#{format_str}")
80
87
  curl_str = "curl --data \'#{data}\' #{self.host}/squeaks.#{format_str} -H \"Content-Type: application/#{format_str}\" --cookie #{@cookie_file}"
81
88
 
89
+ puts curl_str
90
+
82
91
  # execute the curl command
83
92
  res = `#{curl_str}`
84
93
  actual_squeak = ClientSqueak.new(res)
@@ -135,7 +144,7 @@ class MapSqueakSession
135
144
  end
136
145
  # TODO: add a hash based on the parameters requested and use session token
137
146
  # T
138
- squeak_string = `curl #{self.host}/users/#{@user_id}.#{format.to_s} --cookie #{@cookie_file}`
147
+ squeak_string = `curl #{self.host}/squeaks/mine.#{format.to_s} --cookie #{@cookie_file}`
139
148
  return squeak_str_to_objects(squeak_string,format)
140
149
  end
141
150
 
@@ -166,7 +175,7 @@ end
166
175
  class ClientSqueak
167
176
  include XmlHelpers
168
177
 
169
- attr_accessor :latitude, :longitude, :text, :duration, :expires, :username, :id, :time_utc,:expires,:created_at,:updated_at,:user_email, :gmaps
178
+ attr_accessor :latitude, :longitude, :text, :duration, :expires, :username, :id, :time_utc,:created_at,:updated_at,:user_email, :gmaps
170
179
 
171
180
 
172
181
  # Initialize a new squeak which must be in an allowable format
metadata CHANGED
@@ -1,57 +1,46 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mapsqueak
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
4
5
  prerelease:
5
- version: 0.0.3
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Ethan Stryker
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-12-17 00:00:00 +00:00
14
- default_executable:
12
+ date: 2012-01-01 00:00:00.000000000Z
15
13
  dependencies: []
16
-
17
- description: " A REST client for MapSqueak, a mobile enabled web app. \n"
14
+ description: ! " A REST client for MapSqueak, a mobile enabled web app. \n"
18
15
  email: e.stryker@gmail.com
19
16
  executables: []
20
-
21
17
  extensions: []
22
-
23
18
  extra_rdoc_files: []
24
-
25
- files:
19
+ files:
26
20
  - lib/mapsqueak.rb
27
21
  - bin/squeak.rb
28
- has_rdoc: true
29
22
  homepage: http://mapsqueak.rubyforge.org/
30
23
  licenses: []
31
-
32
24
  post_install_message:
33
25
  rdoc_options: []
34
-
35
- require_paths:
26
+ require_paths:
36
27
  - lib
37
- required_ruby_version: !ruby/object:Gem::Requirement
28
+ required_ruby_version: !ruby/object:Gem::Requirement
38
29
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: "0"
43
- required_rubygems_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
35
  none: false
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: "0"
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
49
40
  requirements: []
50
-
51
41
  rubyforge_project: mapsqueak
52
- rubygems_version: 1.6.2
42
+ rubygems_version: 1.8.6
53
43
  signing_key:
54
44
  specification_version: 3
55
45
  summary: a REST client for MapSqueak
56
46
  test_files: []
57
-