camping 3.2.2 → 3.2.3

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: e8f510e735548917a248d02aec9a7a36f21c3c527919799c23dc32c2c717396d
4
- data.tar.gz: 2535878776ceb1093fd24b621db216ae5917addd76a9bc0f7f8fff33abc6f4e6
3
+ metadata.gz: 3f5615f332dcf7362345f6d628b4d9d90adf93862cecddce4168b6609e684b87
4
+ data.tar.gz: 0d6454ca641d2a2ff03d097c0c6b62df9971517ddde4b72fea2b18b108ca3f9a
5
5
  SHA512:
6
- metadata.gz: 99b49c530feed07ee899e83d1e442b708cb44e383d8e23437896cbeea0ed945b0500edd794bd887b2d59a9be957b13556d61600d6c2d38a0389625dd1b2c6222
7
- data.tar.gz: 1eb83d984b72e38e5a475555dd80503fbf9dcd2ca43ca6770e1b744f4f41b360698432f08c35162bc4ff422f249813a705f93e0b00a471181ba7e73b9fb74905
6
+ metadata.gz: 57eeda38ff38008fe71e9437bbd0484582c06bacd2d75cadc77134ec5e7cbd216cbd2ac25723a493c6a06268e5739e9942fdfef084055960241bc4b9f0db908e
7
+ data.tar.gz: 19563aba78678ed871ee40cd004dbdfeff4039d30b515304dbeefc8bd33a070c0a982f8828ef4102f2fda8b441809b5457410a1ebf1241042e2164759db8812e
data/Rakefile CHANGED
@@ -97,6 +97,7 @@ Rake::TestTask.new(:integration) do |t|
97
97
  gem = Dir.glob("camping*.gem").first
98
98
  exit if gem == nil
99
99
  `cd test/integration`
100
+ `gem install ../../#{gem}`
100
101
  t.libs << "/"
101
102
  t.test_files = FileList['test/test_*.rb']
102
103
  end
@@ -240,76 +240,6 @@ namespace 'test' do
240
240
  t.test_files = FileList['test/test_*.rb']
241
241
  end
242
242
  end
243
- TXT
244
- end
245
-
246
- # writes a test_helper
247
- def make_test_helper
248
- write 'test/test_helper.r', <<-TXT
249
- # Test Helper
250
- $:.unshift File.dirname(__FILE__) + '/../'
251
-
252
- begin
253
- require 'rubygems'
254
- rescue LoadError
255
- end
256
-
257
- require 'minitest/autorun'
258
- require 'rack/test'
259
- require 'minitest/reporters'
260
- require 'minitest/hooks'
261
- Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
262
-
263
- # Default TestCase with some helpers.
264
- # The same stuff we use for Camping itself.
265
- class TestCase < MiniTest::Test
266
- include Rack::Test::Methods
267
- include Minitest::Hooks
268
-
269
- def self.inherited(mod)
270
- mod.app = Object.const_get(mod.to_s[/\w+/])
271
- super
272
- end
273
-
274
- class << self
275
- attr_accessor :app
276
- end
277
-
278
- def setup
279
- super
280
- Camping.make_camp
281
- end
282
-
283
- def body() last_response.body end
284
- def app() self.class.app end
285
-
286
- def response_body() last_response.to_a end
287
-
288
- def assert_reverse
289
- begin
290
- yield
291
- rescue Exception
292
- else
293
- assert false, "Block didn't fail"
294
- end
295
- end
296
-
297
- def assert_body(str, message="")
298
- case str
299
- when Regexp
300
- assert_match(str, last_response.body.strip, message)
301
- else
302
- assert_equal(str.to_s, last_response.body.strip, message)
303
- end
304
- end
305
-
306
- def assert_status(code, message="")
307
- assert_equal(code, last_response.status, message)
308
- end
309
-
310
- def test_silly; end
311
- end
312
-
313
243
  TXT
314
244
  end
315
245
 
@@ -383,7 +313,7 @@ require 'rack/test'
383
313
  require "minitest/reporters"
384
314
  Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
385
315
 
386
- class TestCase < MiniTest::Test
316
+ class TestCase < Minitest::Test
387
317
  include Rack::Test::Methods
388
318
 
389
319
  def self.inherited(mod)
@@ -460,7 +390,6 @@ RUBY
460
390
  Generators::make_readme()
461
391
  Generators::make_public_folder()
462
392
  Generators::make_test_folder()
