makanai 0.1.6 → 0.1.7

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: 8c7b32701bd75c6ea7cae7f893310a50e5e70a9fea7c14e9a99ba9559b2e7a39
4
- data.tar.gz: 8890f0956507a1d0bfa92197718f40b4ed7da313737fe4501032565154f68e08
3
+ metadata.gz: e74d48c4c10a817b2dfad39c4aafb057a660152d27f9edd66cbfbb9293688749
4
+ data.tar.gz: 67ea0e86c3b9ad4228e623628f81b70bb2c6ff40de415790a1a8812180d6c002
5
5
  SHA512:
6
- metadata.gz: 268af34e32c0cfd48753227a04bf604f6b1fe3fae0a2ef4bb709965c8d6ac73ec3b78a6c6813a2576c33e69e9c00506d60ef1edecd8fd4046bdb013f96081574
7
- data.tar.gz: d112687c6207e860f5c0513f2530c26c0d388472d3058aae069dc98771c7e637636ef61dfb2300727fa7952c8d03d018d3649b7d086a3b395d98a4c33bb2e8eb
6
+ metadata.gz: 99c175dffd8df4f05d1d371ac6eb2e2ba58bc4a90937606dc3c174c910642519da29fc8dcaa0a14e29a1b8b737e1fedfbacc8c6eff0d7bf8fad773ba5e891cb1
7
+ data.tar.gz: 44e7b1185134b873bda34309925422a46838e616641575dc03700cf8a8194d8cb393adf7fe22d33d823bc76df9be4bcbba22b4d6a8b1c3fe281848c956fbc706
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.7.0
2
+ TargetRubyVersion: 3.0.0
3
3
  NewCops: enable
4
4
  Exclude:
5
5
  - './makanai.gemspec'
@@ -1 +1 @@
1
- 2.7.1
1
+ 3.0.0
@@ -6,12 +6,13 @@ services:
6
6
  - mysql
7
7
  rvm:
8
8
  - 2.6.6
9
- - 2.7.1
9
+ - 2.7.2
10
+ - 3.0.0
10
11
  - ruby-head
11
12
  os:
12
13
  - linux
13
14
  before_install:
14
- - gem install bundler -v 2.1.4
15
+ - gem install bundler -v 2.2.3
15
16
  - mysql -e 'CREATE DATABASE IF NOT EXISTS makanai;'
16
17
  before_script:
17
18
  - psql -c "create user makanai WITH PASSWORD 'password';" -U postgres
@@ -46,3 +46,8 @@
46
46
 
47
47
  * :zap: remove sqlite3 from runtime_dependency.
48
48
  https://github.com/Madogiwa0124/makanai/commit/d63c3b12cf6fc412a8d88806dca9710e210e5fe0
49
+
50
+ ## :gift: 2021/01/05 `v.1.7` released.
51
+ * :package: dependency update.
52
+ * :gem: supported ruby `3.0.0`.
53
+ https://github.com/Madogiwa0124/makanai/pull/82
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- makanai (0.1.6)
4
+ makanai (0.1.7)
5
5
  rack (>= 2.0.7, < 2.3.0)
6
6
  rake (>= 10, < 14)
7
7
 
@@ -9,60 +9,61 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  ast (2.4.1)
12
- codecov (0.2.3)
13
- colorize
12
+ codecov (0.2.12)
14
13
  json
15
14
  simplecov
16
- colorize (0.8.1)
17
- diff-lcs (1.3)
18
- docile (1.3.2)
19
- haml (5.1.2)
15
+ diff-lcs (1.4.4)
16
+ docile (1.3.4)
17
+ haml (5.2.1)
20
18
  temple (>= 0.8.0)
21
19
  tilt
22
- json (2.3.1)
20
+ json (2.5.1)
23
21
  mysql2 (0.5.3)
24
- parallel (1.19.2)
25
- parser (2.7.1.4)
22
+ parallel (1.20.1)
23
+ parser (3.0.0.0)
26
24
  ast (~> 2.4.1)
27
25
  pg (1.2.3)
28
26
  rack (2.2.3)
29
27
  rainbow (3.0.0)
30
- rake (13.0.1)
31
- regexp_parser (1.7.1)
28
+ rake (13.0.3)
29
+ regexp_parser (2.0.2)
32
30
  rexml (3.2.4)
