crayfish 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/crayfish/html.rb CHANGED
@@ -76,6 +76,10 @@ module Crayfish
76
76
  end
77
77
 
78
78
  def public_path_to_fs_path path
79
+ if /^(?<stripped>[^\?]*)\?[0-9]*$/ =~ path
80
+ path = stripped
81
+ end
82
+
79
83
  search_paths = [::Rails.public_path] + ::Rails.configuration.assets.paths
80
84
  search_paths.each do |search_path|
81
85
  if File.exists?("#{search_path}/#{path}")
@@ -21,5 +21,5 @@
21
21
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
 
23
23
  module Crayfish
24
- VERSION = "0.2.3"
24
+ VERSION = "0.2.4"
25
25
  end
@@ -1625,3 +1625,118 @@ undefined local variable or method `aaa' for #<CrayfishActionViewTest::ActionVie
1625
1625
   (0.0ms) rollback transaction
1626
1626
   (0.0ms) begin transaction
1627
1627
   (0.0ms) rollback transaction
1628
+  (0.3ms) begin transaction
1629
+  (0.0ms) rollback transaction
1630
+  (0.0ms) begin transaction
1631
+ unknown node p in CrayHtml
1632
+  (0.0ms) rollback transaction
1633
+  (0.0ms) begin transaction
1634
+  (0.0ms) rollback transaction
1635
+  (0.0ms) begin transaction
1636
+  (0.0ms) rollback transaction
1637
+  (0.0ms) begin transaction
1638
+  (0.0ms) rollback transaction
1639
+  (0.0ms) begin transaction
1640
+  (0.0ms) rollback transaction
1641
+  (0.0ms) begin transaction
1642
+  (0.0ms) rollback transaction
1643
+  (0.0ms) begin transaction
1644
+  (0.0ms) rollback transaction
1645
+  (0.0ms) begin transaction
1646
+  (0.0ms) rollback transaction
1647
+  (0.0ms) begin transaction
1648
+  (0.0ms) rollback transaction
1649
+  (0.0ms) begin transaction
1650
+  (0.0ms) rollback transaction
1651
+  (0.2ms) begin transaction
1652
+  (0.0ms) rollback transaction
1653
+  (0.0ms) begin transaction
1654
+ unknown node p in CrayHtml
1655
+  (0.0ms) rollback transaction
1656
+  (0.0ms) begin transaction
1657
+  (0.0ms) rollback transaction
1658
+  (0.0ms) begin transaction
1659
+  (0.0ms) rollback transaction
1660
+  (0.0ms) begin transaction
1661
+  (0.0ms) rollback transaction
1662
+  (0.0ms) begin transaction
1663
+  (0.0ms) rollback transaction
1664
+  (0.0ms) begin transaction
1665
+  (0.0ms) rollback transaction
1666
+  (0.0ms) begin transaction
1667
+  (0.0ms) rollback transaction
1668
+  (0.0ms) begin transaction
1669
+  (0.0ms) rollback transaction
1670
+  (0.0ms) begin transaction
1671
+  (0.0ms) rollback transaction
1672
+  (0.0ms) begin transaction
1673
+  (0.0ms) rollback transaction
1674
+  (0.2ms) begin transaction
1675
+  (0.0ms) rollback transaction
1676
+  (0.0ms) begin transaction
1677
+ unknown node p in CrayHtml
1678
+  (0.0ms) rollback transaction
1679
+  (0.0ms) begin transaction
1680
+  (0.0ms) rollback transaction
1681
+  (0.0ms) begin transaction
1682
+  (0.0ms) rollback transaction
1683
+  (0.0ms) begin transaction
1684
+  (0.0ms) rollback transaction
1685
+  (0.0ms) begin transaction
1686
+  (0.0ms) rollback transaction
1687
+  (0.0ms) begin transaction
1688
+  (0.0ms) rollback transaction
1689
+  (0.0ms) begin transaction
1690
+  (0.0ms) rollback transaction
1691
+  (0.0ms) begin transaction
1692
+  (0.0ms) rollback transaction
1693
+  (0.0ms) begin transaction
1694
+  (0.0ms) rollback transaction
1695
+  (0.0ms) begin transaction
1696
+  (0.0ms) rollback transaction
1697
+  (0.3ms) begin transaction
1698
+  (0.0ms) rollback transaction
1699
+  (0.0ms) begin transaction
1700
+ unknown node p in CrayHtml
1701
+  (0.0ms) rollback transaction
1702
+  (0.0ms) begin transaction
1703
+  (0.0ms) rollback transaction
1704
+  (0.0ms) begin transaction
1705
+  (0.0ms) rollback transaction
1706
+  (0.0ms) begin transaction
1707
+  (0.0ms) rollback transaction
1708
+  (0.0ms) begin transaction
1709
+  (0.0ms) rollback transaction
1710
+  (0.0ms) begin transaction
1711
+  (0.0ms) rollback transaction
1712
+  (0.0ms) begin transaction
1713
+  (0.0ms) rollback transaction
1714
+  (0.0ms) begin transaction
1715
+  (0.0ms) rollback transaction
1716
+  (0.0ms) begin transaction
1717
+  (0.0ms) rollback transaction
1718
+  (0.0ms) begin transaction
1719
+  (0.0ms) rollback transaction
1720
+  (0.3ms) begin transaction
1721
+  (0.0ms) rollback transaction
1722
+  (0.0ms) begin transaction
1723
+ unknown node p in CrayHtml
1724
+  (0.0ms) rollback transaction
1725
+  (0.0ms) begin transaction
1726
+  (0.0ms) rollback transaction
1727
+  (0.0ms) begin transaction
1728
+  (0.0ms) rollback transaction
1729
+  (0.0ms) begin transaction
1730
+  (0.0ms) rollback transaction
1731
+  (0.0ms) begin transaction
1732
+  (0.0ms) rollback transaction
1733
+  (0.0ms) begin transaction
1734
+  (0.0ms) rollback transaction
1735
+  (0.0ms) begin transaction
1736
+  (0.0ms) rollback transaction
1737
+  (0.0ms) begin transaction
1738
+  (0.0ms) rollback transaction
1739
+  (0.0ms) begin transaction
1740
+  (0.0ms) rollback transaction
1741
+  (0.0ms) begin transaction
1742
+  (0.0ms) rollback transaction
data/test/html_test.rb CHANGED
@@ -43,6 +43,14 @@ class HtmlTest < ActiveSupport::TestCase
43
43
  assert_equal "/assets/a.file", @html.public_path_to_fs_path('a.file')
44
44
  end
45
45
 
46
+ test "should strip session key from public files" do # are these realy session keys?
47
+ ::Rails.stubs(:public_path).returns('/pub')
48
+ ::Rails.configuration.assets.stubs(:paths).returns(['/assets'])
49
+ File.expects(:exists?).with("/pub/a.file").returns(false)
50
+ File.expects(:exists?).with("/assets/a.file").returns(true)
51
+ assert_equal "/assets/a.file", @html.public_path_to_fs_path('a.file?123456')
52
+ end
53
+
46
54
  test "compile img" do
47
55
  img = stub('html img')
48
56
  img.stubs(:name).returns(:img)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crayfish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-14 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70107095324480 !ruby/object:Gem::Requirement
16
+ requirement: &70128930912640 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70107095324480
24
+ version_requirements: *70128930912640
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: prawn
27
- requirement: &70107095323160 !ruby/object:Gem::Requirement
27
+ requirement: &70128930893620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70107095323160
35
+ version_requirements: *70128930893620
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: nokogiri
38
- requirement: &70107095321480 !ruby/object:Gem::Requirement
38
+ requirement: &70128930892100 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70107095321480
46
+ version_requirements: *70128930892100
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sqlite3
49
- requirement: &70107095319680 !ruby/object:Gem::Requirement
49
+ requirement: &70128930890080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70107095319680
57
+ version_requirements: *70128930890080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mocha
60
- requirement: &70107095318780 !ruby/object:Gem::Requirement
60
+ requirement: &70128930887780 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70107095318780
68
+ version_requirements: *70128930887780
69
69
  description: Crayfish - PDF templating for Rails
70
70
  email:
71
71
  - patrick.hanevold@gmail.com
@@ -133,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  segments:
135
135
  - 0
136
- hash: 4351079184167744567
136
+ hash: -1425163839330226270
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  segments:
144
144
  - 0
145
- hash: 4351079184167744567
145
+ hash: -1425163839330226270
146
146
  requirements: []
147
147
  rubyforge_project:
148
148
  rubygems_version: 1.8.15