cache_server 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4c0013672dec61625df84b75a2f30956b3b166bf224d542e88da29cb5709816b
4
+ data.tar.gz: 62e0aa9cdabf786c0b313422f40ec2dfeac377ebb3ab35dc3493caea8b6c114a
5
+ SHA512:
6
+ metadata.gz: e1cb33d5bce914060d6f42bece5102ec531a9fc18faff1105048c7374220a78afb4c3ec5d448ca7309380abd9c67bec67852afc35353997e0b96e47da861a180
7
+ data.tar.gz: 66fcc79ba314df612d0785906a2a22e429a407c38400b0e7fefc9295147790062959274e043f0a78d573cce2f50df2fbdef7dadad8d9b2904f417e0c72440989
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "sinatra", "~> 2.0.8"
4
+ gem "r_cache", "~> 0.1.0.1"
5
+
6
+ # Specify your gem's dependencies in cache_server.gemspec
7
+ gemspec
@@ -0,0 +1,39 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cache_server (0.1.0)
5
+ r_cache (~> 0.1.0)
6
+ sinatra (~> 2.0.8)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ mustermann (1.1.1)
12
+ ruby2_keywords (~> 0.0.1)
13
+ r_cache (0.1.0.1)
14
+ redis
15
+ rack (2.2.2)
16
+ rack-protection (2.0.8.1)
17
+ rack
18
+ rake (10.5.0)
19
+ redis (4.2.0)
20
+ ruby2_keywords (0.0.2)
21
+ sinatra (2.0.8.1)
22
+ mustermann (~> 1.0)
23
+ rack (~> 2.0)
24
+ rack-protection (= 2.0.8.1)
25
+ tilt (~> 2.0)
26
+ tilt (2.0.10)
27
+
28
+ PLATFORMS
29
+ ruby
30
+
31
+ DEPENDENCIES
32
+ bundler (~> 2.0)
33
+ cache_server!
34
+ r_cache (~> 0.1.0.1)
35
+ rake (~> 10.0)
36
+ sinatra (~> 2.0.8)
37
+
38
+ BUNDLED WITH
39
+ 2.0.2
@@ -0,0 +1,35 @@
1
+ # CacheServer
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/cache_server`. 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 'cache_server'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install cache_server
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. You can also 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`, which will 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
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cache_server.
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cache_server"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/run ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cache_server"
5
+
6
+
7
+
8
+
9
+
10
+ # @r = @c.get 'obj'
11
+ # puts @c.expired? @r['expiry']
12
+ # sleep 3
13
+ # puts @c.expired? @r['expiry']
14
+ # @r = @c.get 'obj'
15
+ # puts @c.expired? @r['expiry']
16
+
17
+ # puts @r
18
+
19
+ CacheServer::Server.instance_eval do
20
+
21
+
22
+ get '/' do
23
+ RCache.config.setKey :ttl, 3
24
+
25
+ c = RCache::Cache.new
26
+ c.updater = ->(name) {
27
+ n_obj = {"cond1"=>12, "cond2"=>37, "exchange"=>4, "price"=>352.89, "size"=>1, "timestamp"=>1591824674720}
28
+ n_obj
29
+ }
30
+ r = c.get 'obj'
31
+
32
+ content_type :json
33
+ r.to_json
34
+ end
35
+ end
36
+
37
+ CacheServer::Server.run!
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,36 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "cache_server/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "cache_server"
7
+ spec.version = CacheServer::VERSION
8
+ spec.authors = ["iodevel"]
9
+ spec.email = ["cbrandt92@gmail.com"]
10
+
11
+ spec.summary = '...'
12
+ spec.description = '...'
13
+ # spec.homepage = "TODO: Put your gem's website or public repo URL here."
14
+
15
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
16
+
17
+ # spec.metadata["homepage_uri"] = spec.homepage
18
+ # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
19
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 2.0"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_runtime_dependency "sinatra", "~> 2.0.8"
33
+ spec.add_runtime_dependency "r_cache", "~> 0.1.0"
34
+
35
+
36
+ end
@@ -0,0 +1,13 @@
1
+ require "cache_server/version"
2
+ require 'sinatra'
3
+ require 'r_cache'
4
+
5
+ module CacheServer
6
+ class Error < StandardError; end
7
+ # Your code goes here...
8
+
9
+ class Server < Sinatra::Base
10
+
11
+ end
12
+ end
13
+
@@ -0,0 +1,3 @@
1
+ module CacheServer
2
+ VERSION = "0.1.0"
3
+ end
data/s ADDED
@@ -0,0 +1,5 @@
1
+ require 'sinatra';
2
+
3
+ get '/' do
4
+ 'what the hell?'
5
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cache_server
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - iodevel
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-06-11 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: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
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: sinatra
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 2.0.8
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.0.8
55
+ - !ruby/object:Gem::Dependency
56
+ name: r_cache
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.1.0
69
+ description: "..."
70
+ email:
71
+ - cbrandt92@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - Gemfile.lock
79
+ - README.md
80
+ - Rakefile
81
+ - bin/console
82
+ - bin/run
83
+ - bin/setup
84
+ - cache_server.gemspec
85
+ - lib/cache_server.rb
86
+ - lib/cache_server/version.rb
87
+ - s
88
+ homepage:
89
+ licenses: []
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubygems_version: 3.0.3
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: "..."
110
+ test_files: []