33
- rspec (3.9.0)
34
- rspec-core (~> 3.9.0)
35
- rspec-expectations (~> 3.9.0)
36
- rspec-mocks (~> 3.9.0)
37
- rspec-core (3.9.1)
38
- rspec-support (~> 3.9.1)
39
- rspec-expectations (3.9.1)
31
+ rspec (3.10.0)
32
+ rspec-core (~> 3.10.0)
33
+ rspec-expectations (~> 3.10.0)
34
+ rspec-mocks (~> 3.10.0)
35
+ rspec-core (3.10.0)
36
+ rspec-support (~> 3.10.0)
37
+ rspec-expectations (3.10.0)
40
38
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.9.0)
42
- rspec-mocks (3.9.1)
39
+ rspec-support (~> 3.10.0)
40
+ rspec-mocks (3.10.0)
43
41
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.9.0)
45
- rspec-support (3.9.2)
46
- rubocop (0.89.0)
42
+ rspec-support (~> 3.10.0)
43
+ rspec-support (3.10.0)
44
+ rubocop (1.7.0)
47
45
  parallel (~> 1.10)
48
- parser (>= 2.7.1.1)
46
+ parser (>= 2.7.1.5)
49
47
  rainbow (>= 2.2.2, < 4.0)
50
- regexp_parser (>= 1.7)
48
+ regexp_parser (>= 1.8, < 3.0)
51
49
  rexml
52
- rubocop-ast (>= 0.1.0, < 1.0)
50
+ rubocop-ast (>= 1.2.0, < 2.0)
53
51
  ruby-progressbar (~> 1.7)
54
52
  unicode-display_width (>= 1.4.0, < 2.0)
55
- rubocop-ast (0.3.0)
56
- parser (>= 2.7.1.4)
53
+ rubocop-ast (1.3.0)
54
+ parser (>= 2.7.1.5)
57
55
  ruby-progressbar (1.10.1)
58
- simplecov (0.18.5)
56
+ simplecov (0.21.1)
59
57
  docile (~> 1.1)
60
58
  simplecov-html (~> 0.11)
61
- simplecov-html (0.12.2)
59
+ simplecov_json_formatter (~> 0.1)
60
+ simplecov-html (0.12.3)
61
+ simplecov_json_formatter (0.1.2)
62
62
  sqlite3 (1.4.2)
63
63
  temple (0.8.2)
64
64
  tilt (2.0.10)
65
65
  unicode-display_width (1.7.0)
66
+ webrick (1.7.0)
66
67
 
67
68
  PLATFORMS
68
69
  ruby
@@ -75,8 +76,9 @@ DEPENDENCIES
75
76
  mysql2 (~> 0.5)
76
77
  pg (~> 1.2)
77
78
  rspec (~> 3.0)
78
- rubocop (~> 0.74)
79
+ rubocop (~> 1.0)
79
80
  sqlite3 (~> 1.4.1)
81
+ webrick (~> 1.7.0)
80
82
 
81
83
  BUNDLED WITH
82
- 2.1.4
84
+ 2.2.3
data/README.md CHANGED
@@ -32,9 +32,9 @@ $ mkdir sample
32
32
  $ cd sample
33
33
  $ makanai init
34
34
  $ ruby app.rb
35
- [2019-12-28 12:27:13] INFO WEBrick 1.6.0
36
- [2019-12-28 12:27:13] INFO ruby 2.7.0 (2019-12-25) [x86_64-darwin18]
37
- [2019-12-28 12:27:13] INFO WEBrick::HTTPServer#start: pid=22676 port=8080
35
+ [2021-01-05 09:37:09] INFO WEBrick 1.7.0
36
+ [2021-01-05 09:37:09] INFO ruby 3.0.0 (2020-12-25) [x86_64-darwin18]
37
+ [2021-01-05 09:37:09] INFO WEBrick::HTTPServer#start: pid=10675 port=8080
38
38
  ```
39
39
 
40
40
  # Usage
@@ -68,6 +68,8 @@ root ┬ app.rb # main application file
68
68
  ├ views # views files(ex. index.erb)
69
69
  ├ models # models files(ex. post.rb)
70
70
  ├ migration # migration files(ex. 00_create_resources.sql)
71
+ ├ Rakefile # rake tasks
72
+ ├ Gemfile # dependencies
71
73
  └ db # use Sqlite3 dabase file
72
74
  ```
73
75
 
@@ -20,7 +20,7 @@ module Makanai
20
20
  def run!
21
21
  app_config = config.rack_app_config
22
22
  handler = Rack::Handler.get(app_config[:handler])
23
- handler.run(self, { Host: app_config[:host], Port: app_config[:port] })
23
+ handler.run(self, **{ Host: app_config[:host], Port: app_config[:port] })
24
24
  rescue Interrupt
25
25
  handler.shutdown
26
26
  puts '==== Goodbye! :) ===='
@@ -30,7 +30,7 @@ module Makanai
30
30
  @request = Makanai::Request.new(env)
31
31
  @response = Makanai::Response.new
32
32
  route_result = execute_route
33
- return route_result.result if route_result.class == Response
33
+ return route_result.result if route_result.instance_of?(Response)
34
34
  @response.body << execute_route
35
35
  @response.result
36
36
  end
@@ -1,4 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ source 'https://rubygems.org'
4
+
3
5
  gem 'makanai'
4
- gem 'sqlite3'
6
+
7
+ # If you want to use DB, please uncomment it.
8
+ # or add any gem(`mysql2` or `pg`).
9
+ # gem 'sqlite3'
@@ -55,11 +55,13 @@ module Makanai
55
55
  end
56
56
 
57
57
  def self.buid_sql_text(value)
58
+ # rubocop:disable Lint/DuplicateBranch
58
59
  case value
59
60
  when String then "'#{value.gsub(/'/, "''")}'"
60
61
  when Numeric, Integer then value
61
62
  else value
62
63
  end
64
+ # rubocop:enable Lint/DuplicateBranch
63
65
  end
64
66
 
65
67
  def assign_attributes(attributes)
@@ -21,6 +21,7 @@ module Makanai
21
21
  # ref: https://docs.ruby-lang.org/en/2.7.0/ERB.html#method-i-result
22
22
  ERB.new(text).result(Locals.new(locals).self_binding)
23
23
  end
24
+
24
25
  class Locals
25
26
  def initialize(locals)
26
27
  locals.each { |key, val| instance_variable_set(key, val) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Makanai
4
- VERSION = '0.1.6'
4
+ VERSION = '0.1.7'
5
5
  end
@@ -28,10 +28,11 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "rake", ">= 10", "< 14"
29
29
  spec.add_dependency "rack", ">= 2.0.7", "< 2.3.0"
30
30
  spec.add_development_dependency "sqlite3", "~> 1.4.1"
31
- spec.add_development_dependency "rubocop", "~> 0.74"
31
+ spec.add_development_dependency "rubocop", "~> 1.0"
32
32
  spec.add_development_dependency "bundler", "~> 2.0"
33
33
  spec.add_development_dependency "rspec", "~> 3.0"
34
34
  spec.add_development_dependency "pg", "~> 1.2"
35
35
  spec.add_development_dependency "mysql2", "~> 0.5"
36
+ spec.add_development_dependency "webrick", "~> 1.7.0"
36
37
  spec.add_development_dependency "haml", "~> 5.0"
37
38
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'makanai'
6
+
7
+ # If you want to use DB, please uncomment it.
8
+ # or add any gem(`mysql2` or `pg`).
9
+ # gem 'sqlite3'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makanai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Madogiwa
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-07 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -70,14 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '0.74'
73
+ version: '1.0'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '0.74'
80
+ version: '1.0'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: bundler
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +134,20 @@ dependencies:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0.5'
137
+ - !ruby/object:Gem::Dependency
138
+ name: webrick
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: 1.7.0
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - "~>"
149
+ - !ruby/object:Gem::Version
150
+ version: 1.7.0
137
151
  - !ruby/object:Gem::Dependency
138
152
  name: haml
139
153
  requirement: !ruby/object:Gem::Requirement
@@ -199,6 +213,7 @@ files:
199
213
  - lib/makanai/template_engine/haml.rb
200
214
  - lib/makanai/version.rb
201
215
  - makanai.gemspec
216
+ - sample/Gemfile
202
217
  - sample/Rakefile
203
218
  - sample/app.rb
204
219
  - sample/db/.keep
@@ -211,7 +226,7 @@ licenses:
211
226
  metadata:
212
227
  homepage_uri: https://github.com/Madogiwa0124/makanai
213
228
  source_code_uri: https://github.com/Madogiwa0124/makanai
214
- post_install_message:
229
+ post_install_message:
215
230
  rdoc_options: []
216
231
  require_paths:
217
232
  - lib
@@ -226,8 +241,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
241
  - !ruby/object:Gem::Version
227
242
  version: '0'
228
243
  requirements: []
229
- rubygems_version: 3.1.2
230
- signing_key:
244
+ rubygems_version: 3.2.3
245
+ signing_key:
231
246
  specification_version: 4
232
247
  summary: simple web application framework for learning.
233
248
  test_files: []