jun 0.1.0 → 0.3.1

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 +4 -4
  2. data/README.md +18 -15
  3. data/jun.gemspec +4 -4
  4. data/lib/jun/action_controller/base.rb +6 -10
  5. data/lib/jun/action_controller/callbacks.rb +46 -0
  6. data/lib/jun/action_controller/metal.rb +22 -0
  7. data/lib/jun/action_controller/redirecting.rb +17 -0
  8. data/lib/jun/action_controller/rendering.rb +0 -4
  9. data/lib/jun/action_dispatch/routing/mapper.rb +28 -3
  10. data/lib/jun/action_dispatch/routing/route_set.rb +49 -2
  11. data/lib/jun/action_dispatch/routing/welcome.html.erb +59 -0
  12. data/lib/jun/{active_record.rb → active_record/base.rb} +14 -3
  13. data/lib/jun/active_record/migration.rb +76 -0
  14. data/lib/jun/active_record/migrator.rb +80 -0
  15. data/lib/jun/active_record/persistence.rb +60 -0
  16. data/lib/jun/active_record/relation.rb +42 -0
  17. data/lib/jun/active_support/core_ext/array/access.rb +33 -0
  18. data/lib/jun/active_support/core_ext/array/conversion.rb +18 -0
  19. data/lib/jun/active_support/core_ext/hash/transformation.rb +29 -0
  20. data/lib/jun/active_support/core_ext/string/access.rb +42 -0
  21. data/lib/jun/active_support/{inflector.rb → core_ext/string/inflector.rb} +18 -0
  22. data/lib/jun/active_support/core_ext.rb +5 -0
  23. data/lib/jun/active_support/dependencies.rb +2 -0
  24. data/lib/jun/application.rb +31 -0
  25. data/lib/jun/cli/commands/db/create.rb +21 -1
  26. data/lib/jun/cli/commands/db/drop.rb +4 -1
  27. data/lib/jun/cli/commands/db/migrate.rb +1 -1
  28. data/lib/jun/cli/commands/db/rollback.rb +15 -0
  29. data/lib/jun/cli/commands/db/schema/dump.rb +24 -0
  30. data/lib/jun/cli/commands/db/schema/load.rb +43 -0
  31. data/lib/jun/cli/commands/db/seed.rb +19 -0
  32. data/lib/jun/cli/commands/generate/migration.rb +27 -0
  33. data/lib/jun/cli/commands/new.rb +7 -2
  34. data/lib/jun/cli/commands/server.rb +1 -1
  35. data/lib/jun/cli/generator_templates/migration.rb.erb +11 -0
  36. data/lib/jun/cli/{generators/new → generator_templates/new_app}/Gemfile.erb +0 -0
  37. data/lib/jun/cli/{generators/new → generator_templates/new_app}/README.md.erb +0 -0
  38. data/lib/jun/cli/{generators/new → generator_templates/new_app}/app/controllers/application_controller.rb.erb +0 -0
  39. data/lib/jun/cli/{generators/new → generator_templates/new_app}/app/helpers/application_helper.rb.erb +0 -0
  40. data/lib/jun/cli/generator_templates/new_app/app/models/application_record.rb.erb +4 -0
  41. data/lib/jun/cli/{generators/new → generator_templates/new_app}/app/views/layouts/application.html.erb.erb +0 -0
  42. data/lib/jun/cli/generator_templates/new_app/bin/console.erb +8 -0
  43. data/lib/jun/cli/generator_templates/new_app/config/application.rb.erb +12 -0
  44. data/lib/jun/cli/generator_templates/new_app/config/environment.rb.erb +7 -0
  45. data/lib/jun/cli/{generators/new → generator_templates/new_app}/config/routes.rb.erb +0 -0
  46. data/lib/jun/cli/{generators/new → generator_templates/new_app}/config.ru.erb +1 -2
  47. data/lib/jun/cli/generator_templates/new_app/db/seeds.rb.erb +9 -0
  48. data/lib/jun/cli.rb +5 -0
  49. data/lib/jun/version.rb +1 -1
  50. data/lib/jun.rb +13 -2
  51. metadata +48 -26
  52. data/lib/jun/cli/generators/new/config/application.rb.erb +0 -18
  53. data/lib/jun/cli/generators/new/db/app.db.erb +0 -0
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoran
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-16 00:00:00.000000000 Z
11
+ date: 2022-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2.2'
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: '0'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tilt
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.4'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.14'
111
- description: A simple web framework inspired by Rails.
111
+ description: A simple web framework inspired by Rails. Not meant for production use.
112
112
  email:
113
113
  - zspesic@gmail.com
114
114
  executables:
@@ -127,33 +127,55 @@ files:
127
127
  - jun.gemspec
128
128
  - lib/jun.rb
129
129
  - lib/jun/action_controller/base.rb
