fierce 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2501d5ec2d90bdcf5f0d615e0ebb4f6c239e3a0
4
- data.tar.gz: 83d11558ecef6ed22f924054146bed31dea3bea1
3
+ metadata.gz: aedff8993a377777fc09ce941eb0cbf8028b8e4e
4
+ data.tar.gz: c183353ee1667ca03923c440edde27ec496c93bd
5
5
  SHA512:
6
- metadata.gz: d9dcfd5694cf46d75dd14bdf6f9ba8e31778957d64453881fed8968b6140080de1e5f94a670d25da21d83fd57c4119d74c820e5ede443e1d60f86ff34dbec696
7
- data.tar.gz: 6ddc62293a3959ab9ab94960ff7629730e8c19e8a2c796433304ec4fc5862e1c0291874636b4aa6e51b56a6babf066ffff727364e6e934b2b82ef3862c820408
6
+ metadata.gz: 26b61ccc729797c468390278457f896a8fc7851665510d5e870ee0dec845173759e766fac7214daa6e5acb59811189cd1020e3107da850a89062be20eb96f803
7
+ data.tar.gz: cdd47caeef578092e5bb001e91070849f8a5d9ec4f5228030624debd864522ded6e285374f962b0631c3ab56344a26e67fa68d469d20f86054b8b180947bc9e4
@@ -6,33 +6,27 @@ module Fierce
6
6
  @path = path
7
7
  end
8
8
 
9
- def root
10
- Rails.root.to_s
11
- end
12
-
13
9
  def file_path(base_path)
14
10
  "#{base_path}/#{path}.rb"
15
11
  end
16
12
 
17
- def found
13
+ def found_base_path
18
14
  @found = Fierce.paths.map do |base_path|
19
15
  base_path if File.exist?(file_path(base_path))
20
16
  end.compact.first
21
17
  end
22
18
 
23
19
  def perform
24
- presenter_class if found
20
+ presenter_class if found_base_path
25
21
  end
26
22
 
27
23
  def path_to_classify
28
- found
29
- .gsub(root, '')
30
- .gsub('/app', '')
31
- .gsub(/\.rb$/, '') + "/#{path}"
24
+ top_module = found_base_path.split('/').last
25
+ "#{top_module}/#{path}"
32
26
  end
33
27
 
34
- def presenter_class
35
- require file_path(found)
28
+ def presenter_class
29
+ require file_path(found_base_path)
36
30
  path_to_classify.classify.constantize
37
31
  end
38
32
  end
@@ -1,3 +1,3 @@
1
1
  module Fierce
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -2,8 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  describe Fierce::PresenterFinder do
4
4
  let(:fixture_presenter_path) { File.dirname(__FILE__) + "/custom_presenters" }
5
+
5
6
  before do
6
- Rails.stub(:root).and_return(File.dirname(__FILE__))
7
7
  Fierce.clear_paths
8
8
  Fierce.add_path(fixture_presenter_path)
9
9
  end
@@ -18,4 +18,4 @@ describe Fierce::PresenterFinder do
18
18
  it "return the class" do
19
19
  finder.perform.should == CustomPresenters::Home::Index
20
20
  end
21
- end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fierce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kane Baccigalupi