view_assets 0.0.11 → 0.0.12

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.
@@ -32,7 +32,7 @@ module ViewAssets
32
32
  # It returns all asset paths wrapped inside a appropriated html
33
33
  # tag(`script` | `link`).
34
34
  def all
35
- # todo remove this quick fix used for adding a leading slash to make
35
+ # TODO: remove this quick fix used for adding a leading slash to make
36
36
  all_assets.map { |asset| tag "/#{asset}" } # tag should be realized in a subclass
37
37
  end
38
38
 
@@ -116,14 +116,19 @@ module ViewAssets
116
116
 
117
117
  # find files in the conventional directory
118
118
  manifest = nil
119
+ indexed_action = false
119
120
  manifest = single_action_path if FileTest.exist?(single_action_path)
120
- manifest = indexed_action_path if FileTest.exist?(indexed_action_path)
121
+ manifest = indexed_action_path if (indexed_action = FileTest.exist?(indexed_action_path))
121
122
 
122
123
  # TODO add rspec example
123
124
  return @action_assets if manifest.nil?
124
125
 
125
126
  @action_assets = manifest.nil? ? [] : retrieve_assets_from(manifest)
126
- @action_assets << unabsolutely_pathize(manifest)
127
+ if indexed_action # auto-require assets inside action directory
128
+ @action_assets.concat(Dir["#{action_path}/#{action_name}/**/*.#{asset_extension}"].map { |ass| unabsolutely_pathize(ass) })
129
+ else
130
+ @action_assets << unabsolutely_pathize(manifest)
131
+ end
127
132
  end
128
133
 
129
134
  private
@@ -137,7 +142,7 @@ module ViewAssets
137
142
  directive = Directive.new(asset_type)
138
143
 
139
144
  Pathname.new(manifest).each_line do |line|
140
- # break if directive.ending_directive?(l) # TODO add ending_directive support
145
+ # break if directive.ending_directive?(l) # TODO: add ending_directive support
141
146
  next unless directive.legal_directive?(line)
142
147
 
143
148
  assets.concat(analyze(*directive.parse(line)))
@@ -203,6 +208,7 @@ module ViewAssets
203
208
  # .concat(all_assets_in_manifest_dir)
204
209
  # .concat([unabsolutely_pathize(real_manifest)])
205
210
  # .uniq
211
+ # TODO add specs for dependent assets sequence
206
212
  retrieve_assets_from(real_manifest).flatten
207
213
  .concat(all_assets_in_manifest_dir)
208
214
  .uniq
@@ -1,3 +1,3 @@
1
1
  module ViewAssets
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -1669,3 +1669,93 @@ Connecting to database specified by database.yml
1669
1669
  Processing by FooController#index as HTML
1670
1670
  Rendered foo/index.html.erb within layouts/application (2.6ms)
1671
1671
  Completed 200 OK in 18ms (Views: 17.2ms | ActiveRecord: 0.0ms)
