fortitude 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/lib/fortitude/rails/railtie.rb +12 -9
- data/lib/fortitude/version.rb +1 -1
- data/spec/rails/development_mode_system_spec.rb +4 -0
- data/spec/rails/templates/development_mode_system_spec/app/controllers/development_mode_system_spec_controller.rb +4 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/namespace_reference.rb +7 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/referenced_widget.rb +5 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eabd6ee415b258a82856f5c76df532a3ce71cb3e
|
4
|
+
data.tar.gz: 78b96f3f86e1a688e87de8d3ff772c9bdd67100b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bbe8a1b13135a561d29d48bf3072a80e10dcbcffb9e7fc06197071b9f47f32261606330d52651e31ba9d490258e67e9e3f8af5aa6f0d089e557f717f0753fa3
|
7
|
+
data.tar.gz: 4adba77413cfd61b38ce7f1b145063c27bf0df79ccae299de55ae0ba744b3ca0babf81756de52c5cf7a25ecf773b6c0eeb4f6dcbd58de69fa1bec7a42a8c85a5
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Fortitude Releases
|
2
2
|
|
3
|
+
## 0.0.7, 11 November 2014
|
4
|
+
|
5
|
+
* Fortitude 0.0.6 introduced a regression, where referring to an autoloaded view class by partially-qualified namespace
|
6
|
+
path could cause an `Errno::ENOENT` exception indicating that a particular directory wasn't found.
|
7
|
+
|
3
8
|
## 0.0.6, 11 November 2014
|
4
9
|
|
5
10
|
* Fixed an issue where naming a widget with an `.html.rb` extension (for example) at the end would work at first,
|
@@ -147,17 +147,20 @@ module Fortitude
|
|
147
147
|
if found_subpath
|
148
148
|
full_path = File.join(@@_fortitude_views_root, "#{found_subpath}")
|
149
149
|
directory = File.dirname(full_path)
|
150
|
-
filename = File.basename(full_path)
|
151
150
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
151
|
+
if File.directory?(directory)
|
152
|
+
filename = File.basename(full_path)
|
153
|
+
|
154
|
+
regexp1 = /^#{Regexp.escape(filename)}\./
|
155
|
+
regexp2 = /\.rb$/i
|
156
|
+
applicable_entries = Dir.entries(directory).select do |entry|
|
157
|
+
((entry == filename) || (entry =~ regexp1 && entry =~ regexp2)) && File.file?(File.join(directory, entry))
|
158
|
+
end
|
159
|
+
return nil if applicable_entries.length == 0
|
158
160
|
|
159
|
-
|
160
|
-
|
161
|
+
entry_to_use = applicable_entries.sort_by { |e| e.length }.reverse.first
|
162
|
+
return File.join(directory, entry_to_use)
|
163
|
+
end
|
161
164
|
end
|
162
165
|
|
163
166
|
# Make sure that we remove the views autoload path before letting the rest of
|
data/lib/fortitude/version.rb
CHANGED
@@ -78,6 +78,10 @@ describe "Rails development-mode support", :type => :rails do
|
|
78
78
|
<!-- END Views::DevelopmentModeMailer::MailerFormattingTest depth 0 -->})
|
79
79
|
end
|
80
80
|
|
81
|
+
it "should allow referencing a widget by partial namespace" do
|
82
|
+
expect_match("namespace_reference", /before.*referenced.*after/mi)
|
83
|
+
end
|
84
|
+
|
81
85
|
private
|
82
86
|
def splat_new_widget!
|
83
87
|
reload_file = File.join(rails_server.rails_root, 'app/views/development_mode_system_spec/reload_widget.rb')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fortitude
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Geweke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -338,6 +338,8 @@ files:
|
|
338
338
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_formatting_test.rb
|
339
339
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_layout_test.rb
|
340
340
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_view_test.rb
|
341
|
+
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/namespace_reference.rb
|
342
|
+
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/referenced_widget.rb
|
341
343
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget.rb
|
342
344
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget_with_html_extension.html.rb
|
343
345
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/sample_output.rb
|
@@ -663,6 +665,8 @@ test_files:
|
|
663
665
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_formatting_test.rb
|
664
666
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_layout_test.rb
|
665
667
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_view_test.rb
|
668
|
+
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/namespace_reference.rb
|
669
|
+
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/referenced_widget.rb
|
666
670
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget.rb
|
667
671
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget_with_html_extension.html.rb
|
668
672
|
- spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/sample_output.rb
|