katapult 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/Guardfile +11 -0
- data/LICENSE.txt +22 -0
- data/README.md +122 -0
- data/Rakefile +14 -0
- data/bin/katapult +44 -0
- data/features/binary.feature +48 -0
- data/features/configuration.feature +24 -0
- data/features/katapult.feature +201 -0
- data/features/model.feature +203 -0
- data/features/navigation.feature +80 -0
- data/features/step_definitions/db_steps.rb +8 -0
- data/features/step_definitions/file_steps.rb +14 -0
- data/features/step_definitions/katapult_steps.rb +14 -0
- data/features/step_definitions/rails_steps.rb +44 -0
- data/features/step_definitions/test_steps.rb +7 -0
- data/features/support/env.rb +16 -0
- data/features/wui.feature +319 -0
- data/katapult.gemspec +35 -0
- data/katapult.png +0 -0
- data/lib/generators/katapult/basics/basics_generator.rb +95 -0
- data/lib/generators/katapult/basics/templates/Gemfile +76 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application.css.sass +6 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_all.css.sass +4 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_items.css.sass +11 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_layout.css.sass +26 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_navigation.css.sass +11 -0
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_tools.css.sass +12 -0
- data/lib/generators/katapult/basics/templates/config/database.sample.yml +16 -0
- data/lib/generators/katapult/basics/templates/config/database.yml +13 -0
- data/lib/generators/katapult/basics/templates/config/spring.rb +3 -0
- data/lib/generators/katapult/basics/templates/features/support/env-custom.rb +3 -0
- data/lib/generators/katapult/basics/templates/features/support/paths.rb +47 -0
- data/lib/generators/katapult/cucumber_features/cucumber_features_generator.rb +23 -0
- data/lib/generators/katapult/cucumber_features/templates/feature.feature +59 -0
- data/lib/generators/katapult/haml/haml_generator.rb +90 -0
- data/lib/generators/katapult/haml/templates/_form.html.haml +38 -0
- data/lib/generators/katapult/haml/templates/app/views/layouts/application.html.haml +25 -0
- data/lib/generators/katapult/haml/templates/custom_action.html.haml +5 -0
- data/lib/generators/katapult/haml/templates/edit.html.haml +4 -0
- data/lib/generators/katapult/haml/templates/index.html.haml +29 -0
- data/lib/generators/katapult/haml/templates/new.html.haml +4 -0
- data/lib/generators/katapult/haml/templates/show.html.haml +41 -0
- data/lib/generators/katapult/install/install_generator.rb +14 -0
- data/lib/generators/katapult/install/templates/lib/katapult/application_model.rb +18 -0
- data/lib/generators/katapult/model/model_generator.rb +59 -0
- data/lib/generators/katapult/model/templates/app/models/shared/does_flag.rb +32 -0
- data/lib/generators/katapult/model/templates/model.rb +21 -0
- data/lib/generators/katapult/model_specs/model_specs_generator.rb +51 -0
- data/lib/generators/katapult/model_specs/templates/model_spec.rb +34 -0
- data/lib/generators/katapult/navigation/navigation_generator.rb +25 -0
- data/lib/generators/katapult/navigation/templates/app/models/navigation.rb +12 -0
- data/lib/generators/katapult/transform/transform_generator.rb +47 -0
- data/lib/generators/katapult/w_u_i/templates/_route.rb +13 -0
- data/lib/generators/katapult/w_u_i/templates/controller.rb +106 -0
- data/lib/generators/katapult/w_u_i/w_u_i_generator.rb +57 -0
- data/lib/katapult.rb +5 -0
- data/lib/katapult/action.rb +44 -0
- data/lib/katapult/application_model.rb +45 -0
- data/lib/katapult/attribute.rb +83 -0
- data/lib/katapult/element.rb +72 -0
- data/lib/katapult/generator.rb +28 -0
- data/lib/katapult/model.rb +33 -0
- data/lib/katapult/navigation.rb +22 -0
- data/lib/katapult/parser.rb +39 -0
- data/lib/katapult/util.rb +16 -0
- data/lib/katapult/version.rb +3 -0
- data/lib/katapult/wui.rb +77 -0
- data/script/console +16 -0
- data/spec/action_spec.rb +44 -0
- data/spec/attribute_spec.rb +48 -0
- data/spec/model_spec.rb +18 -0
- data/spec/spec_helper.rb +19 -0
- data/spec/util_spec.rb +23 -0
- data/spec/wui_spec.rb +49 -0
- metadata +253 -0
data/spec/util_spec.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'katapult/util'
|
3
|
+
|
4
|
+
describe Katapult::Util do
|
5
|
+
|
6
|
+
describe '#git_commit' do
|
7
|
+
it 'adds all files before committing' do
|
8
|
+
Katapult::Util.should_receive(:system).with(/git add --all; git commit/)
|
9
|
+
Katapult::Util.git_commit 'test'
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'sets "katapult" as commit author' do
|
13
|
+
Katapult::Util.should_receive(:system).with(/git commit.*--author='katapult \<katapult@makandra\.com\>'/)
|
14
|
+
Katapult::Util.git_commit 'test'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'sanitizes the commit message' do
|
18
|
+
Katapult::Util.should_receive(:system).with(/git commit -m '"hack0r"'/)
|
19
|
+
Katapult::Util.git_commit "\"hack''''0r\""
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/spec/wui_spec.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'katapult/wui'
|
3
|
+
require 'katapult/model'
|
4
|
+
require 'katapult/application_model'
|
5
|
+
|
6
|
+
describe Katapult::WUI do
|
7
|
+
|
8
|
+
subject { described_class.new 'wui' }
|
9
|
+
|
10
|
+
let(:application_model) { Katapult::ApplicationModel.new }
|
11
|
+
|
12
|
+
describe '#path' do
|
13
|
+
it 'raises an error if the given action does not exist' do
|
14
|
+
expect do
|
15
|
+
subject.path(:foobar)
|
16
|
+
end.to raise_error(Katapult::WUI::UnknownActionError)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#model' do
|
21
|
+
it 'returns the model object' do
|
22
|
+
subject = described_class.new('Customer', model: 'User')
|
23
|
+
model = Katapult::Model.new('User')
|
24
|
+
|
25
|
+
application_model.add_wui(subject)
|
26
|
+
application_model.add_model(model)
|
27
|
+
|
28
|
+
expect(subject.model).to eql(model)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'detects the model from its own name, if not stated explicitly' do
|
32
|
+
subject = described_class.new('Customer')
|
33
|
+
model = Katapult::Model.new('Customer')
|
34
|
+
|
35
|
+
application_model.add_wui(subject)
|
36
|
+
application_model.add_model(model)
|
37
|
+
|
38
|
+
expect(subject.model).to eql(model)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'raises an error if it cannot find the model' do
|
42
|
+
subject = described_class.new('MissingModel')
|
43
|
+
application_model.add_wui(subject)
|
44
|
+
|
45
|
+
expect{ subject.model }.to raise_error(Katapult::WUI::UnknownModelError)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,253 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: katapult
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dominik Schöler
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: spring
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: aruba
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard-cucumber
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Katapult is a framework for generating base code
|
126
|
+
email:
|
127
|
+
- dominik.schoeler@makandra.de
|
128
|
+
executables:
|
129
|
+
- katapult
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- ".ruby-version"
|
136
|
+
- Gemfile
|
137
|
+
- Guardfile
|
138
|
+
- LICENSE.txt
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- bin/katapult
|
142
|
+
- features/binary.feature
|
143
|
+
- features/configuration.feature
|
144
|
+
- features/katapult.feature
|
145
|
+
- features/model.feature
|
146
|
+
- features/navigation.feature
|
147
|
+
- features/step_definitions/db_steps.rb
|
148
|
+
- features/step_definitions/file_steps.rb
|
149
|
+
- features/step_definitions/katapult_steps.rb
|
150
|
+
- features/step_definitions/rails_steps.rb
|
151
|
+
- features/step_definitions/test_steps.rb
|
152
|
+
- features/support/env.rb
|
153
|
+
- features/wui.feature
|
154
|
+
- katapult.gemspec
|
155
|
+
- katapult.png
|
156
|
+
- lib/generators/katapult/basics/basics_generator.rb
|
157
|
+
- lib/generators/katapult/basics/templates/Gemfile
|
158
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application.css.sass
|
159
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_all.css.sass
|
160
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_items.css.sass
|
161
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_layout.css.sass
|
162
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_navigation.css.sass
|
163
|
+
- lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_tools.css.sass
|
164
|
+
- lib/generators/katapult/basics/templates/config/database.sample.yml
|
165
|
+
- lib/generators/katapult/basics/templates/config/database.yml
|
166
|
+
- lib/generators/katapult/basics/templates/config/spring.rb
|
167
|
+
- lib/generators/katapult/basics/templates/features/support/env-custom.rb
|
168
|
+
- lib/generators/katapult/basics/templates/features/support/paths.rb
|
169
|
+
- lib/generators/katapult/cucumber_features/cucumber_features_generator.rb
|
170
|
+
- lib/generators/katapult/cucumber_features/templates/feature.feature
|
171
|
+
- lib/generators/katapult/haml/haml_generator.rb
|
172
|
+
- lib/generators/katapult/haml/templates/_form.html.haml
|
173
|
+
- lib/generators/katapult/haml/templates/app/views/layouts/application.html.haml
|
174
|
+
- lib/generators/katapult/haml/templates/custom_action.html.haml
|
175
|
+
- lib/generators/katapult/haml/templates/edit.html.haml
|
176
|
+
- lib/generators/katapult/haml/templates/index.html.haml
|
177
|
+
- lib/generators/katapult/haml/templates/new.html.haml
|
178
|
+
- lib/generators/katapult/haml/templates/show.html.haml
|
179
|
+
- lib/generators/katapult/install/install_generator.rb
|
180
|
+
- lib/generators/katapult/install/templates/lib/katapult/application_model.rb
|
181
|
+
- lib/generators/katapult/model/model_generator.rb
|
182
|
+
- lib/generators/katapult/model/templates/app/models/shared/does_flag.rb
|
183
|
+
- lib/generators/katapult/model/templates/model.rb
|
184
|
+
- lib/generators/katapult/model_specs/model_specs_generator.rb
|
185
|
+
- lib/generators/katapult/model_specs/templates/model_spec.rb
|
186
|
+
- lib/generators/katapult/navigation/navigation_generator.rb
|
187
|
+
- lib/generators/katapult/navigation/templates/app/models/navigation.rb
|
188
|
+
- lib/generators/katapult/transform/transform_generator.rb
|
189
|
+
- lib/generators/katapult/w_u_i/templates/_route.rb
|
190
|
+
- lib/generators/katapult/w_u_i/templates/controller.rb
|
191
|
+
- lib/generators/katapult/w_u_i/w_u_i_generator.rb
|
192
|
+
- lib/katapult.rb
|
193
|
+
- lib/katapult/action.rb
|
194
|
+
- lib/katapult/application_model.rb
|
195
|
+
- lib/katapult/attribute.rb
|
196
|
+
- lib/katapult/element.rb
|
197
|
+
- lib/katapult/generator.rb
|
198
|
+
- lib/katapult/model.rb
|
199
|
+
- lib/katapult/navigation.rb
|
200
|
+
- lib/katapult/parser.rb
|
201
|
+
- lib/katapult/util.rb
|
202
|
+
- lib/katapult/version.rb
|
203
|
+
- lib/katapult/wui.rb
|
204
|
+
- script/console
|
205
|
+
- spec/action_spec.rb
|
206
|
+
- spec/attribute_spec.rb
|
207
|
+
- spec/model_spec.rb
|
208
|
+
- spec/spec_helper.rb
|
209
|
+
- spec/util_spec.rb
|
210
|
+
- spec/wui_spec.rb
|
211
|
+
homepage: https://github.com/makandra/katapult
|
212
|
+
licenses:
|
213
|
+
- MIT
|
214
|
+
metadata: {}
|
215
|
+
post_install_message:
|
216
|
+
rdoc_options: []
|
217
|
+
require_paths:
|
218
|
+
- lib
|
219
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
220
|
+
requirements:
|
221
|
+
- - ">="
|
222
|
+
- !ruby/object:Gem::Version
|
223
|
+
version: '2.0'
|
224
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
|
+
requirements:
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '0'
|
229
|
+
requirements: []
|
230
|
+
rubyforge_project:
|
231
|
+
rubygems_version: 2.4.2
|
232
|
+
signing_key:
|
233
|
+
specification_version: 4
|
234
|
+
summary: Kickstart Rails development
|
235
|
+
test_files:
|
236
|
+
- features/binary.feature
|
237
|
+
- features/configuration.feature
|
238
|
+
- features/katapult.feature
|
239
|
+
- features/model.feature
|
240
|
+
- features/navigation.feature
|
241
|
+
- features/step_definitions/db_steps.rb
|
242
|
+
- features/step_definitions/file_steps.rb
|
243
|
+
- features/step_definitions/katapult_steps.rb
|
244
|
+
- features/step_definitions/rails_steps.rb
|
245
|
+
- features/step_definitions/test_steps.rb
|
246
|
+
- features/support/env.rb
|
247
|
+
- features/wui.feature
|
248
|
+
- spec/action_spec.rb
|
249
|
+
- spec/attribute_spec.rb
|
250
|
+
- spec/model_spec.rb
|
251
|
+
- spec/spec_helper.rb
|
252
|
+
- spec/util_spec.rb
|
253
|
+
- spec/wui_spec.rb
|