Skip to content

Commit 1ec02b2

Browse files
committed
Minimize Public API
* Depend on public API * Remove unnecessary `attr_reader` * Replace instance variables with private `attr_reader` invocations * Clean up documentation
1 parent 8c73c48 commit 1ec02b2

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ end
7070
Then, in the corresponding view, use the asset helpers:
7171

7272
```erb
73+
<!-- app/views/ember/index.html.erb -->
74+
7375
<%= include_ember_script_tags :frontend %>
7476
<%= include_ember_stylesheet_tags :frontend %>
7577
```

lib/ember_cli/assets/directory_asset_map.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module EmberCli
22
module Assets
33
class DirectoryAssetMap
44
def initialize(directory)
5-
@directory = Pathname(directory)
5+
@directory = Pathname.new(directory)
66
end
77

88
def to_h
@@ -12,6 +12,10 @@ def to_h
1212
}
1313
end
1414

15+
private
16+
17+
attr_reader :directory
18+
1519
def files_with_data
1620
files.reduce({}) do |manifest, file|
1721
name = File.basename(file.path)
@@ -22,10 +26,9 @@ def files_with_data
2226
end
2327
end
2428

25-
private
2629

2730
def files
28-
@directory.children.map { |path| File.new(path) }
31+
directory.children.map { |path| File.new(path) }
2932
end
3033
end
3134
end

lib/ember_cli/assets/ext/action_dispatch/routing/mapper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ module ActionDispatch
22
module Routing
33
class Mapper
44
def mount_ember_assets(app_name, to: "/")
5-
dist_directory = EmberCli[app_name].paths.dist
5+
app = EmberCli[app_name]
6+
rack_app = Rack::File.new(app.dist_path.to_s)
67

7-
mount Rack::File.new(dist_directory.to_s) => to
8+
mount rack_app => to
89
end
910
end
1011
end

lib/ember_cli/assets/lookup.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module EmberCli
66
module Assets
77
class Lookup
88
def initialize(app)
9-
@app = app
109
@paths = Paths.new(app)
1110
end
1211

@@ -20,7 +19,7 @@ def stylesheet_assets
2019

2120
private
2221

23-
attr_reader :app, :paths
22+
attr_reader :paths
2423

2524
def asset_map
2625
AssetMap.new(

0 commit comments

Comments
 (0)