130
+ - lib/jun/action_controller/callbacks.rb
131
+ - lib/jun/action_controller/metal.rb
132
+ - lib/jun/action_controller/redirecting.rb
130
133
  - lib/jun/action_controller/rendering.rb
131
134
  - lib/jun/action_dispatch/routing/mapper.rb
132
135
  - lib/jun/action_dispatch/routing/route_set.rb
136
+ - lib/jun/action_dispatch/routing/welcome.html.erb
133
137
  - lib/jun/action_view/base.rb
134
138
  - lib/jun/action_view/helpers.rb
135
139
  - lib/jun/action_view/helpers/url_helper.rb
136
- - lib/jun/active_record.rb
140
+ - lib/jun/active_record/base.rb
141
+ - lib/jun/active_record/migration.rb
142
+ - lib/jun/active_record/migrator.rb
143
+ - lib/jun/active_record/persistence.rb
144
+ - lib/jun/active_record/relation.rb
145
+ - lib/jun/active_support/core_ext.rb
146
+ - lib/jun/active_support/core_ext/array/access.rb
147
+ - lib/jun/active_support/core_ext/array/conversion.rb
148
+ - lib/jun/active_support/core_ext/hash/transformation.rb
149
+ - lib/jun/active_support/core_ext/string/access.rb
150
+ - lib/jun/active_support/core_ext/string/inflector.rb
137
151
  - lib/jun/active_support/dependencies.rb
138
- - lib/jun/active_support/inflector.rb
139
152
  - lib/jun/application.rb
140
153
  - lib/jun/cli.rb
141
154
  - lib/jun/cli/commands/base.rb
142
155
  - lib/jun/cli/commands/db/create.rb
143
156
  - lib/jun/cli/commands/db/drop.rb
144
157
  - lib/jun/cli/commands/db/migrate.rb
158
+ - lib/jun/cli/commands/db/rollback.rb
159
+ - lib/jun/cli/commands/db/schema/dump.rb
160
+ - lib/jun/cli/commands/db/schema/load.rb
161
+ - lib/jun/cli/commands/db/seed.rb
162
+ - lib/jun/cli/commands/generate/migration.rb
145
163
  - lib/jun/cli/commands/new.rb
146
164
  - lib/jun/cli/commands/server.rb
147
165
  - lib/jun/cli/commands/version.rb
148
- - lib/jun/cli/generators/new/Gemfile.erb
149
- - lib/jun/cli/generators/new/README.md.erb
150
- - lib/jun/cli/generators/new/app/controllers/application_controller.rb.erb
151
- - lib/jun/cli/generators/new/app/helpers/application_helper.rb.erb
152
- - lib/jun/cli/generators/new/app/views/layouts/application.html.erb.erb
153
- - lib/jun/cli/generators/new/config.ru.erb
154
- - lib/jun/cli/generators/new/config/application.rb.erb
155
- - lib/jun/cli/generators/new/config/routes.rb.erb
156
- - lib/jun/cli/generators/new/db/app.db.erb
166
+ - lib/jun/cli/generator_templates/migration.rb.erb
167
+ - lib/jun/cli/generator_templates/new_app/Gemfile.erb
168
+ - lib/jun/cli/generator_templates/new_app/README.md.erb
169
+ - lib/jun/cli/generator_templates/new_app/app/controllers/application_controller.rb.erb
170
+ - lib/jun/cli/generator_templates/new_app/app/helpers/application_helper.rb.erb
171
+ - lib/jun/cli/generator_templates/new_app/app/models/application_record.rb.erb
172
+ - lib/jun/cli/generator_templates/new_app/app/views/layouts/application.html.erb.erb
173
+ - lib/jun/cli/generator_templates/new_app/bin/console.erb
174
+ - lib/jun/cli/generator_templates/new_app/config.ru.erb
175
+ - lib/jun/cli/generator_templates/new_app/config/application.rb.erb
176
+ - lib/jun/cli/generator_templates/new_app/config/environment.rb.erb
177
+ - lib/jun/cli/generator_templates/new_app/config/routes.rb.erb
178
+ - lib/jun/cli/generator_templates/new_app/db/seeds.rb.erb
157
179
  - lib/jun/connection_adapters/sqlite_adapter.rb
158
180
  - lib/jun/version.rb
159
181
  homepage: https://github.com/zokioki/jun
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "jun"
4
-
5
- Jun::ActiveSupport::Dependencies.autoload_paths += Jun.root.join("app").children
6
-
7
- # Include all helpers in app/helpers directory
8
- Dir.glob(Jun.root.join("app/helpers/**/*.rb")).each do |filepath|
9
- helper_class_name = File.basename(filepath, ".rb").camelize
10
- helper_class = Object.const_get(helper_class_name)
11
-
12
- Jun::ActionView::Base.include(helper_class)
13
- end
14
-
15
- module <%= app_name.camelize %>
16
- class Application < Jun::Application
17
- end
18
- end
File without changes