463
- Generators::make_test_helper()
464
393
 
465
394
  # optionally add omnibus support
466
395
  # add src/ folder
@@ -147,7 +147,7 @@ module Gear
147
147
  # Then parses it, and merges the data based on the current environment.
148
148
  def get_config(provided_config_file = nil)
149
149
 
150
- config_file, kdl_doc, merged_configs = provided_config_file, nil, {}
150
+ config_file, merged_configs = provided_config_file, {}
151
151
  config_file = get_root_config_file() unless provided_config_file != nil
152
152
 
153
153
  # If the config file is just nil then we probably don't have one.
@@ -32,7 +32,7 @@ module Gear
32
32
  rs.chop!
33
33
 
34
34
  symbol = s.to_sym
35
- {s: s, rs: rs, symbol: symbol}
35
+ {rs: rs, symbol: symbol}
36
36
  end
37
37
 
38
38
  # ensures an app exists for the controllers.
@@ -64,7 +64,7 @@ module Gear
64
64
 
65
65
  meth = method.to_s
66
66
 
67
- self.normalize_routes(routes) => {s:, rs:, symbol:}
67
+ self.normalize_routes(routes) => {rs:, symbol:}
68
68
 
69
69
  m = self.ensure_app app
70
70
 
data/lib/camping/tools.rb CHANGED
@@ -39,5 +39,4 @@ module Camping
39
39
  end
40
40
  end
41
41
 
42
- 🏕 = Camping::Tools
43
- CampTools = Camping::Tools
42
+ CampTools = 🏕 = Camping::Tools
@@ -932,7 +932,7 @@ module Camping
932
932
 
933
933
  # setup caller data
934
934
  sp = caller[0].split('`')[0].split(":")
935
- fl, ln, pr = sp[0]+' <Cam\ping App> ' , sp[1].to_i, nil
935
+ fl, ln = sp[0]+' <Cam\ping App> ', sp[1].to_i
936
936
 
937
937
  # Create the app
938
938
  Apps << a = eval(S.gsub(/Camping/,m.to_s), g, fl, 1)
data/lib/camping.rb CHANGED
@@ -27,7 +27,7 @@ def render v,*a,&b;if t=lookup(v);r=@_r;@_r=o=Hash===a[-1]?a.pop: {};s=(t==true)
27
27
  send v,*a,&b}: t.render(self,o[:locals]||{},&b);s=render(L,o.merge(L=>false)){s
28
28
  } if o[L] or o[L].nil?&&lookup(L)&&!r&&v.to_s[0]!=?_;s else raise "no template: #{v}"
29
29
  end end
30
- def mab &b;extend Mab;mab &b;end
30
+ def mab(&b)extend Mab;mab(&b)end
31
31
  def r s,b,h={};b,h=h,b if Hash===b;@status=s;@headers.merge!(h);@body=b end
32
32
  def redirect *a;r 302,'','Location'=>URL(*a).to_s;end
33
33
  def r404 p;P%"#{p} not found"end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+ source 'https://rubygems.org'
