resat 0.7.8 → 0.7.9

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.
Files changed (4) hide show
  1. data/Rakefile +34 -34
  2. data/lib/api_request.rb +5 -4
  3. data/lib/resat.rb +1 -1
  4. metadata +2 -2
data/Rakefile CHANGED
@@ -1,34 +1,34 @@
1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
- require 'lib/resat'
4
-
5
- GEM = 'resat'
6
- GEM_VER = Resat::VERSION
7
- AUTHOR = 'Raphael Simon'
8
- EMAIL = 'raphael@rightscale.com'
9
- HOMEPAGE = 'http://github.com/raphael/resat'
10
- SUMMARY = 'Web scripting for the masses'
11
-
12
- spec = Gem::Specification.new do |s|
13
- s.name = GEM
14
- s.version = GEM_VER
15
- s.author = AUTHOR
16
- s.email = EMAIL
17
- s.platform = Gem::Platform::RUBY
18
- s.summary = SUMMARY
19
- s.description = SUMMARY
20
- s.homepage = HOMEPAGE
21
- s.files = %w(LICENSE README.rdoc Rakefile) + FileList["{bin,lib,schemas,examples}/**/*"].to_a
22
- s.executables = ['resat']
23
- s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
24
- s.add_dependency("kwalify", ">= 0.7.1")
25
- end
26
-
27
- Rake::GemPackageTask.new(spec) do |pkg|
28
- pkg.gem_spec = spec
29
- end
30
-
31
- task :install => [:package] do
32
- sh %{sudo gem install pkg/#{GEM}-#{GEM_VER}}
33
- end
34
-
1
+ require 'rubygems'
2
+ require 'rake/gempackagetask'
3
+ require 'lib/resat'
4
+
5
+ GEM = 'resat'
6
+ GEM_VER = Resat::VERSION
7
+ AUTHOR = 'Raphael Simon'
8
+ EMAIL = 'raphael@rightscale.com'
9
+ HOMEPAGE = 'http://github.com/raphael/resat'
10
+ SUMMARY = 'Web scripting for the masses'
11
+
12
+ spec = Gem::Specification.new do |s|
13
+ s.name = GEM
14
+ s.version = GEM_VER
15
+ s.author = AUTHOR
16
+ s.email = EMAIL
17
+ s.platform = Gem::Platform::RUBY
18
+ s.summary = SUMMARY
19
+ s.description = SUMMARY
20
+ s.homepage = HOMEPAGE
21
+ s.files = %w(LICENSE README.rdoc Rakefile) + FileList["{bin,lib,schemas,examples}/**/*"].to_a
22
+ s.executables = ['resat']
23
+ s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
24
+ s.add_dependency("kwalify", ">= 0.7.1")
25
+ end
26
+
27
+ Rake::GemPackageTask.new(spec) do |pkg|
28
+ pkg.gem_spec = spec
29
+ end
30
+
31
+ task :install => [:package] do
32
+ sh %{sudo gem install pkg/#{GEM}-#{GEM_VER}}
33
+ end
34
+
@@ -4,6 +4,7 @@
4
4
 
5
5
  require 'uri'
6
6
  require 'rexml/document'
7
+ require 'json'
7
8
  require File.join(File.dirname(__FILE__), 'net_patch')
8
9
 
9
10
  module Resat
@@ -125,15 +126,15 @@ module Resat
125
126
  return @response[field] if target == 'header'
126
127
  return @response.body if field.nil? || field.empty?
127
128
  json = JSON.load(@response.body) rescue nil
128
- field = nil
129
+ res = nil
129
130
  if json
130
- field = json_field(json, field)
131
+ res = json_field(json, field)
131
132
  else
132
133
  doc = REXML::Document.new(@response.body)
133
134
  elem = doc.elements[field]
134
- field = elem.get_text.to_s if elem
135
+ res = elem.get_text.to_s if elem
135
136
  end
136
- field
137
+ res
137
138
  end
138
139
 
139
140
  protected
@@ -3,7 +3,7 @@
3
3
  #
4
4
 
5
5
  module Resat
6
- VERSION = '0.7.8'
6
+ VERSION = '0.7.9'
7
7
  end
8
8
 
9
9
  require File.join(File.dirname(__FILE__), 'engine')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raphael Simon
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-06-11 00:00:00 -07:00
12
+ date: 2010-06-15 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency