Floppy-amee 0.4.9 → 0.4.10
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.
- data/README +14 -3
- data/lib/amee/connection.rb +7 -0
- data/lib/amee/profile.rb +4 -4
- data/lib/amee/profile_item.rb +11 -0
- data/lib/amee/version.rb +1 -1
- metadata +2 -2
data/README
CHANGED
|
@@ -20,13 +20,24 @@ Homepage: http://github.com/Floppy/amee-ruby
|
|
|
20
20
|
|
|
21
21
|
Currently, you can read DataCategories, DataItems and DataItemValues. See
|
|
22
22
|
examples/view_data_*.rb for simple usage examples. You can also get the list
|
|
23
|
-
of available Profiles and create
|
|
24
|
-
examples/create_profile.rb for details. You can also load ProfileCategories,
|
|
25
|
-
and load and
|
|
23
|
+
of available Profiles, and create and delete them. See examples/list_profiles.rb
|
|
24
|
+
and examples/create_profile.rb for details. You can also load ProfileCategories,
|
|
25
|
+
and load, create and update ProfileItems.
|
|
26
26
|
|
|
27
27
|
The gem will use the AMEE JSON API if the JSON gem is installed on the local
|
|
28
28
|
system. Otherwise the XML API will be used.
|
|
29
29
|
|
|
30
|
+
== SUPPORT
|
|
31
|
+
Create Read Update Delete
|
|
32
|
+
DataCategories N Y N N
|
|
33
|
+
DataItems N Y N N
|
|
34
|
+
DataItemValues N Y N Y
|
|
35
|
+
Profile List - Y - -
|
|
36
|
+
Profiles Y - - Y
|
|
37
|
+
ProfileCategories - Y - -
|
|
38
|
+
- drilldown - Y - -
|
|
39
|
+
ProfileItems Y Y Y Y
|
|
40
|
+
|
|
30
41
|
== INTERACTIVE SHELL
|
|
31
42
|
|
|
32
43
|
You can use the 'ameesh' app to interactively explore the AMEE data area. Run
|
data/lib/amee/connection.rb
CHANGED
|
@@ -66,6 +66,13 @@ module AMEE
|
|
|
66
66
|
do_request(put)
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
+
def delete(path)
|
|
70
|
+
# Create DELETE request
|
|
71
|
+
delete = Net::HTTP::Delete.new(path)
|
|
72
|
+
# Send request
|
|
73
|
+
do_request(delete)
|
|
74
|
+
end
|
|
75
|
+
|
|
69
76
|
def authenticate
|
|
70
77
|
unless can_authenticate?
|
|
71
78
|
raise AMEE::AuthRequired.new("Authentication required. Please provide your username and password.")
|
data/lib/amee/profile.rb
CHANGED
|
@@ -85,10 +85,10 @@ module AMEE
|
|
|
85
85
|
raise AMEE::BadData.new("Couldn't create Profile.")
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
def self.delete(connection, uid)
|
|
89
|
+
# Delete profile
|
|
90
|
+
connection.delete("/profiles/#{uid}")
|
|
91
|
+
end
|
|
92
92
|
|
|
93
93
|
end
|
|
94
94
|
end
|
data/lib/amee/profile_item.rb
CHANGED
|
@@ -99,6 +99,17 @@ module AMEE
|
|
|
99
99
|
raise AMEE::BadData.new("Couldn't create ProfileItem. Check that your information is correct.")
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
+
def update(options = {})
|
|
103
|
+
connection.put(full_path, options)
|
|
104
|
+
rescue
|
|
105
|
+
raise AMEE::BadData.new("Couldn't update ProfileItem. Check that your information is correct.")
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def value(name_or_path)
|
|
109
|
+
val = values.find{ |x| x[:name] == name_or_path || x[:path] == name_or_path}
|
|
110
|
+
val ? val[:value] : nil
|
|
111
|
+
end
|
|
112
|
+
|
|
102
113
|
end
|
|
103
114
|
end
|
|
104
115
|
end
|
data/lib/amee/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: Floppy-amee
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Smith
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-
|
|
12
|
+
date: 2008-10-01 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|