1672
+
1673
+
1674
+ Started GET "/orders/index" for 127.0.0.1 at 2013-02-02 23:21:50 +0800
1675
+ Connecting to database specified by database.yml
1676
+
1677
+ ActionController::RoutingError (No route matches [GET] "/orders/index"):
1678
+ actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
1679
+ actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
1680
+ railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
1681
+ railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
1682
+ actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
1683
+ rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
1684
+ rack (1.4.1) lib/rack/runtime.rb:17:in `call'
1685
+ activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
1686
+ rack (1.4.1) lib/rack/lock.rb:15:in `call'
1687
+ actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
1688
+ railties (3.2.8) lib/rails/engine.rb:479:in `call'
1689
+ railties (3.2.8) lib/rails/application.rb:223:in `call'
1690
+ rack (1.4.1) lib/rack/content_length.rb:14:in `call'
1691
+ railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in `call'
1692
+ rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
1693
+ /Users/bom_d_van/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
1694
+ /Users/bom_d_van/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
1695
+ /Users/bom_d_van/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
1696
+
1697
+
1698
+ Rendered /Users/bom_d_van/.rvm/gems/ruby-1.9.3-p362/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (2.3ms)
1699
+
1700
+
1701
+ Started GET "/bar/index" for 127.0.0.1 at 2013-02-02 23:22:02 +0800
1702
+ Processing by BarController#index as HTML
1703
+ Rendered bar/index.html.erb within layouts/application (0.3ms)
1704
+ Completed 200 OK in 4ms (Views: 3.9ms | ActiveRecord: 0.0ms)
1705
+
1706
+
1707
+ Started GET "/foo/index" for 127.0.0.1 at 2013-02-02 23:23:11 +0800
1708
+ Processing by FooController#index as HTML
1709
+ Rendered foo/index.html.erb within layouts/application (0.3ms)
1710
+ Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)
1711
+
1712
+
1713
+ Started GET "/foo/index" for 127.0.0.1 at 2013-02-03 23:07:41 +0800
1714
+ Connecting to database specified by database.yml
1715
+ Processing by FooController#index as HTML
1716
+ Rendered foo/index.html.erb within layouts/application (5.3ms)
1717
+ Completed 200 OK in 92ms (Views: 91.6ms | ActiveRecord: 0.0ms)
1718
+
1719
+
1720
+ Started GET "/foo/index" for 127.0.0.1 at 2013-02-03 23:09:08 +0800
1721
+ Connecting to database specified by database.yml
1722
+ Processing by FooController#index as HTML
1723
+ Rendered foo/index.html.erb within layouts/application (1.7ms)
1724
+ Completed 200 OK in 13ms (Views: 12.3ms | ActiveRecord: 0.0ms)
1725
+
1726
+
1727
+ Started GET "/foo/index" for 127.0.0.1 at 2013-02-03 23:09:09 +0800
1728
+ Processing by FooController#index as HTML
1729
+ Rendered foo/index.html.erb within layouts/application (0.0ms)
1730
+ Completed 200 OK in 3ms (Views: 2.9ms | ActiveRecord: 0.0ms)
1731
+
1732
+
1733
+ Started GET "/bar/index" for 127.0.0.1 at 2013-02-03 23:09:47 +0800
1734
+ Processing by BarController#index as HTML
1735
+ Rendered bar/index.html.erb within layouts/application (0.3ms)
1736
+ Completed 200 OK in 5ms (Views: 4.2ms | ActiveRecord: 0.0ms)
1737
+
1738
+
1739
+ Started GET "/bar/index" for 127.0.0.1 at 2013-02-03 23:10:19 +0800
1740
+ Connecting to database specified by database.yml
1741
+ Processing by BarController#index as HTML
1742
+ Rendered bar/index.html.erb within layouts/application (1.9ms)
1743
+ Completed 200 OK in 13ms (Views: 12.7ms | ActiveRecord: 0.0ms)
1744
+
1745
+
1746
+ Started GET "/bar/index" for 127.0.0.1 at 2013-02-03 23:10:20 +0800
1747
+ Processing by BarController#index as HTML
1748
+ Rendered bar/index.html.erb within layouts/application (0.0ms)
1749
+ Completed 200 OK in 27ms (Views: 26.8ms | ActiveRecord: 0.0ms)
1750
+
1751
+
1752
+ Started GET "/bar/index" for 127.0.0.1 at 2013-02-03 23:10:21 +0800
1753
+ Processing by BarController#index as HTML
1754
+ Rendered bar/index.html.erb within layouts/application (0.0ms)
1755
+ Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)
1756
+
1757
+
1758
+ Started GET "/bar/index" for 127.0.0.1 at 2013-02-03 23:11:41 +0800
1759
+ Processing by BarController#index as HTML
1760
+ Rendered bar/index.html.erb within layouts/application (0.0ms)
1761
+ Completed 200 OK in 4ms (Views: 4.3ms | ActiveRecord: 0.0ms)
@@ -0,0 +1 @@
1
+ //= require_lib lib3
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-05 00:00:00.000000000 Z
12
+ date: 2013-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -118,6 +118,8 @@ files:
118
118
  - test/dummy/public/favicon.ico
119
119
  - test/dummy/public/lib/javascripts/lib1.js
120
120
  - test/dummy/public/lib/javascripts/lib2.js
121
+ - test/dummy/public/lib/javascripts/lib3/index.js
122
+ - test/dummy/public/lib/javascripts/lib3/other.js
121
123
  - test/dummy/public/lib/stylesheets/lib1.css
122
124
  - test/dummy/public/lib/stylesheets/lib2.css
123
125
  - test/dummy/public/vendor/javascripts/vendor1.js
@@ -213,6 +215,8 @@ test_files:
213
215
  - test/dummy/public/favicon.ico
214
216
  - test/dummy/public/lib/javascripts/lib1.js
215
217
  - test/dummy/public/lib/javascripts/lib2.js
218
+ - test/dummy/public/lib/javascripts/lib3/index.js
219
+ - test/dummy/public/lib/javascripts/lib3/other.js
216
220
  - test/dummy/public/lib/stylesheets/lib1.css
217
221
  - test/dummy/public/lib/stylesheets/lib2.css
218
222
  - test/dummy/public/vendor/javascripts/vendor1.js