fortitude 0.0.6-java → 0.0.7-java

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: f6873a97f02e1143925c964b189cfd9179d8a991
4
- data.tar.gz: aef2a4ba446bcf7ef5801d3e5fd45f8ad5ba30d3
3
+ metadata.gz: 8d58342fff5dde4206e5085e5111c2bd10275d60
4
+ data.tar.gz: fe414b50a1d86fbb7504fa0dc5b45820e4c05780
5
5
  SHA512:
6
- metadata.gz: d282d9c7a2a9d081155daf048ba4fb55db3fcc7fd264b80e4347228a4f41f9bcc0fb6e1434128b13dadd3339a7db130f6e56a6e0bd7c8c372534c4eb940bb46e
7
- data.tar.gz: ab5e0c410bb9d1ebbb5716f07728ead4da423f2ad96d6fb270fe84a83d17081a2f79437623fa762fd22cf4c43a3c10677c0f327b820737426af973be8d6b95c4
6
+ metadata.gz: 019c7e138f27db207dc8ce479a393c1ed027f2ef2fb79523224ec0e88bf1a0245bc44fcdb23a7b9677cc4dbd8ca79bd2daaf7df083a5d60ef83c322383869cc1
7
+ data.tar.gz: 9137c4f333b5b477e488e6f6f8538901205f838f00b203d3c8c08f98bdf32c442895b31174de2a56204bcf23ee57529dabdf7182fc2a55d7e0935f7735272534
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: java
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
@@ -337,6 +337,8 @@ files:
337
337
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_formatting_test.rb
338
338
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_layout_test.rb
339
339
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_view_test.rb
340
+ - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/namespace_reference.rb
341
+ - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/referenced_widget.rb
340
342
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget.rb
341
343
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget_with_html_extension.html.rb
342
344
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/sample_output.rb
@@ -662,6 +664,8 @@ test_files:
662
664
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_formatting_test.rb
663
665
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_layout_test.rb
664
666
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_view_test.rb
667
+ - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/namespace_reference.rb
668
+ - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/referenced_widget.rb
665
669
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget.rb
666
670
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget_with_html_extension.html.rb
667
671
  - spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/sample_output.rb