eldr 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +28 -0
  4. data/.rubocop_todo.yml +15 -0
  5. data/.travis.yml +3 -0
  6. data/DUCK.md +15 -0
  7. data/Gemfile +3 -0
  8. data/Gemfile.lock +89 -0
  9. data/LICENSE +20 -0
  10. data/README.md +876 -0
  11. data/Rakefile +9 -0
  12. data/TODOS +3 -0
  13. data/eldr.gemspec +36 -0
  14. data/examples/README.md +7 -0
  15. data/examples/action_objects.ru +28 -0
  16. data/examples/app.ru +75 -0
  17. data/examples/builder.ru +24 -0
  18. data/examples/custom_response.ru +23 -0
  19. data/examples/errors.ru +16 -0
  20. data/examples/hello_world.ru +8 -0
  21. data/examples/inheritance.ru +22 -0
  22. data/examples/multiple_apps.ru +30 -0
  23. data/examples/rails_style_routing.ru +14 -0
  24. data/examples/rendering_templates.ru +38 -0
  25. data/examples/views/cats.slim +1 -0
  26. data/lib/eldr/app.rb +146 -0
  27. data/lib/eldr/builder.rb +60 -0
  28. data/lib/eldr/configuration.rb +37 -0
  29. data/lib/eldr/matcher.rb +36 -0
  30. data/lib/eldr/recognizer.rb +35 -0
  31. data/lib/eldr/route.rb +92 -0
  32. data/lib/eldr/version.rb +3 -0
  33. data/lib/eldr.rb +1 -0
  34. data/spec/app_spec.rb +194 -0
  35. data/spec/builder_spec.rb +11 -0
  36. data/spec/configuration_spec.rb +29 -0
  37. data/spec/examples/action_objects_spec.rb +18 -0
  38. data/spec/examples/builder_spec.rb +16 -0
  39. data/spec/examples/custom_response_spec.rb +17 -0
  40. data/spec/examples/errors_spec.rb +18 -0
  41. data/spec/examples/example_app_spec.rb +98 -0
  42. data/spec/examples/hello_world_spec.rb +17 -0
  43. data/spec/examples/inheritance_spec.rb +23 -0
  44. data/spec/examples/multiple_apps_spec.rb +31 -0
  45. data/spec/examples/rails_style_routing_spec.rb +17 -0
  46. data/spec/examples/rendering_templates_spec.rb +26 -0
  47. data/spec/matcher_spec.rb +21 -0
  48. data/spec/readme_definitions.yml +28 -0
  49. data/spec/readme_spec.rb +117 -0
  50. data/spec/recognizer_spec.rb +32 -0
  51. data/spec/route_spec.rb +131 -0
  52. data/spec/spec_helper.rb +14 -0
  53. metadata +252 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 62853ff7cf74b4524fc39707ea31d04b87a64003