3
+
4
+ gem 'camping'
5
+ gem 'puma'
6
+ gem 'rake'
7
+
8
+ group :production do
9
+ gem 'rack-ssl-enforcer'
10
+ end
11
+
12
+ group :development do
13
+ end
14
+
15
+ group :test do
16
+ gem 'minitest', '~> 5.0'
17
+ gem 'minitest-reporters'
18
+ gem 'rack-test'
19
+ gem 'minitest-hooks'
20
+ end
21
+
@@ -0,0 +1,95 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ ansi (1.5.0)
5
+ base64 (0.2.0)
6
+ bigdecimal (3.1.8)
7
+ builder (3.3.0)
8
+ camping (3.2.2)
9
+ dry-logger (~> 1.0.4)
10
+ kdl (~> 1.0, >= 1.0.5)
11
+ listen (~> 3.9.0, >= 3.9.0)
12
+ mab (~> 0.0, >= 0.0.3)
13
+ rack (~> 3.0, >= 3.0.4.1)
14
+ rack-session (~> 2.0, >= 2.0.0)
15
+ rackup (~> 2.1.0)
16
+ rake (~> 13.2.1)
17
+ tilt (~> 2.3.0)
18
+ zeitwerk (~> 2.6.15, >= 2.6.15)
19
+ dry-logger (1.0.4)
20
+ ffi (1.17.0)
21
+ ffi (1.17.0-aarch64-linux-gnu)
22
+ ffi (1.17.0-aarch64-linux-musl)
23
+ ffi (1.17.0-arm-linux-gnu)
24
+ ffi (1.17.0-arm-linux-musl)
25
+ ffi (1.17.0-arm64-darwin)
26
+ ffi (1.17.0-x86-linux-gnu)
27
+ ffi (1.17.0-x86-linux-musl)
28
+ ffi (1.17.0-x86_64-darwin)
29
+ ffi (1.17.0-x86_64-linux-gnu)
30
+ ffi (1.17.0-x86_64-linux-musl)
31
+ kdl (1.0.5)
32
+ base64 (~> 0.2.0)
33
+ bigdecimal (~> 3.1.6)
34
+ racc (~> 1.5)
35
+ simpleidn (~> 0.2.1)
36
+ listen (3.9.0)
37
+ rb-fsevent (~> 0.10, >= 0.10.3)
38
+ rb-inotify (~> 0.9, >= 0.9.10)
39
+ mab (0.0.3)
40
+ minitest (5.23.1)
41
+ minitest-hooks (1.5.1)
42
+ minitest (> 5.3)
43
+ minitest-reporters (1.6.1)
44
+ ansi
45
+ builder
46
+ minitest (>= 5.0)
47
+ ruby-progressbar
48
+ nio4r (2.7.3)
49
+ puma (6.4.2)
50
+ nio4r (~> 2.0)
51
+ racc (1.8.0)
52
+ rack (3.0.11)
53
+ rack-session (2.0.0)
54
+ rack (>= 3.0.0)
55
+ rack-ssl-enforcer (0.2.9)
56
+ rack-test (2.1.0)
57
+ rack (>= 1.3)
58
+ rackup (2.1.0)
59
+ rack (>= 3)
60
+ webrick (~> 1.8)
61
+ rake (13.2.1)
62
+ rb-fsevent (0.11.2)
63
+ rb-inotify (0.11.1)
64
+ ffi (~> 1.0)
65
+ ruby-progressbar (1.13.0)
66
+ simpleidn (0.2.3)
67
+ tilt (2.3.0)
68
+ webrick (1.8.1)
69
+ zeitwerk (2.6.15)
70
+
71
+ PLATFORMS
72
+ aarch64-linux-gnu
73
+ aarch64-linux-musl
74
+ arm-linux-gnu
75
+ arm-linux-musl
76
+ arm64-darwin
77
+ ruby
78
+ x86-linux-gnu
79
+ x86-linux-musl
80
+ x86_64-darwin
81
+ x86_64-linux-gnu
82
+ x86_64-linux-musl
83
+
84
+ DEPENDENCIES
85
+ camping
86
+ minitest (~> 5.0)
87
+ minitest-hooks
88
+ minitest-reporters
89
+ puma
90
+ rack-ssl-enforcer
91
+ rack-test
92
+ rake
93
+
94
+ BUNDLED WITH
95
+ 2.5.11
@@ -0,0 +1,7 @@
1
+ # Camping
2
+ Camping is really fun and I hope you enjoy it.
3
+
4
+ Start camping by running: `camping` in the root directory.
5
+
6
+ To start Camping in development mode run: `camping -e development
7
+
@@ -0,0 +1,16 @@
1
+ # Rakefile
2
+ require 'rake'
3
+ require 'rake/clean'
4
+ require 'rake/testtask'
5
+ require 'tempfile'
6
+ require 'open3'
7
+
8
+ task :default => :test
9
+ task :test => 'test:all'
10
+
11
+ namespace 'test' do
12
+ Rake::TestTask.new('all') do |t|
13
+ t.libs << 'test'
14
+ t.test_files = FileList['test/test_*.rb']
15
+ end
16
+ end
@@ -0,0 +1,47 @@
1
+ require 'camping'
2
+
3
+ Camping.goes :Dummy
4
+
5
+ module Dummy
6
+ module Models
7
+ end
8
+
9
+ module Controllers
10
+ class Index
11
+ def get
12
+ @title = "Dummy"
13
+ render :index
14
+ end
15
+ end
16
+ end
17
+
18
+ module Helpers
19
+ end
20
+
21
+ module Views
22
+
23
+ def layout
24
+ html do
25
+ head do
26
+ title 'Dummy'
27
+ link :rel => 'stylesheet', :type => 'text/css',
28
+ :href => '/styles.css', :media => 'screen'
29
+ end
30
+ body do
31
+ h1 'Dummy'
32
+
33
+ div.wrapper! do
34
+ self << yield
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ def index
41
+ h2 "Let's go Camping"
42
+ end
43
+
44
+ end
45
+
46
+ end
47
+
@@ -0,0 +1,2 @@
1
+ // config.kdl
2
+ hostname "localhost"
@@ -0,0 +1,64 @@
1
+ # Test Helper
2
+ $:.unshift File.dirname(__FILE__) + '/../'
3
+
4
+ begin
5
+ require 'rubygems'
6
+ rescue LoadError
7
+ end
8
+
9
+ require 'minitest/autorun'
10
+ require 'rack/test'
11
+ require 'minitest/reporters'
12
+ require 'minitest/hooks'
13
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
14
+
15
+ # Default TestCase with some helpers.
16
+ # The same stuff we use for Camping itself.
17
+ class TestCase < MiniTest::Test
18
+ include Rack::Test::Methods
19
+ include Minitest::Hooks
20
+
21
+ def self.inherited(mod)
22
+ mod.app = Object.const_get(mod.to_s[/w+/])
23
+ super
24
+ end
25
+
26
+ class << self
27
+ attr_accessor :app
28
+ end
29
+
30
+ def setup
31
+ super
32
+ Camping.make_camp
33
+ end
34
+
35
+ def body() last_response.body end
36
+ def app() self.class.app end
37
+
38
+ def response_body() last_response.to_a end
39
+
40
+ def assert_reverse
41
+ begin
42
+ yield
43
+ rescue Exception
44
+ else
45
+ assert false, "Block didn't fail"
46
+ end
47
+ end
48
+
49
+ def assert_body(str, message="")
50
+ case str
51
+ when Regexp
52
+ assert_match(str, last_response.body.strip, message)
53
+ else
54
+ assert_equal(str.to_s, last_response.body.strip, message)
55
+ end
56
+ end
57
+
58
+ def assert_status(code, message="")
59
+ assert_equal(code, last_response.status, message)
60
+ end
61
+
62
+ def test_silly; end
63
+ end
64
+
@@ -0,0 +1,56 @@
1
+ $:.unshift File.dirname(__FILE__) + '/../'
2
+ # shift to act like we're in the regular degular directory
3
+
4
+ begin
5
+ require 'rubygems'
6
+ rescue LoadError
7
+ end
8
+
9
+ require 'camping'
10
+ require 'minitest/autorun'
11
+ require 'minitest'
12
+ require 'rack/test'
13
+ require "minitest/reporters"
14
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
15
+
16
+ class TestCase < MiniTest::Test
17
+ include Rack::Test::Methods
18
+
19
+ def self.inherited(mod)
20
+ mod.app = Object.const_get(mod.to_s[/w+/])
21
+ super
22
+ end
23
+
24
+ class << self
25
+ attr_accessor :app
26
+ end
27
+
28
+ def body() last_response.body end
29
+ def app() self.class.app end
30
+
31
+ def assert_reverse
32
+ begin
33
+ yield
34
+ rescue Exception
35
+ else
36
+ assert false, "Block didn't fail"
37
+ end
38
+ end
39
+
40
+ def assert_body(str)
41
+ case str
42
+ when Regexp
43
+ assert_match(str, last_response.body.strip)
44
+ else
45
+ assert_equal(str.to_s, last_response.body.strip)
46
+ end
47
+ end
48
+
49
+ def assert_status(code)
50
+ assert_equal(code, last_response.status)
51
+ end
52
+
53
+ def test_silly; end
54
+
55
+ end
56
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camping
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - why the lucky stiff
@@ -286,10 +286,19 @@ files:
286
286
  - test/apps/sessions.rb
287
287
  - test/config_reloader.rb
288
288
  - test/gear/gear_nancy.rb
289
+ - test/integration/Gemfile
290
+ - test/integration/Gemfile.lock
291
+ - test/integration/README.md
292
+ - test/integration/Rakefile
293
+ - test/integration/camp.rb
294
+ - test/integration/config.kdl
295
+ - test/integration/test/test_helper.r
296
+ - test/integration/test/test_helper.rb
289
297
  - test/reload_reloader.rb
290
298
  - test/test_helper.rb
291
299
  homepage: http://rubycamping.org/
292
- licenses: []
300
+ licenses:
301
+ - MIT
293
302
  metadata: {}
294
303
  post_install_message:
295
304
  rdoc_options: