stark 0.9.0 → 0.9.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/History.txt +14 -0
- data/Rakefile +10 -2
- data/lib/stark.rb +1 -1
- data/lib/stark/parser.rb +8 -2
- data/stark.gemspec +9 -8
- data/test/test_stark.rb +6 -18
- metadata +17 -8
data/History.txt
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
=== 0.9.1 / 2013-08-29
|
2
|
+
|
3
|
+
* 1 bugfix:
|
4
|
+
|
5
|
+
* Exclude thrift 0.9.1 from gem dependency
|
6
|
+
|
7
|
+
=== 0.9.0 / 2013-06-11
|
8
|
+
|
9
|
+
* 3 upgrades:
|
10
|
+
|
11
|
+
* Recursive #to_hash on Structs
|
12
|
+
* Better path searching for includes in .thrift files
|
13
|
+
* Don't require final newline
|
14
|
+
|
1
15
|
=== 0.8.0 / 2013-05-22
|
2
16
|
|
3
17
|
* 9 new features:
|
data/Rakefile
CHANGED
@@ -9,11 +9,19 @@ Hoe.plugin :travis
|
|
9
9
|
Hoe.plugin :gemspec
|
10
10
|
Hoe.plugin :git
|
11
11
|
|
12
|
-
Hoe.spec 'stark' do
|
12
|
+
Hoe.spec 'stark' do |spec|
|
13
13
|
developer('Evan Phoenix', 'evan@phx.io')
|
14
14
|
|
15
|
-
|
15
|
+
# thrift 0.9.1 had an unnecessary runtime dependency on thin
|
16
|
+
version = ["~> 0.9.0", "!= 0.9.1"]
|
17
|
+
# this is to hack hoe to generate the correct gem install command
|
18
|
+
def version.to_s
|
19
|
+
self.join("' --version '")
|
20
|
+
end
|
21
|
+
dependency "thrift", version
|
16
22
|
readme_file = "README.md"
|
23
|
+
|
24
|
+
spec.testlib = :testunit if spec.respond_to?(:testlib)
|
17
25
|
end
|
18
26
|
|
19
27
|
desc 'Run kpeg to generate new parser'
|
data/lib/stark.rb
CHANGED
data/lib/stark/parser.rb
CHANGED
@@ -34,11 +34,17 @@ class Stark::Parser
|
|
34
34
|
def self.read_file(file)
|
35
35
|
@@include_path ||= Set.new([Dir.pwd])
|
36
36
|
if file.respond_to?(:read)
|
37
|
-
|
37
|
+
if file.respond_to?(:path) && file.path
|
38
|
+
@@include_path << File.dirname(File.expand_path(file.path, Dir.pwd))
|
39
|
+
end
|
38
40
|
return file.read
|
39
41
|
else
|
40
42
|
@@include_path << File.dirname(File.expand_path(file, Dir.pwd))
|
41
|
-
fn = (@@include_path.map {
|
43
|
+
fn = (@@include_path.map {|path|
|
44
|
+
File.expand_path(file, path)
|
45
|
+
}.detect { |fn|
|
46
|
+
File.exist?(fn)
|
47
|
+
}) || file
|
42
48
|
File.read fn
|
43
49
|
end
|
44
50
|
end
|
data/stark.gemspec
CHANGED
@@ -2,17 +2,18 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "stark"
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.9.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Evan Phoenix"]
|
9
|
-
s.date = "2013-
|
9
|
+
s.date = "2013-08-29"
|
10
10
|
s.description = "Optimized thrift bindings for ruby."
|
11
11
|
s.email = ["evan@phx.io"]
|
12
12
|
s.executables = ["stark"]
|
13
13
|
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.md", "examples/README.md"]
|
14
14
|
s.files = [".autotest", ".gemtest", ".travis.yml", "History.txt", "Manifest.txt", "README.md", "Rakefile", "bin/stark", "examples/README.md", "examples/client.rb", "examples/health.thrift", "examples/server.rb", "lib/stark.rb", "lib/stark/ast.rb", "lib/stark/client.rb", "lib/stark/exception.rb", "lib/stark/log_transport.rb", "lib/stark/parser.rb", "lib/stark/processor.rb", "lib/stark/protocol_helpers.rb", "lib/stark/raw_parser.rb", "lib/stark/ruby.rb", "lib/stark/struct.rb", "lib/stark/thrift.kpeg", "stark.gemspec", "test/ThriftSpec.thrift", "test/blah.thrift", "test/comments.thrift", "test/gen-rb/profile_constants.rb", "test/gen-rb/profile_types.rb", "test/gen-rb/user_storage.rb", "test/include_blah.thrift", "test/leg.rb", "test/legacy_profile/profile_constants.rb", "test/legacy_profile/profile_types.rb", "test/legacy_profile/user_storage.rb", "test/parsing_error.thrift", "test/profile.thrift", "test/properties.thrift", "test/test_client.rb", "test/test_coerce_strings.rb", "test/test_helper.rb", "test/test_marshal.rb", "test/test_parser.rb", "test/test_ruby.rb", "test/test_server.rb", "test/test_stark.rb", "test/types.thrift", "test/users.thrift"]
|
15
15
|
s.homepage = "http://github.com/evanphx/stark"
|
16
|
+
s.licenses = ["MIT"]
|
16
17
|
s.rdoc_options = ["--main", "README.md"]
|
17
18
|
s.require_paths = ["lib"]
|
18
19
|
s.rubyforge_project = "stark"
|
@@ -24,17 +25,17 @@ Gem::Specification.new do |s|
|
|
24
25
|
s.specification_version = 3
|
25
26
|
|
26
27
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_runtime_dependency(%q<thrift>, ["~> 0.9.0"])
|
28
|
+
s.add_runtime_dependency(%q<thrift>, ["!= 0.9.1", "~> 0.9.0"])
|
28
29
|
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
|
29
|
-
s.add_development_dependency(%q<hoe>, ["~> 3.
|
30
|
+
s.add_development_dependency(%q<hoe>, ["~> 3.7"])
|
30
31
|
else
|
31
|
-
s.add_dependency(%q<thrift>, ["~> 0.9.0"])
|
32
|
+
s.add_dependency(%q<thrift>, ["!= 0.9.1", "~> 0.9.0"])
|
32
33
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
33
|
-
s.add_dependency(%q<hoe>, ["~> 3.
|
34
|
+
s.add_dependency(%q<hoe>, ["~> 3.7"])
|
34
35
|
end
|
35
36
|
else
|
36
|
-
s.add_dependency(%q<thrift>, ["~> 0.9.0"])
|
37
|
+
s.add_dependency(%q<thrift>, ["!= 0.9.1", "~> 0.9.0"])
|
37
38
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
38
|
-
s.add_dependency(%q<hoe>, ["~> 3.
|
39
|
+
s.add_dependency(%q<hoe>, ["~> 3.7"])
|
39
40
|
end
|
40
41
|
end
|
data/test/test_stark.rb
CHANGED
@@ -24,52 +24,40 @@ class TestStark < Test::Unit::TestCase
|
|
24
24
|
|
25
25
|
def test_materialize_service_with_struct_list
|
26
26
|
file_path = File.join(File.dirname(__FILE__), 'properties.thrift')
|
27
|
-
|
28
|
-
Stark.materialize file_path, @m
|
29
|
-
end
|
27
|
+
Stark.materialize file_path, @m
|
30
28
|
assert @m.const_defined?(:Property)
|
31
29
|
end
|
32
30
|
|
33
31
|
def test_materialize_service_with_struct_set
|
34
32
|
file_path = File.join(File.dirname(__FILE__), 'users.thrift')
|
35
|
-
|
36
|
-
Stark.materialize file_path, @m
|
37
|
-
end
|
33
|
+
Stark.materialize file_path, @m
|
38
34
|
assert @m.const_defined?(:User)
|
39
35
|
assert @m.const_defined?(:FavoriteUsers)
|
40
36
|
end
|
41
37
|
|
42
38
|
def test_materialize_service_with_comments_and_no_ending_newline
|
43
39
|
file_path = File.join(File.dirname(__FILE__), 'comments.thrift')
|
44
|
-
|
45
|
-
Stark.materialize file_path, @m
|
46
|
-
end
|
40
|
+
Stark.materialize file_path, @m
|
47
41
|
assert @m.const_defined?(:Foo)
|
48
42
|
end
|
49
43
|
|
50
44
|
def test_materialize_service_with_throws
|
51
45
|
file_path = File.join(File.dirname(__FILE__), 'types.thrift')
|
52
|
-
|
53
|
-
Stark.materialize file_path, @m
|
54
|
-
end
|
46
|
+
Stark.materialize file_path, @m
|
55
47
|
assert @m.const_defined?(:Types)
|
56
48
|
end
|
57
49
|
|
58
50
|
def test_materialize_with_stringio
|
59
51
|
file_path = File.join(File.dirname(__FILE__), 'types.thrift')
|
60
52
|
io = StringIO.new(File.read(file_path))
|
61
|
-
|
62
|
-
Stark.materialize io, @m
|
63
|
-
end
|
53
|
+
Stark.materialize io, @m
|
64
54
|
assert @m.const_defined?(:Types)
|
65
55
|
end
|
66
56
|
|
67
57
|
def test_include_in_same_dir_not_working_dir
|
68
58
|
Dir.chdir(File.dirname(__FILE__) + '/../') do
|
69
59
|
file_path = File.join(File.dirname(__FILE__), 'include_blah.thrift')
|
70
|
-
|
71
|
-
Stark.materialize file_path, @m
|
72
|
-
end
|
60
|
+
Stark.materialize file_path, @m
|
73
61
|
end
|
74
62
|
end
|
75
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thrift
|
@@ -19,6 +19,9 @@ dependencies:
|
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 0.9.0
|
22
|
+
- - ! '!='
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.9.1
|
22
25
|
type: :runtime
|
23
26
|
prerelease: false
|
24
27
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,6 +30,9 @@ dependencies:
|
|
27
30
|
- - ~>
|
28
31
|
- !ruby/object:Gem::Version
|
29
32
|
version: 0.9.0
|
33
|
+
- - ! '!='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 0.9.1
|
30
36
|
- !ruby/object:Gem::Dependency
|
31
37
|
name: rdoc
|
32
38
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +40,7 @@ dependencies:
|
|
34
40
|
requirements:
|
35
41
|
- - ~>
|
36
42
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
43
|
+
version: '4.0'
|
38
44
|
type: :development
|
39
45
|
prerelease: false
|
40
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +48,7 @@ dependencies:
|
|
42
48
|
requirements:
|
43
49
|
- - ~>
|
44
50
|
- !ruby/object:Gem::Version
|
45
|
-
version: '
|
51
|
+
version: '4.0'
|
46
52
|
- !ruby/object:Gem::Dependency
|
47
53
|
name: hoe
|
48
54
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +56,7 @@ dependencies:
|
|
50
56
|
requirements:
|
51
57
|
- - ~>
|
52
58
|
- !ruby/object:Gem::Version
|
53
|
-
version: '3.
|
59
|
+
version: '3.7'
|
54
60
|
type: :development
|
55
61
|
prerelease: false
|
56
62
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +64,7 @@ dependencies:
|
|
58
64
|
requirements:
|
59
65
|
- - ~>
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
67
|
+
version: '3.7'
|
62
68
|
description: Optimized thrift bindings for ruby.
|
63
69
|
email:
|
64
70
|
- evan@phx.io
|
@@ -68,6 +74,8 @@ extensions: []
|
|
68
74
|
extra_rdoc_files:
|
69
75
|
- History.txt
|
70
76
|
- Manifest.txt
|
77
|
+
- README.md
|
78
|
+
- examples/README.md
|
71
79
|
files:
|
72
80
|
- .autotest
|
73
81
|
- .gemtest
|
@@ -119,7 +127,8 @@ files:
|
|
119
127
|
- test/types.thrift
|
120
128
|
- test/users.thrift
|
121
129
|
homepage: http://github.com/evanphx/stark
|
122
|
-
licenses:
|
130
|
+
licenses:
|
131
|
+
- MIT
|
123
132
|
post_install_message:
|
124
133
|
rdoc_options:
|
125
134
|
- --main
|
@@ -140,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
149
|
version: '0'
|
141
150
|
requirements: []
|
142
151
|
rubyforge_project: stark
|
143
|
-
rubygems_version: 1.8.
|
152
|
+
rubygems_version: 1.8.23
|
144
153
|
signing_key:
|
145
154
|
specification_version: 3
|
146
155
|
summary: Optimized thrift bindings for ruby.
|