gambiarra 0.0.4 → 0.0.6

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: bce904d0ed31526a3f3d45e28642c1763303677cd8447981d47b2ef25ce281ec
4
- data.tar.gz: 240d00f9b92fa603c12dfa4bf184f3cf94575cf2042833dc269fed2d32eb7ef5
3
+ metadata.gz: 8b389361e84b99289a101597e0c79647bf76c8f793f91ba6406d98c475f39138
4
+ data.tar.gz: 68cde88ed683287bd3719a6055d6b36703d42e99d8117c5d3ab6694e06e3d9cc
5
5
  SHA512:
6
- metadata.gz: 0ad2137d3b4277aa55e88db162b823f2fc3fe574e42f769d2e74bb18dc54b2373b2a9464bdd75684ace110930ffb752b4b52034df0fadd27f5d5f261dfcca379
7
- data.tar.gz: 6fe6321b4a763ba34d931b816bc27ba24d7d03353e1614f00222dc79d9d39d94e09f26030b28f3ee725131f274fa7a51020e47324c15ee86cbb417e923028937
6
+ metadata.gz: 8bb17d8ac829cf3a07e297185860caa90f14fb4f5e7ae0d9e6cd06aa661c3623cc10c23c102b88738feb99573758dd25aa91f0c75c5ec463545ac677a4bca717
7
+ data.tar.gz: 3389a535ed34e8d63671e09ab1658e3638553cc179cdfc04a65fe998d3fcb4ced76c3a2ecfb61e323ef8e84c561f251d453e987737deb0ee96a0625d8135527d
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .DS_Store
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /_yardoc/
data/lib/gambiarra/app.rb CHANGED
@@ -22,8 +22,8 @@ module Gambiarra
22
22
  end
23
23
  end
24
24
 
25
- response = {path: (path || ''), **params}
26
- loop { response = app.flow(**response) }
25
+ responses = [{ path: (path || ''), **params }]
26
+ loop { responses << (app.flow(**responses.last) || {}) }
27
27
  end
28
28
 
29
29
  def self.app
@@ -31,7 +31,6 @@ module Gambiarra
31
31
  end
32
32
 
33
33
  def initialize(debugging: false)
34
- debugging = true
35
34
  setup if respond_to?(:setup)
36
35
  @debugging = debugging
37
36
  @router = Router.new
@@ -71,7 +70,7 @@ module Gambiarra
71
70
  self.class.to_s.split('::').first.underscore.gsub('_', '-')
72
71
  end
73
72
 
74
- def flow(response)
73
+ def flow(**response)
75
74
  raise 'Response is empty' unless response
76
75
  output(response)
77
76
  response.delete(:content)
@@ -22,13 +22,13 @@ module Gambiarra
22
22
  routes.pop.respond
23
23
  end
24
24
 
25
- def refresh(params={})
25
+ def refresh(**params)
26
26
  return {
27
27
  content: 'Abnormal end',
28
28
  path: 'exit'
29
29
  } unless current_route
30
30
 
31
- current_route.respond(params)
31
+ current_route.respond(**params)
32
32
  end
33
33
  end
34
34
  end
@@ -18,7 +18,7 @@ module Gambiarra
18
18
  path = params.delete(:path)
19
19
  @url = build_url(path || history.current_route.path, **params)
20
20
  route = routes.detect { |route| route.path == path }
21
- return history.refresh(params) unless route
21
+ return history.refresh(**params) unless route
22
22
  history.add(route)
23
23
  route.respond(**params)
24
24
  end
@@ -29,7 +29,7 @@ module Gambiarra
29
29
 
30
30
  private
31
31
 
32
- def build_url(path, params)
32
+ def build_url(path, **params)
33
33
  [
34
34
  path,
35
35
  (params || {}).map do |k,v|
@@ -1,3 +1,3 @@
1
1
  module Gambiarra
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gambiarra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Maciel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-06 00:00:00.000000000 Z
11
+ date: 2023-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '5.2'
97
- description:
97
+ description:
98
98
  email:
99
99
  - pedrozath@gmail.com
100
100
  executables:
@@ -102,7 +102,6 @@ executables:
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - ".DS_Store"
106
105
  - ".gitignore"
107
106
  - ".rspec"
108
107
  - ".travis.yml"
@@ -136,7 +135,7 @@ homepage: https://github.com/pedrozath/gambiarra
136
135
  licenses:
137
136
  - MIT
138
137
  metadata: {}
139
- post_install_message:
138
+ post_install_message:
140
139
  rdoc_options: []
141
140
  require_paths:
142
141
  - lib
@@ -151,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
150
  - !ruby/object:Gem::Version
152
151
  version: '0'
153
152
  requirements: []
154
- rubygems_version: 3.1.2
155
- signing_key:
153
+ rubygems_version: 3.2.15
154
+ signing_key:
156
155
  specification_version: 4
157
156
  summary: An intuitive framework for CLI applications
158
157
  test_files: []
data/.DS_Store DELETED
Binary file