Floppy-amee 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +19 -0
- data/examples/view_data_item.rb +37 -0
- data/lib/amee/exceptions.rb +18 -0
- data/lib/amee.rb +1 -1
- metadata +4 -1
data/COPYING
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2008 James Smith (james@floppy.org.uk)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'amee'
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
# Command-line options - get username, password, and server
|
6
|
+
options = {}
|
7
|
+
OptionParser.new do |opts|
|
8
|
+
opts.on("-u", "--username USERNAME", "AMEE username") do |u|
|
9
|
+
options[:username] = u
|
10
|
+
end
|
11
|
+
opts.on("-p", "--password PASSWORD", "AMEE password") do |p|
|
12
|
+
options[:password] = p
|
13
|
+
end
|
14
|
+
opts.on("-s", "--server SERVER", "AMEE server") do |s|
|
15
|
+
options[:server] = s
|
16
|
+
end
|
17
|
+
end.parse!
|
18
|
+
|
19
|
+
# Connect
|
20
|
+
connection = AMEE::Connection.new(options[:server], options[:username], options[:password])
|
21
|
+
|
22
|
+
# For each path in arg list, show details
|
23
|
+
ARGV.each do |path|
|
24
|
+
cat = AMEE::Data::Item.get(connection, path)
|
25
|
+
puts "---------------------"
|
26
|
+
puts "Name: #{cat.name}"
|
27
|
+
puts "Path: #{cat.full_path}"
|
28
|
+
puts "Label: #{cat.label}"
|
29
|
+
puts "UID: #{cat.uid}"
|
30
|
+
puts "Values:"
|
31
|
+
cat.values.each do |v|
|
32
|
+
puts " - #{v[:name]}: #{v[:value]}"
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
|
data/lib/amee.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.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
@@ -23,13 +23,16 @@ extra_rdoc_files: []
|
|
23
23
|
|
24
24
|
files:
|
25
25
|
- README
|
26
|
+
- COPYING
|
26
27
|
- lib/amee.rb
|
27
28
|
- lib/amee/connection.rb
|
28
29
|
- lib/amee/data_category.rb
|
29
30
|
- lib/amee/data_item.rb
|
30
31
|
- lib/amee/data_item_value.rb
|
32
|
+
- lib/amee/exceptions.rb
|
31
33
|
- lib/amee/object.rb
|
32
34
|
- examples/view_data_category.rb
|
35
|
+
- examples/view_data_item.rb
|
33
36
|
has_rdoc: false
|
34
37
|
homepage: http://github.com/Floppy/amee-ruby
|
35
38
|
post_install_message:
|