yaframework 0.4.1 → 0.4.2

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
  SHA256:
3
- metadata.gz: 23a8af14273443627664b65feb652bc03336d5fbe829f672cae4ef9c8ca4604e
4
- data.tar.gz: 848d0e46585695fe4756bf91b6c286b9cacb4ec684a535491e7a348f4a2c081a
3
+ metadata.gz: e8009597e2e41965f0ad078918d629c4b88eaf2536d9c001053079cdfd24705a
4
+ data.tar.gz: 44386071847fd8a44299d967a8d8605b615a3fc865afd21a4f555410c10b3cba
5
5
  SHA512:
6
- metadata.gz: 35fa5d015af06f258f7b7fff290a14a3f60329aeb2e713b4cad172f86b55bde28a01d371a114ed89b77a48862146d78c53721fa21bcd86beaa155c0cec7a13f8
7
- data.tar.gz: 47a8a7be5c253fb3a1bf788c6256613f85c9132725a328e456b8e7e27f82da322f5f2ff5691e8267dd3fce9139d0db13fcab6ca71e424436bdf1a1b165a88b3b
6
+ metadata.gz: 505e79eee033484f4ecd2eb08daca91521e2d93f5b780051fe82968d9a5510b0ac5152d4cc61aee77827e85d1e40d053451881e623e9f0f713fc1e0f0e03b1fa
7
+ data.tar.gz: 842210c79e38f9c984018c38377f704d235bd4f795ce3753cd89fdcddceb9c2d93db654c94d68dec23a4de818ade9719a08d382f5b6abb4fed5d29b5259cf8a1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.4.2] - 2021-07-24
2
+
3
+ - DB module removed
4
+
1
5
  ## [0.4.1] - 2021-07-24
2
6
 
3
7
  - A little fix. Fixed an error with the wrong order of declaring variables (lol)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yaframework (0.4.0)
4
+ yaframework (0.4.1)
5
5
  rack (~> 2.2)
6
6
 
7
7
  GEM
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "yaframework"
@@ -0,0 +1,12 @@
1
+ # Params
2
+
3
+ Shows how to use halts and redirects
4
+
5
+ ## Installation
6
+
7
+ Clone this repo and go to this folder.
8
+ Then, run `bundle install` to install this gem.
9
+
10
+ ## Run
11
+
12
+ Run with `ruby app.rb` or `rackup` and view at http://localhost:4567
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yaframework"
4
+ app = Yaframework::Application
5
+
6
+ app.get "/" do
7
+ response.redirect "/hello"
8
+ end
9
+
10
+ app.get "/hello" do
11
+ "Hello world!"
12
+ end
13
+
14
+ app.get "/error" do
15
+ response.status = 401
16
+ halt response.finish
17
+ end
18
+
19
+ app.listen(4567)
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yaframework"
4
+ require "./app"
5
+
6
+ run app
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../../lib/yaframework"
3
+ require "yaframework"
4
4
  app = Yaframework::Application
5
5
 
6
6
  app.get "/" do
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "yaframework"
@@ -0,0 +1,12 @@
1
+ # Params
2
+
3
+ Shows how the application parameters can be used
4
+
5
+ ## Installation
6
+
7
+ Clone this repo and go to this folder.
8
+ Then, run `bundle install` to install this gem.
9
+
10
+ ## Run
11
+
12
+ Run with `ruby app.rb` or `rackup` and view at http://localhost:4567
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yaframework"
4
+ app = Yaframework::Application
5
+
6
+ app.get "/:name" do
7
+ "Hello #{request.params[:name]}!"
8
+ end
9
+
10
+ app.get "/:name/foo/:bar" do
11
+ "Hello #{request.params[:name]} from #{request.params[:bar]}!"
12
+ end
13
+
14
+ app.listen(4567)
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yaframework"
4
+ require "./app"
5
+
6
+ run app
data/lib/yaframework.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  require_relative "yaframework/base"
4
4
  require_relative "yaframework/request"
5
5
  require_relative "yaframework/response"
6
- require_relative "yaframework/database"
7
6
 
8
7
  module Yaframework
9
8
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yaframework
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
data/yaframework.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.bindir = "exe"
29
29
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
30
 
31
- spec.add_development_dependency "bundler", "~> 2.1.4"
31
+ spec.add_development_dependency "bundler", ">= 2.2.10"
32
32
  spec.add_development_dependency "rake", "~> 13.0"
33
33
  spec.add_development_dependency "rubocop", "~> 1.7"
34
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaframework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxbarsukov
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.4
19
+ version: 2.2.10
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.4
26
+ version: 2.2.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,13 +86,20 @@ files:
86
86
  - bin/console
87
87
  - bin/setup
88
88
  - examples/README.md
89
+ - examples/halts-and-redirects/Gemfile
90
+ - examples/halts-and-redirects/README.md
91
+ - examples/halts-and-redirects/app.rb
92
+ - examples/halts-and-redirects/config.ru
89
93
  - examples/hello-world/Gemfile
90
94
  - examples/hello-world/README.md
91
95
  - examples/hello-world/app.rb
92
96
  - examples/hello-world/config.ru
97
+ - examples/params/Gemfile
98
+ - examples/params/README.md
99
+ - examples/params/app.rb
100
+ - examples/params/config.ru
93
101
  - lib/yaframework.rb
94
102
  - lib/yaframework/base.rb
95
- - lib/yaframework/database.rb
96
103
  - lib/yaframework/request.rb
97
104
  - lib/yaframework/response.rb
98
105
  - lib/yaframework/version.rb
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "pg"
4
-
5
- class Database
6
- def self.connect(db_name)
7
- pg_conn = PG.connect(dbname: db_name)
8
- new(pg_conn)
9
- end
10
-
11
- def initialize(pg_conn)
12
- @pg_conn = pg_conn
13
- end
14
-
15
- def exec(sql)
16
- @pg_conn.exec(sql).to_a
17
- end
18
- end