leanweb 0.4.0 → 0.4.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c2c8b263119a2bfb7a4a812f4ffeb66bc9444bfc65a5ea0ab99d627d227e307
4
- data.tar.gz: bbb016308a12268ee78694e378e931c016475ca8cf9ff4264d017f79664911f3
3
+ metadata.gz: c06365a703af2701788ef2a910f9bf93235ec58f9ae553f5cc8680c3a69b24d1
4
+ data.tar.gz: 538381c1f9b7fd0fc4fe34151236319cb61148e522ec76eebd1c3ae9bb6adef5
5
5
  SHA512:
6
- metadata.gz: 52c6e7bdd02a5c2797d20cd6979574cec8a4d8333ab659f3332fa6b4e3bce906a69f950124453621e12dee38c0c585ac3abace0a8041c54d444524c0a21bbba3
7
- data.tar.gz: 64ec617d144264edce4922fa2258173f6cc139a20102a9ba4c4290adb6ec06d13be4b5f265af715fdcd82005ae03c66ac447c7dd79bc30dce0c3235d4a4f8e22
6
+ metadata.gz: 9d14b40f59e531bd51ee83a553f157663eae6be88b1808d91d659835fef6184488855ec7895b7da6239c8b180e68e3e2bdd60740beece777142234747b5cb54f
7
+ data.tar.gz: 8562fc17fc25bfbb72ea0b1aa01a6432de76de48e9d5f6b0f13391410017d601eac91b58086ba3b782ecbff9f0a4d4adf6e9de716b558c0da1ecd598cac93f29
data/bin/leanweb CHANGED
@@ -36,7 +36,7 @@ files = [
36
36
 
37
37
  if ENV['RACK_ENV'] == 'development'
38
38
  use(Rack::Reloader, 0)
39
- use(Rack::Static, urls: ['/assets'], root: 'public', cascade: true)
39
+ use(Rack::Static, urls: [''], root: 'public', cascade: true)
40
40
  end
41
41
 
42
42
  run LeanWeb::App.new(ROUTES)
@@ -89,10 +89,11 @@ files = [
89
89
  %h1 It works!
90
90
  HAML
91
91
  }, {
92
- filename: '.gitignore'
92
+ filename: '.gitignore',
93
93
  content: <<~GITIGNORE
94
94
  /.bundle
95
95
  /public/**/*.html
96
+ /vendor
96
97
  GITIGNORE
97
98
  }
98
99
  ]
@@ -109,6 +110,7 @@ begin
109
110
  FileUtils.mkdir_p(['public/assets', 'src/controllers', 'src/views'])
110
111
  files.each{ |file| File.write(file[:filename], file[:content]) }
111
112
  `git init`
113
+ `bundle config --local path vendor/bundle`
112
114
  `bundle install`
113
115
  puts("Project '#{File.basename(Dir.getwd)}' successfully created.")
114
116
  rescue # rubocop:disable Style/RescueStandardError
@@ -56,11 +56,7 @@ class Hawese
56
56
  end
57
57
 
58
58
  def purchase_from_schema(gateway, schema)
59
- fields = {}
60
- schema[:properties].each do |property, contents|
61
- fields[property] = contents[:default] if contents.include?(:default)
62
- end
63
- purchase(gateway, fields)
59
+ purchase(gateway, fields_to_schema_defaults(schema))
64
60
  end
65
61
 
66
62
  def payment(uuid)
@@ -72,5 +68,19 @@ class Hawese
72
68
  JSON.parse(response.body, symbolize_names: true)
73
69
  end
74
70
  end
71
+
72
+ protected
73
+
74
+ def fields_to_schema_defaults(schema)
75
+ fields = {}
76
+ schema[:properties].each do |property, contents|
77
+ if contents.include?(:properties)
78
+ fields[property] = fields_to_schema_defaults(contents)
79
+ elsif contents.include?(:default)
80
+ fields[property] = contents[:default]
81
+ end
82
+ end
83
+ fields
84
+ end
75
85
  end
76
86
  end
@@ -9,5 +9,5 @@
9
9
 
10
10
 
11
11
  module LeanWeb
12
- VERSION = '0.4.0'
12
+ VERSION = '0.4.2'
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leanweb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Freeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-09 00:00:00.000000000 Z
11
+ date: 2023-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  - !ruby/object:Gem::Version
223
223
  version: '0'
224
224
  requirements: []
225
- rubygems_version: 3.3.23
225
+ rubygems_version: 3.4.7
226
226
  signing_key:
227
227
  specification_version: 4
228
228
  summary: LeanWeb is a minimal hybrid static / dynamic web framework