hotwire 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/hotwire.gemspec +4 -4
- data/lib/hotwire/response/base.rb +1 -1
- data/lib/hotwire/response/json.rb +2 -2
- data/test/response/test_json.rb +22 -1
- metadata +6 -6
data/Rakefile
CHANGED
@@ -8,8 +8,8 @@ begin
|
|
8
8
|
gem.summary = %Q{Under the hood data transformations for the Google Wire protocol. }
|
9
9
|
gem.description = %Q{Hotwire is designed to ease the pain of creating Google Wire protocol compatible data source in Ruby.}
|
10
10
|
gem.email = "les@codebenders.com"
|
11
|
-
gem.homepage = "http://github.com/
|
12
|
-
gem.authors = ["Les
|
11
|
+
gem.homepage = "http://github.com/leskiger/hotwire"
|
12
|
+
gem.authors = ["Les Kiger"]
|
13
13
|
# gem.add_dependency "activesupport", ">= 0"
|
14
14
|
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
15
15
|
gem.add_development_dependency "redgreen", ">= 0"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/hotwire.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{hotwire}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Les
|
12
|
-
s.date = %q{2010-
|
11
|
+
s.authors = ["Les Kiger"]
|
12
|
+
s.date = %q{2010-12-09}
|
13
13
|
s.description = %q{Hotwire is designed to ease the pain of creating Google Wire protocol compatible data source in Ruby.}
|
14
14
|
s.email = %q{les@codebenders.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
|
|
46
46
|
"test/test_request.rb",
|
47
47
|
"test/test_response.rb"
|
48
48
|
]
|
49
|
-
s.homepage = %q{http://github.com/
|
49
|
+
s.homepage = %q{http://github.com/leskiger/hotwire}
|
50
50
|
s.rdoc_options = ["--charset=UTF-8"]
|
51
51
|
s.require_paths = ["lib"]
|
52
52
|
s.rubygems_version = %q{1.3.7}
|
@@ -39,7 +39,7 @@ module Hotwire
|
|
39
39
|
# add_columns(['string', {:id => 'Column A'}], ['number', {:id => 'Column B'}])
|
40
40
|
#
|
41
41
|
# or a sample row of data, represented as a hash keyed as column_name => value:
|
42
|
-
# add_columns({
|
42
|
+
# add_columns({'column_a' => 'a1', 'column_b' => 'b1})
|
43
43
|
# column_name keys are expected to be strings.
|
44
44
|
def add_columns(columns)
|
45
45
|
if columns.first.is_a?(Hash)
|
@@ -74,7 +74,7 @@ module Hotwire
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def to_json(options=nil)
|
77
|
-
"new Date(#{@date.year}, #{@date.month-1}, #{@date.day})"
|
77
|
+
@date.nil? ? "" : "new Date(#{@date.year}, #{@date.month-1}, #{@date.day})"
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -86,7 +86,7 @@ module Hotwire
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def to_json(options=nil)
|
89
|
-
"new Date(#{@datetime.year}, #{@datetime.month-1}, #{@datetime.day}, #{@datetime.hour}, #{@datetime.min}, #{@datetime.sec})"
|
89
|
+
@datetime.nil? ? "" : "new Date(#{@datetime.year}, #{@datetime.month-1}, #{@datetime.day}, #{@datetime.hour}, #{@datetime.min}, #{@datetime.sec})"
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
data/test/response/test_json.rb
CHANGED
@@ -22,9 +22,30 @@ class TestResponseJson < Test::Unit::TestCase
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "a Hotwire::Response::Json::DateTime instance" do
|
29
|
+
context "created with ni" do
|
30
|
+
setup do
|
31
|
+
@datetime = Hotwire::Response::Json::DateTime.new(nil)
|
32
|
+
end
|
25
33
|
|
34
|
+
should "return a blank string" do
|
35
|
+
assert_equal "", @datetime.to_json
|
36
|
+
end
|
26
37
|
end
|
27
|
-
|
28
38
|
end
|
29
39
|
|
40
|
+
context "a Hotwire::Response::Json::Date instance" do
|
41
|
+
context "created with ni" do
|
42
|
+
setup do
|
43
|
+
@date = Hotwire::Response::Json::Date.new(nil)
|
44
|
+
end
|
45
|
+
|
46
|
+
should "return a blank string" do
|
47
|
+
assert_equal "", @date.to_json
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
30
51
|
end
|
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotwire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
- Les
|
13
|
+
- Les Kiger
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-09 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -99,7 +99,7 @@ files:
|
|
99
99
|
- test/test_request.rb
|
100
100
|
- test/test_response.rb
|
101
101
|
has_rdoc: true
|
102
|
-
homepage: http://github.com/
|
102
|
+
homepage: http://github.com/leskiger/hotwire
|
103
103
|
licenses: []
|
104
104
|
|
105
105
|
post_install_message:
|