webservice 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gemtest +0 -0
- data/Manifest.txt +3 -0
- data/Rakefile +2 -1
- data/lib/webservice.rb +14 -0
- data/lib/webservice/builder.rb +32 -0
- data/lib/webservice/version.rb +17 -2
- data/test/helper.rb +13 -0
- data/test/test_builder.rb +31 -0
- metadata +35 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07c8ee13d83466e51e8f64a5e99b2a6888cfcfbf
|
4
|
+
data.tar.gz: 97ac77aaa41f5d2e6cc2da96eedf56113a651b56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b37abaf32931d4c68dd8156570339c7be5a5d60bab3715ed6469eea5f5d111a43a3add567baa67821ca68852d3de1c6288a759f0064a0c2e8f31ecd123842c32
|
7
|
+
data.tar.gz: ea119606858cfd41bb05e81880939a478c0d5d587b5f5b42db049c0cd126f3b3f8cb5a946baeb3ee9021b71a84304236ca41fadeb08197f1962d67847ddec3df
|
data/.gemtest
ADDED
File without changes
|
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
data/lib/webservice.rb
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
|
3
|
+
# 3rd party gems/libs
|
4
|
+
|
5
|
+
require 'logutils'
|
6
|
+
require 'textutils' # note: used for File.read_utf8 for now
|
7
|
+
|
8
|
+
|
9
|
+
# our own code
|
2
10
|
require 'webservice/version' # note: let version always go first
|
11
|
+
require 'webservice/builder'
|
12
|
+
|
13
|
+
|
14
|
+
|
3
15
|
|
16
|
+
# say hello
|
17
|
+
puts Webservice.banner
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Webservice
|
4
|
+
|
5
|
+
class Builder
|
6
|
+
|
7
|
+
def self.load_file( path)
|
8
|
+
code = File.read_utf8( path )
|
9
|
+
self.load( code )
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.load( code )
|
13
|
+
builder = Builder.new
|
14
|
+
builder.instance_eval( code )
|
15
|
+
builder
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
include LogUtils::Logging
|
20
|
+
|
21
|
+
def initialize
|
22
|
+
# to be done
|
23
|
+
end
|
24
|
+
|
25
|
+
def get( pattern, &block )
|
26
|
+
puts "add route get '#{pattern}'"
|
27
|
+
end
|
28
|
+
|
29
|
+
end # class Builder
|
30
|
+
|
31
|
+
end # module Webservice
|
32
|
+
|
data/lib/webservice/version.rb
CHANGED
@@ -1,5 +1,20 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
|
2
3
|
module Webservice
|
3
|
-
|
4
|
-
|
4
|
+
MAJOR = 0 ## todo: namespace inside version or something - why? why not??
|
5
|
+
MINOR = 1
|
6
|
+
PATCH = 0
|
7
|
+
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
5
8
|
|
9
|
+
def self.version
|
10
|
+
VERSION
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.banner
|
14
|
+
"webservice/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.root
|
18
|
+
"#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
|
19
|
+
end
|
20
|
+
end # module Webservice
|
data/test/helper.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
###
|
4
|
+
# to run use
|
5
|
+
# ruby -I ./lib -I ./test test/test_builder.rb
|
6
|
+
|
7
|
+
|
8
|
+
require 'helper'
|
9
|
+
|
10
|
+
|
11
|
+
class TestBuilder < MiniTest::Test
|
12
|
+
|
13
|
+
def test_beer_builder
|
14
|
+
builder = Webservice::Builder.load_file( "#{Webservice.root}/examples/beer.rb" )
|
15
|
+
|
16
|
+
assert true # if we get here - test success
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_football_builder
|
20
|
+
builder = Webservice::Builder.load_file( "#{Webservice.root}/examples/football.rb" )
|
21
|
+
|
22
|
+
assert true # if we get here - test success
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_world_builder
|
26
|
+
builder = Webservice::Builder.load_file( "#{Webservice.root}/examples/world.rb" )
|
27
|
+
|
28
|
+
assert true # if we get here - test success
|
29
|
+
end
|
30
|
+
|
31
|
+
end # class TestBuilder
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webservice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
@@ -10,6 +10,34 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2015-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: logutils
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: textutils
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: rdoc
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,12 +75,16 @@ extra_rdoc_files:
|
|
47
75
|
- Manifest.txt
|
48
76
|
- README.md
|
49
77
|
files:
|
78
|
+
- ".gemtest"
|
50
79
|
- HISTORY.md
|
51
80
|
- Manifest.txt
|
52
81
|
- README.md
|
53
82
|
- Rakefile
|
54
83
|
- lib/webservice.rb
|
84
|
+
- lib/webservice/builder.rb
|
55
85
|
- lib/webservice/version.rb
|
86
|
+
- test/helper.rb
|
87
|
+
- test/test_builder.rb
|
56
88
|
homepage: https://github.com/rubylibs/webservice
|
57
89
|
licenses:
|
58
90
|
- Public Domain
|
@@ -79,4 +111,5 @@ rubygems_version: 2.4.2
|
|
79
111
|
signing_key:
|
80
112
|
specification_version: 4
|
81
113
|
summary: webservice - yet another HTTP JSON API (web service) builder
|
82
|
-
test_files:
|
114
|
+
test_files:
|
115
|
+
- test/test_builder.rb
|