4
+ data.tar.gz: 1a287394bda09d5875dcbb6e2c29ee2668fa8887
5
+ SHA512:
6
+ metadata.gz: aa76de56c6f837ebd0b30713d9240bd458db916aa0de55f4fd97e62dd262101313eb3440c2bcb1da6033ac10297e463eeedaabbb65812e2c60bfaf5033cb7881
7
+ data.tar.gz: bf72f0dae00dcdd3828c83a43d5c02876260cc3a318978ed1fddc24001924467ff5f85e776e996716065fc0f83c8242c9f1ff3b658449d6016fe2d66d06847e5
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format progress
3
+ --require ./spec/spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,28 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ Style/AndOr:
4
+ Enabled: false
5
+
6
+ Metrics/AbcSize:
7
+ Max: 40
8
+
9
+ Metrics/MethodLength:
10
+ Max: 20
11
+
12
+ Metrics/ClassLength:
13
+ Max: 130
14
+
15
+ Metrics/LineLength:
16
+ Max: 120
17
+
18
+ Style/SignalException:
19
+ Enabled: false
20
+
21
+ AllCops:
22
+ Exclude:
23
+ - 'db/**/*'
24
+ - 'config/**/*'
25
+ - 'script/**/*'
26
+ - 'spec/**/*'
27
+ - 'Gemfile'
28
+ - 'eldr.gemspec'
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,15 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2015-01-24 18:09:30 -0800 using RuboCop version 0.28.0.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # Offense count: 1
9
+ # Configuration parameters: CountKeywordArgs.
10
+ Metrics/ParameterLists:
11
+ Max: 6
12
+
13
+ # Offense count: 6
14
+ Style/Documentation:
15
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
data/DUCK.md ADDED
@@ -0,0 +1,15 @@
1
+ ### Perfomance Thoughts
2
+
3
+ We can get a lot of extra perfomance by using a C extension for parsing parameters.
4
+
5
+ Hashie::Mash is fucking slow. Need to switch to own custom class.
6
+ Use method_missing to support returning nil by default. Store everything on a hash table.
7
+
8
+ Looping through the routes takes a lot of time Instance verb methods will call self.add
9
+
10
+ Need to decrease memory usage a bit.
11
+ Instead of storing router on every route we pass it to the call method.
12
+ Dropping the inheritance of Pendragon and the monkey patching should help too.
13
+
14
+ Rack::Response is also slow. In the real world Rack::Response is used constantly;
15
+ so we cant expect to be any faster than it. The solution is to improve it's speed.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+ ruby '2.1.5'
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,89 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ eldr (0.0.2)
5
+ fast_blank (= 0.0.2)
6
+ mustermann (= 0.4.0)
7
+ rack (~> 1.5)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ ast (2.0.0)
13
+ astrolabe (1.3.0)
14
+ parser (>= 2.2.0.pre.3, < 3.0)
15
+ coveralls (0.7.3)
16
+ multi_json (~> 1.10)
17
+ rest-client (~> 1.7)
18
+ simplecov (~> 0.9.1)
19
+ term-ansicolor (~> 1.3)
20
+ thor (~> 0.19.1)
21
+ diff-lcs (1.2.5)
22
+ docile (1.1.5)
23
+ fast_blank (0.0.2)
24
+ mime-types (2.4.3)
25
+ multi_json (1.10.1)
26
+ mustermann (0.4.0)
27
+ tool (~> 0.2)
28
+ netrc (0.10.2)
29
+ parser (2.2.0.pre.8)
30
+ ast (>= 1.1, < 3.0)
31
+ slop (~> 3.4, >= 3.4.5)
32
+ powerpack (0.0.9)
33
+ rack (1.6.0)
34
+ rack-test (0.6.2)
35
+ rack (>= 1.0)
36
+ rainbow (2.0.0)
37
+ rake (10.4.2)
38
+ rest-client (1.7.2)
39
+ mime-types (>= 1.16, < 3.0)
40
+ netrc (~> 0.7)
41
+ rspec (3.1.0)
42
+ rspec-core (~> 3.1.0)
43
+ rspec-expectations (~> 3.1.0)
44
+ rspec-mocks (~> 3.1.0)
45
+ rspec-core (3.1.7)
46
+ rspec-support (~> 3.1.0)
47
+ rspec-expectations (3.1.2)
48
+ diff-lcs (>= 1.2.0, < 2.0)
49
+ rspec-support (~> 3.1.0)
50
+ rspec-mocks (3.1.3)
51
+ rspec-support (~> 3.1.0)
52
+ rspec-support (3.1.2)
53
+ rubocop (0.28.0)
54
+ astrolabe (~> 1.3)
55
+ parser (>= 2.2.0.pre.7, < 3.0)
56
+ powerpack (~> 0.0.6)
57
+ rainbow (>= 1.99.1, < 3.0)
58
+ ruby-progressbar (~> 1.4)
59
+ ruby-progressbar (1.7.1)
60
+ simplecov (0.9.1)
61
+ docile (~> 1.1.0)
62
+ multi_json (~> 1.0)
63
+ simplecov-html (~> 0.8.0)
64
+ simplecov-html (0.8.0)
65
+ slim (3.0.1)
66
+ temple (~> 0.7.3)
67
+ tilt (>= 1.3.3, < 2.1)
68
+ slop (3.6.0)
69
+ temple (0.7.4)
70
+ term-ansicolor (1.3.0)
71
+ tins (~> 1.0)
72
+ thor (0.19.1)
73
+ tilt (2.0.1)
74
+ tins (1.3.3)
75
+ tool (0.2.3)
76
+
77
+ PLATFORMS
78
+ ruby
79
+
80
+ DEPENDENCIES
81
+ bundler (~> 1.7)
82
+ coveralls (~> 0.7)
83
+ eldr!
84
+ rack-test (= 0.6.2)
85
+ rake (= 10.4.2)
86
+ rspec (= 3.1.0)
87
+ rubocop (= 0.28.0)
88
+ slim (= 3.0.1)
89
+ tilt (= 2.0.1)
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 K-2052
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.