lotus-view 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +105 -0
- data/{LICENSE.txt → LICENSE.md} +0 -0
- data/README.md +117 -28
- data/lib/lotus/layout.rb +11 -4
- data/lib/lotus/view/configuration.rb +298 -0
- data/lib/lotus/view/dsl.rb +89 -10
- data/lib/lotus/view/inheritable.rb +4 -0
- data/lib/lotus/view/rendering/layout_finder.rb +31 -7
- data/lib/lotus/view/rendering/layout_scope.rb +2 -2
- data/lib/lotus/view/rendering/registry.rb +0 -1
- data/lib/lotus/view/rendering/scope.rb +2 -2
- data/lib/lotus/view/rendering/template_name.rb +37 -0
- data/lib/lotus/view/rendering/templates_finder.rb +36 -5
- data/lib/lotus/view/version.rb +1 -1
- data/lib/lotus/view.rb +196 -88
- data/lotus-view.gemspec +2 -2
- metadata +9 -67
- data/.gitignore +0 -8
- data/.travis.yml +0 -6
- data/.yardopts +0 -3
- data/Gemfile +0 -15
- data/Rakefile +0 -17
- data/test/fixtures/templates/app/app_view.html.erb +0 -0
- data/test/fixtures/templates/app/view.html.erb +0 -0
- data/test/fixtures/templates/application.html.erb +0 -10
- data/test/fixtures/templates/articles/_form.html.erb +0 -4
- data/test/fixtures/templates/articles/alternative_new.html.erb +0 -1
- data/test/fixtures/templates/articles/index.atom.erb +0 -5
- data/test/fixtures/templates/articles/index.html.erb +0 -3
- data/test/fixtures/templates/articles/index.json.erb +0 -9
- data/test/fixtures/templates/articles/index.rss.erb +0 -0
- data/test/fixtures/templates/articles/new.html.erb +0 -7
- data/test/fixtures/templates/articles/show.html.erb +0 -1
- data/test/fixtures/templates/articles/show.json.erb +0 -5
- data/test/fixtures/templates/contacts/show.html.haml +0 -1
- data/test/fixtures/templates/dashboard/index.html.erb +0 -2
- data/test/fixtures/templates/hello_world_view.html.erb +0 -1
- data/test/fixtures/templates/index_view.html.erb +0 -1
- data/test/fixtures/templates/json_render_view.json.erb +0 -3
- data/test/fixtures/templates/render_view.html.erb +0 -1
- data/test/fixtures/templates/shared/_sidebar.html.erb +0 -1
- data/test/fixtures.rb +0 -187
- data/test/layout_test.rb +0 -10
- data/test/load_test.rb +0 -79
- data/test/presenter_test.rb +0 -31
- data/test/rendering_test.rb +0 -125
- data/test/root_test.rb +0 -38
- data/test/test_helper.rb +0 -24
- data/test/version_test.rb +0 -7
- data/test/view_test.rb +0 -27
data/lib/lotus/view.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'set'
|
2
2
|
require 'pathname'
|
3
|
+
require 'lotus/utils/class_attribute'
|
3
4
|
require 'lotus/view/version'
|
5
|
+
require 'lotus/view/configuration'
|
4
6
|
require 'lotus/view/inheritable'
|
5
7
|
require 'lotus/view/rendering'
|
6
8
|
require 'lotus/view/dsl'
|
@@ -41,145 +43,251 @@ module Lotus
|
|
41
43
|
class MissingFormatError < ::StandardError
|
42
44
|
end
|
43
45
|
|
44
|
-
|
46
|
+
include Utils::ClassAttribute
|
47
|
+
|
48
|
+
# Framework configuration
|
45
49
|
#
|
50
|
+
# @since 0.2.0
|
46
51
|
# @api private
|
47
|
-
|
52
|
+
class_attribute :configuration
|
53
|
+
self.configuration = Configuration.new
|
54
|
+
|
55
|
+
# Configure the framework.
|
56
|
+
# It yields the given block in the context of the configuration
|
57
|
+
#
|
58
|
+
# @param blk [Proc] the configuration block
|
59
|
+
#
|
60
|
+
# @since 0.2.0
|
61
|
+
#
|
62
|
+
# @see Lotus::View::Configuration
|
48
63
|
#
|
49
64
|
# @example
|
50
65
|
# require 'lotus/view'
|
51
66
|
#
|
52
|
-
#
|
53
|
-
#
|
67
|
+
# Lotus::View.configure do
|
68
|
+
# root '/path/to/root'
|
54
69
|
# end
|
55
|
-
def self.
|
56
|
-
|
57
|
-
extend Inheritable.dup
|
58
|
-
extend Dsl.dup
|
59
|
-
extend Rendering.dup
|
60
|
-
end
|
61
|
-
|
62
|
-
views.add(base)
|
70
|
+
def self.configure(&blk)
|
71
|
+
configuration.instance_eval(&blk)
|
63
72
|
end
|
64
73
|
|
65
|
-
#
|
74
|
+
# Duplicate Lotus::View in order to create a new separated instance
|
75
|
+
# of the framework.
|
66
76
|
#
|
67
|
-
#
|
77
|
+
# The new instance of the framework will be completely decoupled from the
|
78
|
+
# original. It will inherit the configuration, but all the changes that
|
79
|
+
# happen after the duplication, won't be reflected on the other copies.
|
68
80
|
#
|
69
|
-
# @
|
81
|
+
# @return [Module] a copy of Lotus::View
|
70
82
|
#
|
71
|
-
# @since 0.
|
83
|
+
# @since 0.2.0
|
84
|
+
# @api private
|
72
85
|
#
|
73
|
-
# @example
|
86
|
+
# @example Basic usage
|
74
87
|
# require 'lotus/view'
|
75
88
|
#
|
76
|
-
#
|
77
|
-
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
# Returns the directory root where templates are located.
|
82
|
-
# If not already set, it returns the current directory.
|
83
|
-
#
|
84
|
-
# @return [Pathname] the root path for templates
|
89
|
+
# module MyApp
|
90
|
+
# View = Lotus::View.dupe
|
91
|
+
# end
|
85
92
|
#
|
86
|
-
#
|
93
|
+
# MyApp::View == Lotus::View # => false
|
87
94
|
#
|
88
|
-
#
|
95
|
+
# MyApp::View.configuration ==
|
96
|
+
# Lotus::View.configuration # => false
|
89
97
|
#
|
90
|
-
# @example
|
98
|
+
# @example Inheriting configuration
|
91
99
|
# require 'lotus/view'
|
92
100
|
#
|
93
|
-
# Lotus::View.
|
94
|
-
#
|
101
|
+
# Lotus::View.configure do
|
102
|
+
# root '/path/to/root'
|
103
|
+
# end
|
95
104
|
#
|
96
|
-
#
|
97
|
-
#
|
105
|
+
# module MyApp
|
106
|
+
# View = Lotus::View.dupe
|
107
|
+
# end
|
108
|
+
#
|
109
|
+
# module MyApi
|
110
|
+
# View = Lotus::View.dupe
|
111
|
+
# View.configure do
|
112
|
+
# root '/another/root'
|
113
|
+
# end
|
114
|
+
# end
|
98
115
|
#
|
99
|
-
# Lotus::View.root # => #<Pathname
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
116
|
+
# Lotus::View.configuration.root # => #<Pathname:/path/to/root>
|
117
|
+
# MyApp::View.configuration.root # => #<Pathname:/path/to/root>
|
118
|
+
# MyApi::View.configuration.root # => #<Pathname:/another/root>
|
119
|
+
def self.dupe
|
120
|
+
dup.tap do |duplicated|
|
121
|
+
duplicated.configuration = configuration.duplicate
|
104
122
|
end
|
105
123
|
end
|
106
124
|
|
107
|
-
#
|
125
|
+
# Duplicate the framework and generate modules for the target application
|
108
126
|
#
|
109
|
-
# @param
|
127
|
+
# @param mod [Module] the Ruby namespace of the application
|
128
|
+
# @param views [String] the optional namespace where the application's
|
129
|
+
# views will live
|
130
|
+
# @param blk [Proc] an optional block to configure the framework
|
110
131
|
#
|
111
|
-
# @
|
132
|
+
# @return [Module] a copy of Lotus::View
|
112
133
|
#
|
113
|
-
#
|
114
|
-
# @see Lotus::View.load!
|
134
|
+
# @since 0.2.0
|
115
135
|
#
|
116
|
-
# @
|
136
|
+
# @see Lotus::View#dupe
|
137
|
+
# @see Lotus::View::Configuration
|
138
|
+
# @see Lotus::View::Configuration#namespace
|
139
|
+
#
|
140
|
+
# @example Basic usage
|
117
141
|
# require 'lotus/view'
|
118
142
|
#
|
119
|
-
#
|
143
|
+
# module MyApp
|
144
|
+
# View = Lotus::View.duplicate(self)
|
145
|
+
# end
|
120
146
|
#
|
121
|
-
#
|
122
|
-
#
|
147
|
+
# # It will:
|
148
|
+
# #
|
149
|
+
# # 1. Generate MyApp::View
|
150
|
+
# # 2. Generate MyApp::Layout
|
151
|
+
# # 3. Generate MyApp::Views
|
152
|
+
# # 4. Configure MyApp::Views as the default namespace for views
|
153
|
+
#
|
154
|
+
# module MyApp::Views::Dashboard
|
155
|
+
# class Index
|
156
|
+
# include MyApp::View
|
157
|
+
# end
|
158
|
+
# end
|
159
|
+
#
|
160
|
+
# @example Compare code
|
161
|
+
# require 'lotus/view'
|
162
|
+
#
|
163
|
+
# module MyApp
|
164
|
+
# View = Lotus::View.duplicate(self) do
|
165
|
+
# # ...
|
166
|
+
# end
|
123
167
|
# end
|
124
168
|
#
|
125
|
-
#
|
126
|
-
# IndexView.layout # => ApplicationLayout
|
127
|
-
def self.layout=(layout)
|
128
|
-
@layout = Rendering::LayoutFinder.find(layout)
|
129
|
-
end
|
130
|
-
|
131
|
-
# Returns the default layout to assign to the registered views.
|
132
|
-
# If not already set, it returns a <tt>Rendering::NullLayout</tt>.
|
169
|
+
# # it's equivalent to:
|
133
170
|
#
|
134
|
-
#
|
171
|
+
# module MyApp
|
172
|
+
# View = Lotus::View.dupe
|
173
|
+
# Layout = Lotus::Layout.dup
|
135
174
|
#
|
136
|
-
#
|
175
|
+
# module Views
|
176
|
+
# end
|
137
177
|
#
|
138
|
-
#
|
139
|
-
|
140
|
-
|
141
|
-
end
|
142
|
-
|
143
|
-
# A set of registered views.
|
178
|
+
# View.configure do
|
179
|
+
# namespace 'MyApp::Views'
|
180
|
+
# end
|
144
181
|
#
|
145
|
-
#
|
182
|
+
# View.configure do
|
183
|
+
# # ...
|
184
|
+
# end
|
185
|
+
# end
|
146
186
|
#
|
147
|
-
# @
|
148
|
-
#
|
149
|
-
|
150
|
-
|
187
|
+
# @example Custom views module
|
188
|
+
# require 'lotus/view
|
189
|
+
#
|
190
|
+
# module MyApp
|
191
|
+
# View = Lotus::View.duplicate(self, 'Vs')
|
192
|
+
# end
|
193
|
+
#
|
194
|
+
# defined?(MyApp::Views) # => nil
|
195
|
+
# defined?(MyApp::Vs) # => "constant"
|
196
|
+
#
|
197
|
+
# # Developers can namespace views under Vs
|
198
|
+
# module MyApp::Vs::Dashboard
|
199
|
+
# # ...
|
200
|
+
# end
|
201
|
+
#
|
202
|
+
# @example Nil views module
|
203
|
+
# require 'lotus/view'
|
204
|
+
#
|
205
|
+
# module MyApp
|
206
|
+
# View = Lotus::View.duplicate(self, nil)
|
207
|
+
# end
|
208
|
+
#
|
209
|
+
# defined?(MyApp::Views) # => nil
|
210
|
+
#
|
211
|
+
# # Developers can namespace views under MyApp
|
212
|
+
# module MyApp
|
213
|
+
# # ...
|
214
|
+
# end
|
215
|
+
#
|
216
|
+
# @example Block usage
|
217
|
+
# require 'lotus/view'
|
218
|
+
#
|
219
|
+
# module MyApp
|
220
|
+
# View = Lotus::View.duplicate(self) do
|
221
|
+
# root '/path/to/root'
|
222
|
+
# end
|
223
|
+
# end
|
224
|
+
#
|
225
|
+
# Lotus::View.configuration.root # => #<Pathname:.>
|
226
|
+
# MyApp::View.configuration.root # => #<Pathname:/path/to/root>
|
227
|
+
def self.duplicate(mod, views = 'Views', &blk)
|
228
|
+
dupe.tap do |duplicated|
|
229
|
+
mod.module_eval %{ module #{ views }; end } if views
|
230
|
+
mod.module_eval %{ Layout = Lotus::Layout.dup }
|
231
|
+
|
232
|
+
duplicated.configure do
|
233
|
+
namespace [mod, views].compact.join '::'
|
234
|
+
end
|
235
|
+
|
236
|
+
duplicated.configure(&blk) if block_given?
|
237
|
+
end
|
151
238
|
end
|
152
239
|
|
153
|
-
#
|
240
|
+
# Override Ruby's hook for modules.
|
241
|
+
# It includes basic Lotus::View modules to the given Class.
|
242
|
+
# It sets a copy of the framework configuration
|
154
243
|
#
|
155
|
-
# @
|
244
|
+
# @param base [Class] the target view
|
156
245
|
#
|
157
|
-
# @api private
|
158
246
|
# @since 0.1.0
|
159
|
-
|
160
|
-
|
161
|
-
|
247
|
+
# @api private
|
248
|
+
#
|
249
|
+
# @see http://www.ruby-doc.org/core-2.1.2/Module.html#method-i-included
|
250
|
+
#
|
251
|
+
# @see Lotus::View::Dsl
|
252
|
+
# @see Lotus::View::Inheritable
|
253
|
+
# @see Lotus::View::Rendering
|
254
|
+
#
|
255
|
+
# @example
|
256
|
+
# require 'lotus/view'
|
257
|
+
#
|
258
|
+
# class IndexView
|
259
|
+
# include Lotus::View
|
260
|
+
# end
|
261
|
+
def self.included(base)
|
262
|
+
conf = self.configuration
|
263
|
+
conf.add_view(base)
|
162
264
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
views.freeze
|
265
|
+
base.class_eval do
|
266
|
+
extend Inheritable.dup
|
267
|
+
extend Dsl.dup
|
268
|
+
extend Rendering.dup
|
168
269
|
|
169
|
-
|
170
|
-
|
171
|
-
end
|
270
|
+
include Utils::ClassAttribute
|
271
|
+
class_attribute :configuration
|
172
272
|
|
173
|
-
|
174
|
-
layout.send(:load!)
|
273
|
+
self.configuration = conf.duplicate
|
175
274
|
end
|
176
275
|
end
|
177
276
|
|
277
|
+
# Load the framework
|
278
|
+
#
|
279
|
+
# @since 0.1.0
|
280
|
+
# @api private
|
281
|
+
def self.load!
|
282
|
+
configuration.load!
|
283
|
+
end
|
284
|
+
|
285
|
+
# Unload the framework
|
286
|
+
#
|
287
|
+
# @since 0.1.0
|
288
|
+
# @api private
|
178
289
|
def self.unload!
|
179
|
-
|
180
|
-
instance_variable_set(:@layout, nil)
|
181
|
-
instance_variable_set(:@views, Set.new)
|
182
|
-
instance_variable_set(:@layouts, Set.new)
|
290
|
+
configuration.unload!
|
183
291
|
end
|
184
292
|
end
|
185
293
|
end
|
data/lotus-view.gemspec
CHANGED
@@ -13,13 +13,13 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = 'http://lotusrb.org'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.files = `git ls-files -- lib/* CHANGELOG.md LICENSE.md README.md lotus-view.gemspec`.split($/)
|
17
17
|
spec.executables = []
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_runtime_dependency 'tilt', '~> 2.0', '>= 2.0.1'
|
22
|
-
spec.add_runtime_dependency 'lotus-utils', '~> 0.
|
22
|
+
spec.add_runtime_dependency 'lotus-utils', '~> 0.2'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
25
25
|
spec.add_development_dependency 'minitest', '~> 5'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lotus-view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.2'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.2'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,17 +93,14 @@ executables: []
|
|
93
93
|
extensions: []
|
94
94
|
extra_rdoc_files: []
|
95
95
|
files:
|
96
|
-
-
|
97
|
-
-
|
98
|
-
- ".yardopts"
|
99
|
-
- Gemfile
|
100
|
-
- LICENSE.txt
|
96
|
+
- CHANGELOG.md
|
97
|
+
- LICENSE.md
|
101
98
|
- README.md
|
102
|
-
- Rakefile
|
103
99
|
- lib/lotus-view.rb
|
104
100
|
- lib/lotus/layout.rb
|
105
101
|
- lib/lotus/presenter.rb
|
106
102
|
- lib/lotus/view.rb
|
103
|
+
- lib/lotus/view/configuration.rb
|
107
104
|
- lib/lotus/view/dsl.rb
|
108
105
|
- lib/lotus/view/inheritable.rb
|
109
106
|
- lib/lotus/view/rendering.rb
|
@@ -118,39 +115,12 @@ files:
|
|
118
115
|
- lib/lotus/view/rendering/scope.rb
|
119
116
|
- lib/lotus/view/rendering/template.rb
|
120
117
|
- lib/lotus/view/rendering/template_finder.rb
|
118
|
+
- lib/lotus/view/rendering/template_name.rb
|
121
119
|
- lib/lotus/view/rendering/templates_finder.rb
|
122
120
|
- lib/lotus/view/rendering/view_finder.rb
|
123
121
|
- lib/lotus/view/template.rb
|
124
122
|
- lib/lotus/view/version.rb
|
125
123
|
- lotus-view.gemspec
|
126
|
-
- test/fixtures.rb
|
127
|
-
- test/fixtures/templates/app/app_view.html.erb
|
128
|
-
- test/fixtures/templates/app/view.html.erb
|
129
|
-
- test/fixtures/templates/application.html.erb
|
130
|
-
- test/fixtures/templates/articles/_form.html.erb
|
131
|
-
- test/fixtures/templates/articles/alternative_new.html.erb
|
132
|
-
- test/fixtures/templates/articles/index.atom.erb
|
133
|
-
- test/fixtures/templates/articles/index.html.erb
|
134
|
-
- test/fixtures/templates/articles/index.json.erb
|
135
|
-
- test/fixtures/templates/articles/index.rss.erb
|
136
|
-
- test/fixtures/templates/articles/new.html.erb
|
137
|
-
- test/fixtures/templates/articles/show.html.erb
|
138
|
-
- test/fixtures/templates/articles/show.json.erb
|
139
|
-
- test/fixtures/templates/contacts/show.html.haml
|
140
|
-
- test/fixtures/templates/dashboard/index.html.erb
|
141
|
-
- test/fixtures/templates/hello_world_view.html.erb
|
142
|
-
- test/fixtures/templates/index_view.html.erb
|
143
|
-
- test/fixtures/templates/json_render_view.json.erb
|
144
|
-
- test/fixtures/templates/render_view.html.erb
|
145
|
-
- test/fixtures/templates/shared/_sidebar.html.erb
|
146
|
-
- test/layout_test.rb
|
147
|
-
- test/load_test.rb
|
148
|
-
- test/presenter_test.rb
|
149
|
-
- test/rendering_test.rb
|
150
|
-
- test/root_test.rb
|
151
|
-
- test/test_helper.rb
|
152
|
-
- test/version_test.rb
|
153
|
-
- test/view_test.rb
|
154
124
|
homepage: http://lotusrb.org
|
155
125
|
licenses:
|
156
126
|
- MIT
|
@@ -175,33 +145,5 @@ rubygems_version: 2.2.2
|
|
175
145
|
signing_key:
|
176
146
|
specification_version: 4
|
177
147
|
summary: View layer for Lotus, with a separation between views and templates
|
178
|
-
test_files:
|
179
|
-
- test/fixtures.rb
|
180
|
-
- test/fixtures/templates/app/app_view.html.erb
|
181
|
-
- test/fixtures/templates/app/view.html.erb
|
182
|
-
- test/fixtures/templates/application.html.erb
|
183
|
-
- test/fixtures/templates/articles/_form.html.erb
|
184
|
-
- test/fixtures/templates/articles/alternative_new.html.erb
|
185
|
-
- test/fixtures/templates/articles/index.atom.erb
|
186
|
-
- test/fixtures/templates/articles/index.html.erb
|
187
|
-
- test/fixtures/templates/articles/index.json.erb
|
188
|
-
- test/fixtures/templates/articles/index.rss.erb
|
189
|
-
- test/fixtures/templates/articles/new.html.erb
|
190
|
-
- test/fixtures/templates/articles/show.html.erb
|
191
|
-
- test/fixtures/templates/articles/show.json.erb
|
192
|
-
- test/fixtures/templates/contacts/show.html.haml
|
193
|
-
- test/fixtures/templates/dashboard/index.html.erb
|
194
|
-
- test/fixtures/templates/hello_world_view.html.erb
|
195
|
-
- test/fixtures/templates/index_view.html.erb
|
196
|
-
- test/fixtures/templates/json_render_view.json.erb
|
197
|
-
- test/fixtures/templates/render_view.html.erb
|
198
|
-
- test/fixtures/templates/shared/_sidebar.html.erb
|
199
|
-
- test/layout_test.rb
|
200
|
-
- test/load_test.rb
|
201
|
-
- test/presenter_test.rb
|
202
|
-
- test/rendering_test.rb
|
203
|
-
- test/root_test.rb
|
204
|
-
- test/test_helper.rb
|
205
|
-
- test/version_test.rb
|
206
|
-
- test/view_test.rb
|
148
|
+
test_files: []
|
207
149
|
has_rdoc:
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/.yardopts
DELETED
data/Gemfile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
if !ENV['TRAVIS']
|
4
|
-
gem 'byebug', require: false, platforms: :ruby if RUBY_VERSION == '2.1.1'
|
5
|
-
gem 'yard', require: false
|
6
|
-
gem 'lotus-utils', require: false, path: '../lotus-utils'
|
7
|
-
else
|
8
|
-
gem 'lotus-utils'
|
9
|
-
end
|
10
|
-
|
11
|
-
gem 'rake'
|
12
|
-
gem 'tilt', '~> 2.0.1', '>= 2.0.1'
|
13
|
-
gem 'haml', require: false
|
14
|
-
gem 'simplecov', require: false
|
15
|
-
gem 'coveralls', require: false
|
data/Rakefile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'bundler/gem_tasks'
|
4
|
-
|
5
|
-
Rake::TestTask.new do |t|
|
6
|
-
t.pattern = 'test/**/*_test.rb'
|
7
|
-
t.libs.push 'test'
|
8
|
-
end
|
9
|
-
|
10
|
-
namespace :test do
|
11
|
-
task :coverage do
|
12
|
-
ENV['COVERAGE'] = 'true'
|
13
|
-
Rake::Task['test'].invoke
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
task default: :test
|
File without changes
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= render template: 'articles/new', locals: { errors: {} } %>
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
<h1><%= title %></h1>
|
@@ -1 +0,0 @@
|
|
1
|
-
%h1= person.name
|
@@ -1 +0,0 @@
|
|
1
|
-
<h1>Hello, World!</h1>
|
@@ -1 +0,0 @@
|
|
1
|
-
<h1>Welcome</h1>
|
@@ -1 +0,0 @@
|
|
1
|
-
<h1>Hello, <%= planet %>!</h1>
|
@@ -1 +0,0 @@
|
|
1
|
-
<div id="sidebar"></div>
|