atd 0.2.0.TEST.GITLAB1 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +5 -1
  3. data/README.md +22 -0
  4. data/lib/atd/version.rb +1 -1
  5. data/lib/atd.rb +7 -1
  6. metadata +29 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5aee51c24722e0377807e99f47cbe847ceab08db
4
- data.tar.gz: 7ce85f825e084f24fdcebd4bfe1ae835af651959
3
+ metadata.gz: 2b56849012d758725dd43a64adb95b444ccc1463
4
+ data.tar.gz: 191e644b14b1e580d287fdf9bbf3f57ff575ed2d
5
5
  SHA512:
6
- metadata.gz: cea8be538401bbc9e7c466928afc3bb8357b8d5b9feababd544373c91630bf52e6ad77f220e9a6606f463322505b511ed7bbff51d60bfa86bb83d78bf588c004
7
- data.tar.gz: 9a6f3bd0188a78d9706c473d4446992ab2f758d18a16d6524f088e4057ddedf76ed09c3d7ab2b92da418dd33e06b53a7987d82bf5073f8c85ea50b0b9896d107
6
+ metadata.gz: 88469bdf52fa8fdcab4991a76237ee5e60423140c22b59e633cfdced92d670e8c1a986ef6fb77b9a41a8d219e414431725e20ad2c4ba021687ed7c80cd508620
7
+ data.tar.gz: ddd182383a818a671fcf998ae14d2f0f6d0b4db9021f52037798e416a6fd22be8273b5f27c581675d611b5dd785bc687fe6c8d016344b7b537b037a06fbbee51
data/CHANGELOG CHANGED
@@ -1,4 +1,8 @@
1
- Repository Version:
1
+ v0.3.1:
2
+ - Skipped bugfix version because v0.3.0 was yanked.
3
+ - Added controller structure
4
+ - Added examples in atd-examples repository
5
+ - Began using Gitlab issues for feature tracking and release tracking
2
6
 
3
7
  v0.2.0
4
8
  - Changed git workflow, now with 2 branches.
data/README.md CHANGED
@@ -12,6 +12,28 @@
12
12
  [gem version badge]: https://img.shields.io/gem/v/atd.svg?style=flat-square
13
13
  [gem version link]: https://rubygems.org/gems/atd
14
14
 
15
+
16
+ [ATD](#atd)
17
+ - [Installation](#installation)
18
+ - [Usage](#usage)
19
+ - [Setup](#setup)
20
+ - [Routing](#routing)
21
+ - [Basic Routing](#basic-routing)
22
+ - [Advanced Routing](#advanced-routing)
23
+ - [DefaultApp](#defaultapp)
24
+ - [Inheritance](#inheritance)
25
+ - [@http](#http)
26
+ - [Apps](#apps)
27
+ - [App Creation](#app-creation)
28
+ - [Starting the App](#starting-the-app)
29
+ - [App Routing](#app-routing)
30
+ - [Logging](#logging)
31
+ - [Compilation](#compilation)
32
+ - [Documentation](#documentation)
33
+ - [Development](#development)
34
+ - [Contributing](#contributing)
35
+
36
+
15
37
  # ATD
16
38
 
17
39
  ATD is a new web development backend framework for Ruby. It is built on top of rack, and is meant to be small easy and light. That is why it provides a very minimalist way of writing your backend. It treats a request as a request, without splitting it based on the HTTP method.
data/lib/atd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ATD
2
- VERSION = "0.2.0.TEST.GITLAB1".freeze # The current version number of {ATD}.
2
+ VERSION = "0.3.1".freeze # The current version number of {ATD}.
3
3
  end
data/lib/atd.rb CHANGED
@@ -20,7 +20,7 @@ module ATD
20
20
  # So called because each instance stores a route, and will be called if that route is reached.
21
21
  # A route for the purposes of {ATD} is a parser that will be fed env in {ATD::App#call the rack app}.
22
22
  class Route
23
- attr_accessor :args, :method, :block, :path, :output, :app
23
+ attr_accessor :args, :method, :block, :path, :output, :app, :actions
24
24
 
25
25
  # The first two arguments must me the path and the output.
26
26
  def initialize(*args, &block)
@@ -99,6 +99,11 @@ module ATD
99
99
  @path = args.shift if @path.nil?
100
100
  @output = args.shift if @output.nil?
101
101
  @args = Array(@args).concat(args) - [nil] unless args.nil?
102
+ if @output =~ /^\w*#\w*$/ # Check if @path is a controller#action combo
103
+ controller, action = @output.split("#")
104
+ @action = Object.const_get(controller.to_sym).method(action.to_sym)
105
+ @output = @action.call
106
+ end
102
107
  @method -= Array(args.last[:ignore]) if args.last.is_a?(Hash) && !args.last[:ignore].nil?
103
108
  self
104
109
  end
@@ -161,6 +166,7 @@ module ATD
161
166
  current_route[:filename] = filename
162
167
  block = current_route[:block]
163
168
  current_route[:block] = define_singleton_method(block.object_id.to_s.tr("0-9", "a-j").to_sym, &block) unless block.nil?
169
+ current_route[:block] = route.actions unless route.actions.nil?
164
170
  @routes = @routes.to_h.deep_merge(route_hash)
165
171
  end
166
172
  end
metadata CHANGED
@@ -1,153 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.TEST.GITLAB1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ACecretMaster
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-10 00:00:00.000000000 Z
11
+ date: 2016-10-11 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
19
  version: '2.0'
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
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: webrick
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
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
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.12'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.12'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '10.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '5.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '5.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: minitest-reporters
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.1'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.1'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: yard
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0.9'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0.9'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rack-test
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0.6'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0.6'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: simplecov
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ~>
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0.12'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ~>
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0.12'
153
153
  description:
@@ -157,9 +157,9 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
- - ".gitignore"
161
- - ".gitlab-ci.yml"
162
- - ".rubocop.yml"
160
+ - .gitignore
161
+ - .gitlab-ci.yml
162
+ - .rubocop.yml
163
163
  - CHANGELOG
164
164
  - CODE_OF_CONDUCT.md
165
165
  - Gemfile
@@ -185,17 +185,17 @@ require_paths:
185
185
  - lib
186
186
  required_ruby_version: !ruby/object:Gem::Requirement
187
187
  requirements:
188
- - - ">="
188
+ - - '>='
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  requirements:
193
- - - ">"
193
+ - - '>='
194
194
  - !ruby/object:Gem::Version
195
- version: 1.3.1
195
+ version: '0'
196
196
  requirements: []
197
197
  rubyforge_project:
198
- rubygems_version: 2.5.1
198
+ rubygems_version: 2.0.14.1
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: The assistant technical director of your website. It does the dirty work