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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b672c6981cd2da1af20a06cac52a1da20f1e03d1
4
- data.tar.gz: 1e0c7a205c8c821ea68218c1fe15a729902d9a90
3
+ metadata.gz: eabd6ee415b258a82856f5c76df532a3ce71cb3e
4
+ data.tar.gz: 78b96f3f86e1a688e87de8d3ff772c9bdd67100b
5
5
  SHA512:
6
- metadata.gz: 281dbee5a7ade09027c4855542f200e1186c23f8d86fafdaa4940e1843df904dab8119d0a5f8b7414a64c378e7588f03dd4a591cc4850fe1f0e3ee8690c7e86a
7
- data.tar.gz: 17a6d7cdbd63ddfa38f32e671d747c34df382e0558f49549132a68c2d6d84ccc574003870e21ebf769697a0dc6424b85de762459055948cb8acc160005d512e8
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
- regexp1 = /^#{Regexp.escape(filename)}\./
153
- regexp2 = /\.rb$/i
154
- applicable_entries = Dir.entries(directory).select do |entry|
155
- ((entry == filename) || (entry =~ regexp1 && entry =~ regexp2)) && File.file?(File.join(directory, entry))
156
- end
157
- return nil if applicable_entries.length == 0
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
- entry_to_use = applicable_entries.sort_by { |e| e.length }.reverse.first
160
- return File.join(directory, entry_to_use)
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
@@ -1,3 +1,3 @@
1
1
  module Fortitude
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -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')
@@ -11,6 +11,10 @@ class DevelopmentModeSystemSpecController < ApplicationController
11
11
  @name = "Jessica"
12
12
  end
13
13
 
14
+ def namespace_reference
15
+ # nothing here
16
+ end
17
+
14
18
  def mailer_view_test
15
19
  DevelopmentModeMailer.mailer_view_test.deliver
16
20
  end
@@ -0,0 +1,7 @@
1
+ class Views::DevelopmentModeSystemSpec::NamespaceReference < Fortitude::Widgets::Html5
2
+ def content
3
+ p "before"
4
+ widget ReferencedWidget
5
+ p "after"
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class Views::DevelopmentModeSystemSpec::ReferencedWidget < Fortitude::Widgets::Html5
2
+ def content
3
+ p "referenced"
4
+ end
5
+ end
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.6
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 00:00:00.000000000 Z
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