waterfall-client-rb 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +137 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +1 -0
- data/lib/waterfall/client.rb +24 -0
- data/lib/waterfall/client/thrift/waterfall_constants.rb +13 -0
- data/lib/waterfall/client/thrift/waterfall_service.rb +85 -0
- data/lib/waterfall/client/thrift/waterfall_types.rb +12 -0
- data/lib/waterfall/version.rb +4 -0
- data/waterfall-client-rb.gemspec +24 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 644c94c70dc8120926899ff86d8123af0db196db
|
4
|
+
data.tar.gz: 7c9898ed75d5c8310b9b300087e434af89bd7249
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9e78b24d79f003e80279d8fbe5c0fe25d13773dbcc852b6832ffd7e93baec258128ce953419fa660fa64df420e3da905bfc025aba9038fc873bb625a4a45c4df
|
7
|
+
data.tar.gz: 1ceb7aac213f6b98f2f6d270410886533fcd928f143976323616ffb55e66a348a96e2a7cf5a4b2abe79ff6a034a3f7200739108322afc1afc73d4d073a9f40c5
|
data/.gitignore
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
# Created by https://www.gitignore.io
|
2
|
+
|
3
|
+
### Intellij ###
|
4
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
|
5
|
+
|
6
|
+
*.iml
|
7
|
+
|
8
|
+
## Directory-based project format:
|
9
|
+
.idea/
|
10
|
+
|
11
|
+
## File-based project format:
|
12
|
+
*.ipr
|
13
|
+
*.iws
|
14
|
+
|
15
|
+
## Plugin-specific files:
|
16
|
+
|
17
|
+
# IntelliJ
|
18
|
+
/out/
|
19
|
+
|
20
|
+
# mpeltonen/sbt-idea plugin
|
21
|
+
.idea_modules/
|
22
|
+
|
23
|
+
# JIRA plugin
|
24
|
+
atlassian-ide-plugin.xml
|
25
|
+
|
26
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
27
|
+
com_crashlytics_export_strings.xml
|
28
|
+
crashlytics.properties
|
29
|
+
crashlytics-build.properties
|
30
|
+
|
31
|
+
|
32
|
+
### Ruby ###
|
33
|
+
*.gem
|
34
|
+
*.rbc
|
35
|
+
/.config
|
36
|
+
/coverage/
|
37
|
+
/InstalledFiles
|
38
|
+
/pkg/
|
39
|
+
/spec/reports/
|
40
|
+
/test/tmp/
|
41
|
+
/test/version_tmp/
|
42
|
+
/tmp/
|
43
|
+
|
44
|
+
## Specific to RubyMotion:
|
45
|
+
.dat*
|
46
|
+
.repl_history
|
47
|
+
build/
|
48
|
+
|
49
|
+
## Documentation cache and generated files:
|
50
|
+
/.yardoc/
|
51
|
+
/_yardoc/
|
52
|
+
/doc/
|
53
|
+
/rdoc/
|
54
|
+
|
55
|
+
## Environment normalisation:
|
56
|
+
/.bundle/
|
57
|
+
/vendor/bundle
|
58
|
+
/lib/bundler/man/
|
59
|
+
|
60
|
+
# for a library or gem, you might want to ignore these files since the code is
|
61
|
+
# intended to run in multiple environments; otherwise, check them in:
|
62
|
+
# Gemfile.lock
|
63
|
+
# .ruby-version
|
64
|
+
# .ruby-gemset
|
65
|
+
|
66
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
67
|
+
.rvmrc
|
68
|
+
|
69
|
+
|
70
|
+
### Windows ###
|
71
|
+
# Windows image file caches
|
72
|
+
Thumbs.db
|
73
|
+
ehthumbs.db
|
74
|
+
|
75
|
+
# Folder config file
|
76
|
+
Desktop.ini
|
77
|
+
|
78
|
+
# Recycle Bin used on file shares
|
79
|
+
$RECYCLE.BIN/
|
80
|
+
|
81
|
+
# Windows Installer files
|
82
|
+
*.cab
|
83
|
+
*.msi
|
84
|
+
*.msm
|
85
|
+
*.msp
|
86
|
+
|
87
|
+
# Windows shortcuts
|
88
|
+
*.lnk
|
89
|
+
|
90
|
+
|
91
|
+
### Linux ###
|
92
|
+
*~
|
93
|
+
|
94
|
+
# KDE directory preferences
|
95
|
+
.directory
|
96
|
+
|
97
|
+
# Linux trash folder which might appear on any partition or disk
|
98
|
+
.Trash-*
|
99
|
+
|
100
|
+
|
101
|
+
### OSX ###
|
102
|
+
.DS_Store
|
103
|
+
.AppleDouble
|
104
|
+
.LSOverride
|
105
|
+
|
106
|
+
# Icon must end with two \r
|
107
|
+
Icon
|
108
|
+
|
109
|
+
|
110
|
+
# Thumbnails
|
111
|
+
._*
|
112
|
+
|
113
|
+
# Files that might appear in the root of a volume
|
114
|
+
.DocumentRevisions-V100
|
115
|
+
.fseventsd
|
116
|
+
.Spotlight-V100
|
117
|
+
.TemporaryItems
|
118
|
+
.Trashes
|
119
|
+
.VolumeIcon.icns
|
120
|
+
|
121
|
+
# Directories potentially created on remote AFP share
|
122
|
+
.AppleDB
|
123
|
+
.AppleDesktop
|
124
|
+
Network Trash Folder
|
125
|
+
Temporary Items
|
126
|
+
.apdisk
|
127
|
+
|
128
|
+
|
129
|
+
/.bundle/
|
130
|
+
/.yardoc
|
131
|
+
/Gemfile.lock
|
132
|
+
/_yardoc/
|
133
|
+
/coverage/
|
134
|
+
/doc/
|
135
|
+
/pkg/
|
136
|
+
/spec/reports/
|
137
|
+
/tmp/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Sven Herrmann
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Waterfall::Client::Rb
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/waterfall/client/rb`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'waterfall-client-rb'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install waterfall-client-rb
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it ( https://github.com/[my-github-username]/waterfall-client-rb/fork )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'waterfall/version'
|
2
|
+
require 'waterfall/client/thrift/waterfall_service'
|
3
|
+
|
4
|
+
module Waterfall
|
5
|
+
class Client
|
6
|
+
def initialize(options = {})
|
7
|
+
settings = {host: 'localhost', port: 5290}.merge(options)
|
8
|
+
|
9
|
+
@transport = ::Thrift::FramedTransport.new(::Thrift::Socket.new(settings[:host], settings[:port]))
|
10
|
+
protocol = ::Thrift::BinaryProtocol.new(@transport)
|
11
|
+
@client = Thrift::WaterfallService::Client.new(protocol)
|
12
|
+
|
13
|
+
@transport.open
|
14
|
+
end
|
15
|
+
|
16
|
+
def next_id
|
17
|
+
@client.nextId
|
18
|
+
end
|
19
|
+
|
20
|
+
def close
|
21
|
+
@transport.close
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (0.9.2)
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'thrift'
|
8
|
+
require 'waterfall/client/thrift/waterfall_types'
|
9
|
+
|
10
|
+
module Waterfall
|
11
|
+
module Thrift
|
12
|
+
module WaterfallService
|
13
|
+
class Client
|
14
|
+
include ::Thrift::Client
|
15
|
+
|
16
|
+
def nextId()
|
17
|
+
send_nextId()
|
18
|
+
return recv_nextId()
|
19
|
+
end
|
20
|
+
|
21
|
+
def send_nextId()
|
22
|
+
send_message('nextId', NextId_args)
|
23
|
+
end
|
24
|
+
|
25
|
+
def recv_nextId()
|
26
|
+
result = receive_message(NextId_result)
|
27
|
+
return result.success unless result.success.nil?
|
28
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'nextId failed: unknown result')
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
class Processor
|
34
|
+
include ::Thrift::Processor
|
35
|
+
|
36
|
+
def process_nextId(seqid, iprot, oprot)
|
37
|
+
args = read_args(iprot, NextId_args)
|
38
|
+
result = NextId_result.new()
|
39
|
+
result.success = @handler.nextId()
|
40
|
+
write_result(result, oprot, 'nextId', seqid)
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
46
|
+
|
47
|
+
class NextId_args
|
48
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
49
|
+
|
50
|
+
FIELDS = {
|
51
|
+
|
52
|
+
}
|
53
|
+
|
54
|
+
def struct_fields;
|
55
|
+
FIELDS;
|
56
|
+
end
|
57
|
+
|
58
|
+
def validate
|
59
|
+
end
|
60
|
+
|
61
|
+
::Thrift::Struct.generate_accessors self
|
62
|
+
end
|
63
|
+
|
64
|
+
class NextId_result
|
65
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
66
|
+
SUCCESS = 0
|
67
|
+
|
68
|
+
FIELDS = {
|
69
|
+
SUCCESS => {:type => ::Thrift::Types::I64, :name => 'success'}
|
70
|
+
}
|
71
|
+
|
72
|
+
def struct_fields;
|
73
|
+
FIELDS;
|
74
|
+
end
|
75
|
+
|
76
|
+
def validate
|
77
|
+
end
|
78
|
+
|
79
|
+
::Thrift::Struct.generate_accessors self
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'waterfall/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'waterfall-client-rb'
|
8
|
+
spec.version = Waterfall::VERSION
|
9
|
+
spec.authors = ['Sven Herrmann']
|
10
|
+
spec.email = ['sven.herrmann@thatscalaguy.de']
|
11
|
+
|
12
|
+
spec.summary = %q{Client for the Waterfall id generator service.}
|
13
|
+
#spec.description = %q{TODO: Write a longer description or delete this line.}
|
14
|
+
spec.homepage = 'https://github.com/ThatScalaGuy/waterfall-client-rb'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.9'
|
22
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
23
|
+
spec.add_runtime_dependency 'thrift', '0.8.0'
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: waterfall-client-rb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sven Herrmann
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: thrift
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.8.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.8.0
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- sven.herrmann@thatscalaguy.de
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- lib/waterfall/client.rb
|
68
|
+
- lib/waterfall/client/thrift/waterfall_constants.rb
|
69
|
+
- lib/waterfall/client/thrift/waterfall_service.rb
|
70
|
+
- lib/waterfall/client/thrift/waterfall_types.rb
|
71
|
+
- lib/waterfall/version.rb
|
72
|
+
- waterfall-client-rb.gemspec
|
73
|
+
- waterfall-client-rb.iml
|
74
|
+
homepage: https://github.com/ThatScalaGuy/waterfall-client-rb
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
metadata: {}
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 2.4.5
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Client for the Waterfall id generator service.
|
98
|
+
test_files: []
|