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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88c751e5a5c99d804e7394b5a4175309671ab949
4
- data.tar.gz: 39bb7152bef226bab7de349ee30a4a9f60b2558e
3
+ metadata.gz: 07c8ee13d83466e51e8f64a5e99b2a6888cfcfbf
4
+ data.tar.gz: 97ac77aaa41f5d2e6cc2da96eedf56113a651b56
5
5
  SHA512:
6
- metadata.gz: fe8c6f96992e6ca6b07817f86a841ae025e4c5be7d336af363018fa4b1f8582ff3f661d22c9c00f6a93edf6061036ada5f639145039931c39bebd184dd9ed58c
7
- data.tar.gz: 40c4bfb076950fe27b4ac3f70a46054e2125d28e3cebf5ac609bccb44c22b9d33cf771e8436bc41ecc19ae156633d6592d7fd3578443c526196e77f48832fed7
6
+ metadata.gz: b37abaf32931d4c68dd8156570339c7be5a5d60bab3715ed6469eea5f5d111a43a3add567baa67821ca68852d3de1c6288a759f0064a0c2e8f31ecd123842c32
7
+ data.tar.gz: ea119606858cfd41bb05e81880939a478c0d5d587b5f5b42db049c0cd126f3b3f8cb5a946baeb3ee9021b71a84304236ca41fadeb08197f1962d67847ddec3df
data/.gemtest ADDED
File without changes
data/Manifest.txt CHANGED
@@ -3,4 +3,7 @@ Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
5
  lib/webservice.rb
6
+ lib/webservice/builder.rb
6
7
  lib/webservice/version.rb
8
+ test/helper.rb
9
+ test/test_builder.rb
data/Rakefile CHANGED
@@ -18,7 +18,8 @@ Hoe.spec 'webservice' do
18
18
  self.history_file = 'HISTORY.md'
19
19
 
20
20
  self.extra_deps = [
21
- ## ['logutils' ]
21
+ ['logutils' ],
22
+ ['textutils' ] # note: use for File.read_utf8
22
23
  ]
23
24
 
24
25
  self.licenses = ['Public Domain']
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
+
@@ -1,5 +1,20 @@
1
+ # encoding: utf-8
1
2
 
2
3
  module Webservice
3
- VERSION = '0.0.1'
4
- end
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,13 @@
1
+
2
+ ## minitest setup
3
+ require 'minitest/autorun'
4
+
5
+ ## deps
6
+
7
+ ### require 'worlddb'
8
+ ## require 'sportdb/models' # note: will include worlddb
9
+
10
+
11
+ ## our own code
12
+ require 'webservice'
13
+
@@ -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.1
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