amee 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/amee/user.rb +4 -2
  2. data/lib/amee/version.rb +1 -1
  3. metadata +4 -4
data/lib/amee/user.rb CHANGED
@@ -85,11 +85,12 @@ module AMEE
85
85
  end
86
86
 
87
87
  def self.create(connection, environment_uid, options = {})
88
+ prefix = environment_uid ? "/environments/#{environment_uid}" : "/admin"
88
89
  unless options.is_a?(Hash)
89
90
  raise AMEE::ArgumentError.new("Second argument must be a hash of options!")
90
91
  end
91
92
  # Send data
92
- response = connection.post("/environments/#{environment_uid}/users", options).body
93
+ response = connection.post("#{prefix}/users", options).body
93
94
  # Parse response
94
95
  User.parse(connection, response)
95
96
  rescue
@@ -103,7 +104,8 @@ module AMEE
103
104
  end
104
105
 
105
106
  def full_path
106
- "/environments/#{@environment_uid}/users/#{uid}"
107
+ prefix = @environment_uid ? "/environments/#{@environment_uid}" : "/admin"
108
+ "#{prefix}/users/#{uid}"
107
109
  end
108
110
 
109
111
  end
data/lib/amee/version.rb CHANGED
@@ -3,7 +3,7 @@ module AMEE
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 2
5
5
  MINOR = 3
6
- TINY = 0
6
+ TINY = 1
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
9
9
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amee
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 0
10
- version: 2.3.0
9
+ - 1
10
+ version: 2.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Smith
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-23 00:00:00 +01:00
18
+ date: 2010-09-24 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency