flame 4.18.1 → 5.0.0.rc6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +921 -0
  3. data/LICENSE.txt +19 -0
  4. data/README.md +135 -0
  5. data/lib/flame.rb +12 -4
  6. data/lib/flame/application.rb +93 -40
  7. data/lib/flame/config.rb +73 -0
  8. data/lib/flame/controller.rb +62 -98
  9. data/lib/flame/controller/actions.rb +122 -0
  10. data/lib/flame/controller/cookies.rb +44 -0
  11. data/lib/flame/controller/path_to.rb +63 -0
  12. data/lib/flame/dispatcher.rb +44 -73
  13. data/lib/flame/dispatcher/request.rb +33 -4
  14. data/lib/flame/dispatcher/routes.rb +66 -0
  15. data/lib/flame/dispatcher/static.rb +26 -15
  16. data/lib/flame/errors/argument_not_assigned_error.rb +7 -6
  17. data/lib/flame/errors/config_file_not_found_error.rb +17 -0
  18. data/lib/flame/errors/controller_not_found_error.rb +19 -0
  19. data/lib/flame/errors/route_arguments_order_error.rb +9 -8
  20. data/lib/flame/errors/route_extra_arguments_error.rb +18 -18
  21. data/lib/flame/errors/route_not_found_error.rb +8 -7
  22. data/lib/flame/errors/template_not_found_error.rb +6 -6
  23. data/lib/flame/path.rb +141 -55
  24. data/lib/flame/render.rb +46 -15
  25. data/lib/flame/router.rb +41 -127
  26. data/lib/flame/router/controller_finder.rb +56 -0
  27. data/lib/flame/router/route.rb +16 -54
  28. data/lib/flame/router/routes.rb +136 -0
  29. data/lib/flame/router/routes_refine.rb +144 -0
  30. data/lib/flame/router/routes_refine/mounting.rb +57 -0
  31. data/lib/flame/validators.rb +21 -11
  32. data/lib/flame/version.rb +1 -1
  33. metadata +139 -84
  34. data/bin/flame +0 -71
  35. data/lib/flame/application/config.rb +0 -43
  36. data/lib/flame/dispatcher/cookies.rb +0 -31
  37. data/template/.gitignore +0 -11
  38. data/template/Gemfile +0 -15
  39. data/template/Rakefile.erb +0 -64
  40. data/template/app.rb.erb +0 -7
  41. data/template/config.ru.erb +0 -20
  42. data/template/config/config.rb.erb +0 -14
  43. data/template/config/database.example.yml +0 -5
  44. data/template/config/sequel.rb.erb +0 -15
  45. data/template/config/thin.example.yml +0 -18
  46. data/template/controllers/_base_controller.rb.erb +0 -13
  47. data/template/db/.keep +0 -0
  48. data/template/helpers/.keep +0 -0
  49. data/template/lib/.keep +0 -0
  50. data/template/locales/en.yml +0 -0
  51. data/template/models/.keep +0 -0
  52. data/template/public/.keep +0 -0
  53. data/template/server +0 -49
  54. data/template/views/.keep +0 -0
@@ -0,0 +1,136 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Flame
4
+ class Router
5
+ ## Custom Hash for routes
6
+ class Routes < Hash
7
+ ## @param path_parts [Array<String, Flame::Path, Flame::Path::Part>]
8
+ ## path parts for nested keys
9
+ ## @example Initialize without keys
10
+ ## Flame::Router::Routes.new # => {}
11
+ ## @example Initialize with nested keys
12
+ ## Flame::Router::Routes.new('/foo/bar/baz')
13
+ ## # => { 'foo' => { 'bar' => { 'baz' => {} } } }
14
+ def initialize(*path_parts)
15
+ super()
16
+
17
+ path = Flame::Path.new(*path_parts)
18
+ return if path.parts.empty?
19
+
20
+ nested_routes = self.class.new Flame::Path.new(*path.parts[1..-1])
21
+ # path.parts.reduce(result) do |hash, part|
22
+ # hash[part] ||= self.class.new
23
+ # end
24
+ self[path.parts.first] = nested_routes
25
+ end
26
+
27
+ ## Move into Hash by equal key
28
+ ## @param path_part [String, Flame::Path::Part, Symbol] requested key
29
+ ## @return [Flame::Router::Routes, Flame::Router::Route, nil] found value
30
+ ## @example Move by static path part
31
+ ## routes = Flame::Router::Routes.new('/foo/bar/baz')
32
+ ## routes['foo'] # => { 'bar' => { 'baz' => {} } }
33
+ ## @example Move by HTTP-method
34
+ ## routes = Flame::Router::Routes.new('/foo/bar')
35
+ ## routes['foo']['bar'][:GET] = 42
36
+ ## routes['foo']['bar'][:GET] # => 42
37
+ def [](key)
38
+ if key.is_a? String
39
+ key = Flame::Path::Part.new(key)
40
+ elsif !key.is_a?(Flame::Path::Part) && !key.is_a?(Symbol)
41
+ return
42
+ end
43
+ super
44
+ end
45
+
46
+ ## Return the first available route (at the first level).
47
+ ## @return [Flame::Router::Route] the first route
48
+ def first_route
49
+ values.find { |value| value.is_a?(Route) }
50
+ end
51
+
52
+ ## Navigate to Routes or Route through static parts or arguments
53
+ ## @param path_parts [Array<String, Flame::Path, Flame::Path::Part>]
54
+ ## path or path parts as keys for navigating
55
+ ## @return [Flame::Router::Routes, Flame::Router::Route, nil] found value
56
+ ## @example Move by static path part and argument
57
+ ## routes = Flame::Router::Routes.new('/foo/:first/bar')
58
+ ## routes.navigate('foo', 'value') # => { 'bar' => {} }
59
+ def navigate(*path_parts)
60
+ path_parts = Flame::Path.new(*path_parts).parts
61
+ return dig_through_opt_args if path_parts.empty?
62
+
63
+ endpoint =
64
+ self[path_parts.first] || dig(first_opt_arg_key, path_parts.first)
65
+
66
+ endpoint&.navigate(*path_parts[1..-1]) ||
67
+ find_among_arg_keys(path_parts[1..-1])
68
+ end
69
+
70
+ ## Dig through optional arguments as keys
71
+ ## @return [Flame::Router::Routes] return most nested end-point
72
+ ## without optional arguments
73
+ def dig_through_opt_args
74
+ [
75
+ self[first_opt_arg_key]&.dig_through_opt_args,
76
+ self
77
+ ]
78
+ .compact.find(&:first_route)
79
+ end
80
+
81
+ def allow
82
+ methods = keys.select { |key| key.is_a? Symbol }
83
+ return if methods.empty?
84
+
85
+ methods.push(:OPTIONS).join(', ')
86
+ end
87
+
88
+ PADDING_SIZE = Router::HTTP_METHODS.map(&:size).max
89
+ PADDING_FORMAT = "%#{PADDING_SIZE}.#{PADDING_SIZE}s"
90
+
91
+ ## Output routes in human readable format
92
+ def to_s(prefix = '/')
93
+ sort.map do |key, value|
94
+ if key.is_a?(Symbol)
95
+ <<~OUTPUT
96
+ \e[1m#{format PADDING_FORMAT, key} #{prefix}\e[22m
97
+ #{' ' * PADDING_SIZE} \e[3m\e[36m#{value}\e[0m\e[23m
98
+ OUTPUT
99
+ else
100
+ value.to_s(Flame::Path.new(prefix, key))
101
+ end
102
+ end.join
103
+ end
104
+
105
+ ## Sort routes for human readability
106
+ def sort
107
+ sort_by do |key, _value|
108
+ [
109
+ if key.is_a?(Symbol)
110
+ then Router::HTTP_METHODS.index(key)
111
+ else Float::INFINITY
112
+ end,
113
+ key.to_s
114
+ ]
115
+ end
116
+ end
117
+
118
+ private
119
+
120
+ def find_among_arg_keys(path_parts)
121
+ keys.find do |key|
122
+ next unless key.is_a?(Flame::Path::Part) && key.arg?
123
+
124
+ result = self[key].navigate(*path_parts)
125
+ break result if result
126
+ end
127
+ end
128
+
129
+ def first_opt_arg_key
130
+ keys.find do |key|
131
+ key.is_a?(Flame::Path::Part) && key.opt_arg?
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
@@ -0,0 +1,144 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'routes_refine/mounting'
4
+
5
+ module Flame
6
+ class Router
7
+ ## Helper class for controller routing refine
8
+ class RoutesRefine
9
+ attr_reader :routes, :reverse_routes
10
+
11
+ class << self
12
+ include Memery
13
+
14
+ ## Defaults REST routes (methods, pathes, controllers actions)
15
+ def rest_routes
16
+ [
17
+ { method: :GET, path: '/', action: :index },
18
+ { method: :POST, path: '/', action: :create },
19
+ { method: :GET, path: '/', action: :show },
20
+ { method: :PUT, path: '/', action: :update },
21
+ { method: :DELETE, path: '/', action: :delete }
22
+ ]
23
+ end
24
+ end
25
+
26
+ using GorillaPatch::Namespace
27
+
28
+ def initialize(
29
+ namespace_name, controller_or_name, path, nested: true, &block
30
+ )
31
+ @controller =
32
+ ControllerFinder.new(namespace_name, controller_or_name).controller
33
+ @namespace_name = @controller.deconstantize
34
+ @path = Flame::Path.new(path || @controller.path)
35
+ @controller.path_arguments = @path.parts.select(&:arg?).map(&:to_sym)
36
+ @routes, @endpoint = @path.to_routes_with_endpoint
37
+ @reverse_routes = {}
38
+ @mount_nested = nested
39
+ execute(&block)
40
+ end
41
+
42
+ private
43
+
44
+ HTTP_METHODS.each do |http_method|
45
+ ## Define refine methods for all HTTP methods
46
+ ## @overload post(path, action)
47
+ ## Execute action on requested path and HTTP method
48
+ ## @param path [String] path of method for the request
49
+ ## @param action [Symbol] name of method for the request
50
+ ## @example
51
+ ## Set path to '/bye' and method to :POST for action `goodbye`
52
+ ## post '/bye', :goodbye
53
+ ## @overload post(action)
54
+ ## Execute action on requested HTTP method
55
+ ## @param action [Symbol] name of method for the request
56
+ ## @example Set method to :POST for action `goodbye`
57
+ ## post :goodbye
58
+ define_method(http_method.downcase) do |action_path, action = nil|
59
+ ## Swap arguments if action in path variable
60
+ unless action
61
+ action = action_path.to_sym
62
+ action_path = nil
63
+ end
64
+ ## Initialize new route
65
+ route = Route.new(@controller, action)
66
+ ## Make path by controller method with parameners
67
+ action_path = Flame::Path.new(action_path).adapt(@controller, action)
68
+ ## Validate action path
69
+ validate_action_path(action, action_path)
70
+ ## Merge action path with controller path
71
+ path = Flame::Path.new(@path, action_path)
72
+ ## Remove the same route if needed
73
+ remove_old_routes(action, route)
74
+ ## Add new route
75
+ add_new_route(route, action, path, http_method)
76
+ end
77
+ end
78
+
79
+ ## Assign remaining methods of the controller
80
+ ## to defaults pathes and HTTP methods
81
+ def defaults
82
+ rest
83
+
84
+ @controller.actions.each do |action|
85
+ get action unless find_reverse_route(action)
86
+ end
87
+
88
+ mount_nested_controllers if @mount_nested && (
89
+ @controller.demodulize == 'IndexController' &&
90
+ !@namespace_name.empty?
91
+ )
92
+ end
93
+
94
+ ## Assign methods of the controller to REST architecture
95
+ def rest
96
+ self.class.rest_routes.each do |rest_route|
97
+ action = rest_route[:action]
98
+ next if !@controller.actions.include?(action) || find_reverse_route(action)
99
+
100
+ send(*rest_route.values.map(&:downcase))
101
+ end
102
+ end
103
+
104
+ include Mounting
105
+
106
+ ## Execute block of refinings end sorting routes
107
+ def execute(&block)
108
+ @controller.refined_http_methods
109
+ .each do |action, (http_method, action_path)|
110
+ send(http_method, action_path, action)
111
+ end
112
+ instance_exec(&block) if block
113
+ defaults
114
+ end
115
+
116
+ def find_reverse_route(action)
117
+ @reverse_routes.dig(@controller.to_s, action)
118
+ end
119
+
120
+ def validate_action_path(action, action_path)
121
+ Validators::RouteArgumentsValidator
122
+ .new(@controller, action_path, action)
123
+ .valid?
124
+ end
125
+
126
+ def remove_old_routes(action, new_route)
127
+ old_path = @reverse_routes[@controller.to_s]&.delete(action)
128
+ return unless old_path
129
+
130
+ @routes.dig(*old_path.parts)
131
+ .delete_if { |_method, old_route| old_route == new_route }
132
+ end
133
+
134
+ using GorillaPatch::DeepMerge
135
+
136
+ def add_new_route(route, action, path, http_method)
137
+ path_routes, endpoint = path.to_routes_with_endpoint
138
+ endpoint[http_method] = route
139
+ @routes.deep_merge!(path_routes)
140
+ (@reverse_routes[@controller.to_s] ||= {})[action] = path
141
+ end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Flame
4
+ class Router
5
+ class RoutesRefine
6
+ ## Module for mounting in RoutesRefine
7
+ module Mounting
8
+ private
9
+
10
+ using GorillaPatch::DeepMerge
11
+
12
+ ## Mount controller inside other (parent) controller
13
+ ## @param controller [Flame::Controller] class of mounting controller
14
+ ## @param path [String, nil] root path for mounting controller
15
+ ## @yield Block of code for routes refine
16
+ def mount(controller_name, path = nil, &block)
17
+ routes_refine = self.class.new(
18
+ @namespace_name, controller_name, path, &block
19
+ )
20
+
21
+ @endpoint.deep_merge! routes_refine.routes
22
+
23
+ @reverse_routes.merge!(
24
+ routes_refine.reverse_routes.transform_values do |hash|
25
+ hash.transform_values { |action_path| @path + action_path }
26
+ end
27
+ )
28
+ end
29
+
30
+ using GorillaPatch::Namespace
31
+
32
+ def mount_nested_controllers
33
+ namespace = Object.const_get(@namespace_name)
34
+
35
+ namespace.constants.each do |constant_name|
36
+ constant = namespace.const_get(constant_name)
37
+ if constant < Flame::Controller || constant.instance_of?(Module)
38
+ mount_nested_controller constant
39
+ end
40
+ end
41
+ end
42
+
43
+ def mount_nested_controller(nested_controller)
44
+ mount nested_controller if should_be_mounted? nested_controller
45
+ end
46
+
47
+ def should_be_mounted?(controller)
48
+ if controller.instance_of?(Module)
49
+ controller.const_defined?(:IndexController, false)
50
+ else
51
+ controller.actions.any? && !@reverse_routes.key?(controller.to_s)
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -7,12 +7,20 @@ module Flame
7
7
  module Validators
8
8
  ## Compare arguments from path and from controller's action
9
9
  class RouteArgumentsValidator
10
+ include Memery
11
+
12
+ ## Create a new instance of validator
13
+ ## @param ctrl [Flame::Controller] controller of route
14
+ ## @param path [Flame::Path, String] path of route
15
+ ## @param action [Symbol, String] action of route
10
16
  def initialize(ctrl, path, action)
11
17
  @ctrl = ctrl
12
18
  @path = Flame::Path.new(path)
13
19
  @action = action
14
20
  end
15
21
 
22
+ ## Validate
23
+ ## @return [true, false] valid or not
16
24
  def valid?
17
25
  extra_valid? && order_valid?
18
26
  end
@@ -23,6 +31,7 @@ module Flame
23
31
  extra_arguments = first_extra_arguments
24
32
  ## Raise error if extra arguments
25
33
  return true unless extra_arguments
34
+
26
35
  raise Errors::RouteExtraArgumentsError.new(
27
36
  @ctrl, @action, @path, extra_arguments
28
37
  )
@@ -31,27 +40,28 @@ module Flame
31
40
  def order_valid?
32
41
  wrong_ordered_arguments = first_wrong_ordered_arguments
33
42
  return true unless wrong_ordered_arguments
43
+
34
44
  raise Errors::RouteArgumentsOrderError.new(
35
45
  @path, wrong_ordered_arguments
36
46
  )
37
47
  end
38
48
 
39
49
  ## Split path to args array
40
- def path_arguments
41
- @path_arguments ||= @path.parts
42
- .each_with_object(req: [], opt: []) do |part, hash|
43
- ## Take only argument parts
44
- next unless part.arg?
45
- ## Memorize arguments
46
- hash[part.opt_arg? ? :opt : :req] << part.clean.to_sym
47
- end
50
+ memoize def path_arguments
51
+ @path.parts.each_with_object(req: [], opt: []) do |part, hash|
52
+ ## Take only argument parts
53
+ next unless part.arg?
54
+
55
+ ## Memorize arguments
56
+ hash[part.opt_arg? ? :opt : :req] << part.to_sym
57
+ end
48
58
  end
49
59
 
50
60
  ## Take args from controller's action
51
- def action_arguments
61
+ memoize def action_arguments
52
62
  ## Get all parameters (arguments) from method
53
63
  ## Than collect and sort parameters into hash
54
- @action_arguments ||= @ctrl.instance_method(@action).parameters
64
+ @ctrl.instance_method(@action).parameters
55
65
  .each_with_object(req: [], opt: []) do |param, hash|
56
66
  ## Only required parameters must be in `:req`
57
67
  hash[param[0]] << param[1]
@@ -81,7 +91,7 @@ module Flame
81
91
  def first_wrong_ordered_arguments
82
92
  opt_arguments = action_arguments[:opt].zip(path_arguments[:opt])
83
93
  opt_arguments.map! do |args|
84
- args.map { |arg| Flame::Path::PathPart.new(arg, arg: :opt) }
94
+ args.map { |arg| Flame::Path::Part.new(arg, arg: :opt) }
85
95
  end
86
96
  opt_arguments.find do |action_argument, path_argument|
87
97
  action_argument != path_argument
data/lib/flame/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flame
4
- VERSION = '4.18.1'
4
+ VERSION = '5.0.0.rc6'
5
5
  end
metadata CHANGED
@@ -1,235 +1,300 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flame
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.18.1
4
+ version: 5.0.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-29 00:00:00.000000000 Z
11
+ date: 2021-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rack
14
+ name: addressable
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2'
19
+ version: '2.5'
20
20
  type: :runtime
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'
26
+ version: '2.5'
27
27
  - !ruby/object:Gem::Dependency
28
- name: tilt
28
+ name: alt_memery
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
32
39
  - !ruby/object:Gem::Version
33
40
  version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: gorilla_patch
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
34
48
  - - "<"
35
49
  - !ruby/object:Gem::Version
36
- version: '3'
50
+ version: '5'
37
51
  type: :runtime
38
52
  prerelease: false
39
53
  version_requirements: !ruby/object:Gem::Requirement
40
54
  requirements:
41
55
  - - ">="
42
56
  - !ruby/object:Gem::Version
43
- version: '2.0'
57
+ version: '3.0'
44
58
  - - "<"
45
59
  - !ruby/object:Gem::Version
46
- version: '3'
60
+ version: '5'
47
61
  - !ruby/object:Gem::Dependency
48
- name: gorilla-patch
62
+ name: rack
49
63
  requirement: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - "~>"
52
66
  - !ruby/object:Gem::Version
53
- version: '2'
54
- - - ">="
67
+ version: '2.1'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
55
73
  - !ruby/object:Gem::Version
56
- version: 2.0.0
74
+ version: '2.1'
75
+ - !ruby/object:Gem::Dependency
76
+ name: tilt
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.0'
57
82
  type: :runtime
58
83
  prerelease: false
59
84
  version_requirements: !ruby/object:Gem::Requirement
60
85
  requirements:
61
86
  - - "~>"
62
87
  - !ruby/object:Gem::Version
63
- version: '2'
64
- - - ">="
88
+ version: '2.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: pry-byebug
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '3.9'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
65
101
  - !ruby/object:Gem::Version
66
- version: 2.0.0
102
+ version: '3.9'
67
103
  - !ruby/object:Gem::Dependency
68
- name: thor
104
+ name: bundler
69
105
  requirement: !ruby/object:Gem::Requirement
70
106
  requirements:
71
107
  - - "~>"
72
108
  - !ruby/object:Gem::Version
73
- version: '0'
74
- type: :runtime
109
+ version: '2.0'
110
+ type: :development
75
111
  prerelease: false
76
112
  version_requirements: !ruby/object:Gem::Requirement
77
113
  requirements:
78
114
  - - "~>"
79
115
  - !ruby/object:Gem::Version
80
- version: '0'
116
+ version: '2.0'
81
117
  - !ruby/object:Gem::Dependency
82
- name: rubocop
118
+ name: bundler-audit
83
119
  requirement: !ruby/object:Gem::Requirement
84
120
  requirements:
85
121
  - - "~>"
86
122
  - !ruby/object:Gem::Version
87
- version: '0.48'
123
+ version: 0.7.0
88
124
  type: :development
89
125
  prerelease: false
90
126
  version_requirements: !ruby/object:Gem::Requirement
91
127
  requirements:
92
128
  - - "~>"
93
129
  - !ruby/object:Gem::Version
94
- version: '0.48'
130
+ version: 0.7.0
95
131
  - !ruby/object:Gem::Dependency
96
- name: rake
132
+ name: gem_toys
97
133
  requirement: !ruby/object:Gem::Requirement
98
134
  requirements:
99
135
  - - "~>"
100
136
  - !ruby/object:Gem::Version
101
- version: '12'
137
+ version: 0.6.0
102
138
  type: :development
103
139
  prerelease: false
104
140
  version_requirements: !ruby/object:Gem::Requirement
105
141
  requirements:
106
142
  - - "~>"
107
143
  - !ruby/object:Gem::Version
108
- version: '12'
144
+ version: 0.6.0
109
145
  - !ruby/object:Gem::Dependency
110
- name: bacon
146
+ name: toys
111
147
  requirement: !ruby/object:Gem::Requirement
112
148
  requirements:
113
149
  - - "~>"
114
150
  - !ruby/object:Gem::Version
115
- version: '1'
151
+ version: 0.11.0
116
152
  type: :development
117
153
  prerelease: false
118
154
  version_requirements: !ruby/object:Gem::Requirement
119
155
  requirements:
120
156
  - - "~>"
121
157
  - !ruby/object:Gem::Version
122
- version: '1'
158
+ version: 0.11.0
123
159
  - !ruby/object:Gem::Dependency
124
- name: bacon-colored_output
160
+ name: better_errors
125
161
  requirement: !ruby/object:Gem::Requirement
126
162
  requirements:
127
163
  - - "~>"
128
164
  - !ruby/object:Gem::Version
129
- version: '1.1'
130
- - - ">="
165
+ version: '2.0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '2.0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: codecov
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
131
178
  - !ruby/object:Gem::Version
132
- version: 1.1.1
179
+ version: 0.4.3
133
180
  type: :development
134
181
  prerelease: false
135
182
  version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: 0.4.3
187
+ - !ruby/object:Gem::Dependency
188
+ name: rack-test
189
+ requirement: !ruby/object:Gem::Requirement
136
190
  requirements:
137
191
  - - "~>"
138
192
  - !ruby/object:Gem::Version
139
193
  version: '1.1'
140
- - - ">="
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - "~>"
141
199
  - !ruby/object:Gem::Version
142
- version: 1.1.1
200
+ version: '1.1'
143
201
  - !ruby/object:Gem::Dependency
144
- name: rack-test
202
+ name: rspec
145
203
  requirement: !ruby/object:Gem::Requirement
146
204
  requirements:
147
205
  - - "~>"
148
206
  - !ruby/object:Gem::Version
149
- version: '0'
207
+ version: '3.9'
150
208
  type: :development
151
209
  prerelease: false
152
210
  version_requirements: !ruby/object:Gem::Requirement
153
211
  requirements:
154
212
  - - "~>"
155
213
  - !ruby/object:Gem::Version
156
- version: '0'
214
+ version: '3.9'
157
215
  - !ruby/object:Gem::Dependency
158
216
  name: simplecov
159
217
  requirement: !ruby/object:Gem::Requirement
160
218
  requirements:
161
219
  - - "~>"
162
220
  - !ruby/object:Gem::Version
163
- version: '0'
221
+ version: 0.21.2
164
222
  type: :development
165
223
  prerelease: false
166
224
  version_requirements: !ruby/object:Gem::Requirement
167
225
  requirements:
168
226
  - - "~>"
169
227
  - !ruby/object:Gem::Version
170
- version: '0'
228
+ version: 0.21.2
171
229
  - !ruby/object:Gem::Dependency
172
- name: codecov
230
+ name: rubocop
173
231
  requirement: !ruby/object:Gem::Requirement
174
232
  requirements:
175
233
  - - "~>"
176
234
  - !ruby/object:Gem::Version
177
- version: '0'
235
+ version: '1.3'
178
236
  type: :development
179
237
  prerelease: false
180
238
  version_requirements: !ruby/object:Gem::Requirement
181
239
  requirements:
182
240
  - - "~>"
183
241
  - !ruby/object:Gem::Version
184
- version: '0'
242
+ version: '1.3'
185
243
  - !ruby/object:Gem::Dependency
186
- name: pry
244
+ name: rubocop-performance
187
245
  requirement: !ruby/object:Gem::Requirement
188
246
  requirements:
189
247
  - - "~>"
190
248
  - !ruby/object:Gem::Version
191
- version: '0'
249
+ version: '1.0'
192
250
  type: :development
193
251
  prerelease: false
194
252
  version_requirements: !ruby/object:Gem::Requirement
195
253
  requirements:
196
254
  - - "~>"
197
255
  - !ruby/object:Gem::Version
198
- version: '0'
256
+ version: '1.0'
199
257
  - !ruby/object:Gem::Dependency
200
- name: pry-byebug
258
+ name: rubocop-rspec
201
259
  requirement: !ruby/object:Gem::Requirement
202
260
  requirements:
203
261
  - - "~>"
204
262
  - !ruby/object:Gem::Version
205
- version: '3'
263
+ version: '2.0'
206
264
  type: :development
207
265
  prerelease: false
208
266
  version_requirements: !ruby/object:Gem::Requirement
209
267
  requirements:
210
268
  - - "~>"
211
269
  - !ruby/object:Gem::Version
212
- version: '3'
213
- description: Use controller's classes with instance methods as routing actions, mounting
214
- its in application class.
270
+ version: '2.0'
271
+ description: |
272
+ Use controller's classes with instance methods as routing actions,
273
+ mounting its in application class.
215
274
  email:
216
275
  - alex.wayfer@gmail.com
217
- executables:
218
- - flame
276
+ executables: []
219
277
  extensions: []
220
278
  extra_rdoc_files: []
221
279
  files:
222
- - bin/flame
280
+ - CHANGELOG.md
281
+ - LICENSE.txt
282
+ - README.md
223
283
  - lib/flame.rb
224
284
  - lib/flame/application.rb
225
- - lib/flame/application/config.rb
285
+ - lib/flame/config.rb
226
286
  - lib/flame/controller.rb
287
+ - lib/flame/controller/actions.rb
288
+ - lib/flame/controller/cookies.rb
289
+ - lib/flame/controller/path_to.rb
227
290
  - lib/flame/dispatcher.rb
228
- - lib/flame/dispatcher/cookies.rb
229
291
  - lib/flame/dispatcher/request.rb
230
292
  - lib/flame/dispatcher/response.rb
293
+ - lib/flame/dispatcher/routes.rb
231
294
  - lib/flame/dispatcher/static.rb
232
295
  - lib/flame/errors/argument_not_assigned_error.rb
296
+ - lib/flame/errors/config_file_not_found_error.rb
297
+ - lib/flame/errors/controller_not_found_error.rb
233
298
  - lib/flame/errors/route_arguments_order_error.rb
234
299
  - lib/flame/errors/route_extra_arguments_error.rb
235
300
  - lib/flame/errors/route_not_found_error.rb
@@ -237,33 +302,24 @@ files:
237
302
  - lib/flame/path.rb
238
303
  - lib/flame/render.rb
239
304
  - lib/flame/router.rb
305
+ - lib/flame/router/controller_finder.rb
240
306
  - lib/flame/router/route.rb
307
+ - lib/flame/router/routes.rb
308
+ - lib/flame/router/routes_refine.rb
309
+ - lib/flame/router/routes_refine/mounting.rb
241
310
  - lib/flame/validators.rb
242
311
  - lib/flame/version.rb
243
312
  - public/favicon.ico
244
- - template/.gitignore
245
- - template/Gemfile
246
- - template/Rakefile.erb
247
- - template/app.rb.erb
248
- - template/config.ru.erb
249
- - template/config/config.rb.erb
250
- - template/config/database.example.yml
251
- - template/config/sequel.rb.erb
252
- - template/config/thin.example.yml
253
- - template/controllers/_base_controller.rb.erb
254
- - template/db/.keep
255
- - template/helpers/.keep
256
- - template/lib/.keep
257
- - template/locales/en.yml
258
- - template/models/.keep
259
- - template/public/.keep
260
- - template/server
261
- - template/views/.keep
262
313
  homepage: https://github.com/AlexWayfer/flame
263
314
  licenses:
264
315
  - MIT
265
- metadata: {}
266
- post_install_message:
316
+ metadata:
317
+ bug_tracker_uri: https://github.com/AlexWayfer/flame/issues
318
+ documentation_uri: http://www.rubydoc.info/gems/flame/5.0.0.rc6
319
+ source_code_uri: https://github.com/AlexWayfer/flame
320
+ wiki_uri: https://github.com/AlexWayfer/flame/wiki
321
+ homepage_uri: https://github.com/AlexWayfer/flame
322
+ post_install_message:
267
323
  rdoc_options: []
268
324
  require_paths:
269
325
  - lib
@@ -271,16 +327,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
327
  requirements:
272
328
  - - ">="
273
329
  - !ruby/object:Gem::Version
274
- version: '0'
330
+ version: '2.5'
275
331
  required_rubygems_version: !ruby/object:Gem::Requirement
276
332
  requirements:
277
- - - ">="
333
+ - - ">"
278
334
  - !ruby/object:Gem::Version
279
- version: '0'
335
+ version: 1.3.1
280
336
  requirements: []
281
- rubyforge_project:
282
- rubygems_version: 2.6.11
283
- signing_key:
337
+ rubygems_version: 3.2.3
338
+ signing_key:
284
339
  specification_version: 4
285
340
  summary: Web-framework, based on MVC-pattern
286
341
  test_files: []