attsynaptic-synaptic4r 0.1.4 → 0.1.5

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/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ *.gem
1
2
  *~
2
3
  *.sw?
3
4
  .DS_Store
@@ -6,6 +6,15 @@ a reference for the REST API.
6
6
 
7
7
  == Install
8
8
 
9
+ The synptic4r gem is in the gemcutter.org repository. If gemcutter.org is not in your gem sources
10
+ issue the following command only one time,
11
+
12
+ sudo gem source -a http://gemcutter.org
13
+
14
+ and install synaptic4r
15
+
16
+ sudo gem install synaptic4r
17
+
9
18
  == Credentials
10
19
 
11
20
  Save credentials to $HOME/.synaptic4r
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -264,7 +264,14 @@ module Synaptic4r
264
264
  :http_method => :delete,
265
265
  :required => [[:rpath, :oid]],
266
266
  :optional => [:lifetime],
267
- :diagnostics => false
267
+ :diagnostics => false,
268
+ :map_required_args => lambda {|vals|
269
+ pvals = vals.select{|v| /^-o/.match(v) or not /^-/.match(v)}
270
+ if pvals.empty?
271
+ {:pvals => [''], :dlen => 1}
272
+ else
273
+ {:pvals => pvals, :dlen => 0}
274
+ end}
268
275
 
269
276
  #.......................................................................................................
270
277
  # other requests
@@ -274,9 +281,9 @@ module Synaptic4r
274
281
  exp = (args[:lifetime].nil? ? 5 : args[:lifetime].to_i)*60 + Time.now.to_i
275
282
  res = /.*(\/rest.*)/.match(url).captures.first
276
283
  user = headers['x-emc-uid']
277
- @sign = "GET\n#{res}\n#{user}\n#{exp}"
284
+ @sign = "GET\n" + "#{res}\n#{user}\n#{exp}".downcase
278
285
  digest = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), Base64.decode64(key), sign)
279
- signature = Base64.encode64(digest.to_s()).chomp()
286
+ signature = Base64.encode64(digest.to_s())
280
287
  @url = "#{url}?uid=#{URI.encode(user, esc)}&expires=#{exp}&signature=#{URI.encode(signature, esc)}"
281
288
  end
282
289
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{synaptic4r}
5
- s.version = "0.1.4"
5
+ s.version = "0.1.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["troystribling-att"]
9
- s.date = %q{2009-08-24}
9
+ s.date = %q{2009-08-26}
10
10
  s.default_executable = %q{synrest}
11
11
  s.email = %q{troy.stribling@usi.com}
12
12
  s.executables = ["synrest"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attsynaptic-synaptic4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - troystribling-att
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-24 00:00:00 -07:00
12
+ date: 2009-08-26 00:00:00 -07:00
13
13
  default_executable: synrest
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency