my_zeo 0.2.0 → 0.2.1
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/lib/hash_symbolize_keys.rb +22 -0
- data/lib/my_zeo.rb +2 -1
- metadata +6 -10
- data/.document +0 -5
- data/.gitignore +0 -21
- data/Rakefile +0 -54
- data/VERSION +0 -1
- data/my_zeo.gemspec +0 -57
@@ -0,0 +1,22 @@
|
|
1
|
+
module HashSymbolizeKeys
|
2
|
+
def symbolize_keys!
|
3
|
+
if defined? super
|
4
|
+
super
|
5
|
+
else
|
6
|
+
keys.each do |key|
|
7
|
+
self[(key.to_sym rescue key)] = delete(key) if key.respond_to?(:to_sym) && !key.is_a?(Fixnum)
|
8
|
+
end
|
9
|
+
self
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def recursive_symbolize_keys!
|
14
|
+
symbolize_keys!
|
15
|
+
values.select { |v| v.is_a?(Hash) }.each { |h| h.recursive_symbolize_keys! }
|
16
|
+
self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class Hash
|
21
|
+
include HashSymbolizeKeys
|
22
|
+
end
|
data/lib/my_zeo.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
class MyZeo
|
2
|
+
require 'hash_symbolize_keys'
|
2
3
|
require 'httparty'
|
3
4
|
include HTTParty
|
4
5
|
|
@@ -13,7 +14,7 @@ class MyZeo
|
|
13
14
|
end
|
14
15
|
|
15
16
|
def get_overall_average_zq_score
|
16
|
-
MyZeo.get("/getOverallAverageZQScore?key=#{@api_key}").parsed_response
|
17
|
+
MyZeo.get("/getOverallAverageZQScore?key=#{@api_key}").parsed_response.recursive_symbolize_keys!
|
17
18
|
end
|
18
19
|
|
19
20
|
def get_overall_average_day_feel_score
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_zeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Haris Amin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-14 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -56,14 +56,10 @@ extra_rdoc_files:
|
|
56
56
|
- LICENSE
|
57
57
|
- README.rdoc
|
58
58
|
files:
|
59
|
-
- .
|
60
|
-
- .
|
59
|
+
- lib/hash_symbolize_keys.rb
|
60
|
+
- lib/my_zeo.rb
|
61
61
|
- LICENSE
|
62
62
|
- README.rdoc
|
63
|
-
- Rakefile
|
64
|
-
- VERSION
|
65
|
-
- lib/my_zeo.rb
|
66
|
-
- my_zeo.gemspec
|
67
63
|
- test/helper.rb
|
68
64
|
- test/test_my_zeo.rb
|
69
65
|
has_rdoc: true
|
data/.document
DELETED
data/.gitignore
DELETED
data/Rakefile
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "my_zeo"
|
8
|
-
gem.summary = %Q{A simple mapping to MyZeo API calls (http://mysleep.myzeo.com/api/api.shtml)}
|
9
|
-
gem.description = %Q{A simple mapping to MyZeo API calls (http://mysleep.myzeo.com/api/api.shtml)}
|
10
|
-
gem.email = "aminharis7@gmail.com"
|
11
|
-
gem.homepage = "http://github.com/hamin/my_zeo"
|
12
|
-
gem.authors = ["Haris Amin"]
|
13
|
-
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
-
gem.add_dependency 'httparty'
|
15
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
-
end
|
17
|
-
Jeweler::GemcutterTasks.new
|
18
|
-
rescue LoadError
|
19
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
-
end
|
21
|
-
|
22
|
-
require 'rake/testtask'
|
23
|
-
Rake::TestTask.new(:test) do |test|
|
24
|
-
test.libs << 'lib' << 'test'
|
25
|
-
test.pattern = 'test/**/test_*.rb'
|
26
|
-
test.verbose = true
|
27
|
-
end
|
28
|
-
|
29
|
-
begin
|
30
|
-
require 'rcov/rcovtask'
|
31
|
-
Rcov::RcovTask.new do |test|
|
32
|
-
test.libs << 'test'
|
33
|
-
test.pattern = 'test/**/test_*.rb'
|
34
|
-
test.verbose = true
|
35
|
-
end
|
36
|
-
rescue LoadError
|
37
|
-
task :rcov do
|
38
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
task :test => :check_dependencies
|
43
|
-
|
44
|
-
task :default => :test
|
45
|
-
|
46
|
-
require 'rake/rdoctask'
|
47
|
-
Rake::RDocTask.new do |rdoc|
|
48
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
-
|
50
|
-
rdoc.rdoc_dir = 'rdoc'
|
51
|
-
rdoc.title = "my_zeo #{version}"
|
52
|
-
rdoc.rdoc_files.include('README*')
|
53
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
-
end
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.0
|
data/my_zeo.gemspec
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{my_zeo}
|
8
|
-
s.version = "0.2.0"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Haris Amin"]
|
12
|
-
s.date = %q{2010-11-13}
|
13
|
-
s.description = %q{A simple mapping to MyZeo API calls (http://mysleep.myzeo.com/api/api.shtml)}
|
14
|
-
s.email = %q{aminharis7@gmail.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"lib/my_zeo.rb",
|
27
|
-
"my_zeo.gemspec",
|
28
|
-
"test/helper.rb",
|
29
|
-
"test/test_my_zeo.rb"
|
30
|
-
]
|
31
|
-
s.homepage = %q{http://github.com/hamin/my_zeo}
|
32
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
33
|
-
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = %q{1.3.7}
|
35
|
-
s.summary = %q{A simple mapping to MyZeo API calls (http://mysleep.myzeo.com/api/api.shtml)}
|
36
|
-
s.test_files = [
|
37
|
-
"test/helper.rb",
|
38
|
-
"test/test_my_zeo.rb"
|
39
|
-
]
|
40
|
-
|
41
|
-
if s.respond_to? :specification_version then
|
42
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
-
s.specification_version = 3
|
44
|
-
|
45
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
|
-
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
47
|
-
s.add_runtime_dependency(%q<httparty>, [">= 0"])
|
48
|
-
else
|
49
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
50
|
-
s.add_dependency(%q<httparty>, [">= 0"])
|
51
|
-
end
|
52
|
-
else
|
53
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
54
|
-
s.add_dependency(%q<httparty>, [">= 0"])
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|