octopress-asset-pipeline 1.1.0 → 1.1.1

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: 8fb1495d68766f134895a4514df1881e8132540f
4
- data.tar.gz: 987fcf763524fddab67048970d9130a0e6db4ff3
3
+ metadata.gz: 60bc0ddd9493e3bda8bddd969d03ee41fa923af1
4
+ data.tar.gz: e602239f9f1cae6b17a20a8c4474b4cb7ed6fa1a
5
5
  SHA512:
6
- metadata.gz: e84e14427e76c8f18849650e639af612d98a828871411e807dca21e67e7aa9fdb0f2dbfa577915a980778865ec7a587db83017500996adc03f13ca9d6f61f784
7
- data.tar.gz: 13325ce37ebf786e541ad460aa580598d4f548ec6f2333ad2dedac898f5cd185e31d12f199d745f17e85ff793f596d1798a8cbda3e823f521319b9a56c3af526
6
+ metadata.gz: 81b371370acabfbe5d5c62d681d70f16a12b3038c441a032907ddcdcd8c7233cf64a9f4fea95756a84bfbe72ca50efcc074cda5a87355f20d071805b6ae51b8c
7
+ data.tar.gz: 5e29a2f9e986c3be0200204aa0695cd3049ba43665cd5f0a1bdbd5e10011fbbe1698a8768f5a0ec0cb644bed7a75ad0f93d4db226de2a41bee286c38787579c0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.1.1 - 2015-01-02
4
+
5
+ - Added support for reading documentation through Octopress docs
6
+
3
7
  ### 1.1.0 - 2015-01-01
4
8
 
5
9
  - Now reads configuration from _config.yml under `asset_pipeline`.
@@ -1,18 +1,16 @@
1
1
  module Octopress
2
- module Ink
3
- module LocalAssets
4
- class Coffeescript < LocalAssets::Javascript
5
- def compile
6
- ::CoffeeScript.compile(file.content)
7
- end
2
+ module AssetPipeline
3
+ class Coffeescript < Javascript
4
+ def compile
5
+ ::CoffeeScript.compile(file.content)
6
+ end
8
7
 
9
- def path
10
- Pathname.new File.join(Octopress.site.source, file.path)
11
- end
8
+ def path
9
+ Pathname.new File.join(Octopress.site.source, file.path)
10
+ end
12
11
 
13
- def destination
14
- File.join(base, filename.sub(/\.coffee/,'.js'))
15
- end
12
+ def destination
13
+ File.join(base, filename.sub(/\.coffee/,'.js'))
16
14
  end
17
15
  end
18
16
  end
@@ -1,18 +1,16 @@
1
1
  module Octopress
2
- module Ink
3
- module LocalAssets
4
- class Css < LocalAssets::Asset
5
- def media
6
- path.to_s.scan(/@(.+?)\./).flatten[0] || 'all'
7
- end
2
+ module AssetPipeline
3
+ class Css < Asset
4
+ def media
5
+ path.to_s.scan(/@(.+?)\./).flatten[0] || 'all'
6
+ end
8
7
 
9
- def destination
10
- File.join(base, filename.sub(/@(.+?)\./,'.'))
11
- end
8
+ def destination
9
+ File.join(base, filename.sub(/@(.+?)\./,'.'))
10
+ end
12
11
 
13
- def tag
14
- "<link href='#{Filters.expand_url(destination)}' media='#{media}' rel='stylesheet' type='text/css'>"
15
- end
12
+ def tag
13
+ "<link href='#{Filters.expand_url(destination)}' media='#{media}' rel='stylesheet' type='text/css'>"
16
14
  end
17
15
  end
18
16
  end
@@ -1,10 +1,8 @@
1
1
  module Octopress
2
- module Ink
3
- module LocalAssets
4
- class Javascript < LocalAssets::Asset
5
- def tag
6
- "<script src='#{Filters.expand_url(destination)}'></script>"
7
- end
2
+ module AssetPipeline
3
+ class Javascript < Asset
4
+ def tag
5
+ "<script src='#{Filters.expand_url(destination)}'></script>"
8
6
  end
9
7
  end
10
8
  end
@@ -1,38 +1,36 @@
1
1
  module Octopress
2
- module Ink
3
- module LocalAssets
4
- class Asset < Ink::Assets::Asset
5
- def initialize(plugin, file)
6
- @plugin = plugin
7
- @file = file
8
- end
9
-
10
- def info
11
- message = filename.ljust(35)
12
- message += "from: #{base}"
13
- " - #{message}"
14
- end
2
+ module AssetPipeline
3
+ class Asset < Ink::Assets::Asset
4
+ def initialize(plugin, file)
5
+ @plugin = plugin
6
+ @file = file
7
+ end
15
8
 
16
- def filename
17
- File.basename(path)
18
- end
9
+ def info
10
+ message = filename.ljust(35)
11
+ message += "from: #{base}"
12
+ " - #{message}"
13
+ end
19
14
 
20
- def base
21
- file.relative_path.sub(filename,'').sub(/^\/(.+)\/$/,'\1')
22
- end
15
+ def filename
16
+ File.basename(path)
17
+ end
23
18
 
24
- def destination
25
- File.join(base, filename)
26
- end
19
+ def base
20
+ file.relative_path.sub(filename,'').sub(/^\/(.+)\/$/,'\1')
21
+ end
27
22
 
28
- def path
29
- Pathname.new file.path
30
- end
23
+ def destination
24
+ File.join(base, filename)
25
+ end
31
26
 
32
- # Copy is unncessary with local assets
33
- #
34
- def copy(target_dir); end
27
+ def path
28
+ Pathname.new file.path
35
29
  end
30
+
31
+ # Copy is unncessary with local assets
32
+ #
33
+ def copy(target_dir); end
36
34
  end
37
35
  end
38
36
  end
@@ -1,30 +1,28 @@
1
1
  module Octopress
2
- module Ink
3
- module LocalAssets
4
- class Sass < LocalAssets::Css
5
- def ext
6
- file.ext
7
- end
2
+ module AssetPipeline
3
+ class Sass < Css
4
+ def ext
5
+ file.ext
6
+ end
8
7
 
9
- def path
10
- Pathname.new File.join(Octopress.site.source, file.path)
11
- end
8
+ def path
9
+ Pathname.new File.join(Octopress.site.source, file.path)
10
+ end
12
11
 
13
- def destination
14
- super.sub(/\.s[ca]ss$/, '.css')
15
- end
12
+ def destination
13
+ super.sub(/\.s[ca]ss$/, '.css')
14
+ end
16
15
 
17
- def add
18
- Plugins.static_files << StaticFileContent.new(compile, destination)
19
- end
16
+ def add
17
+ Ink::Plugins.static_files << Ink::StaticFileContent.new(compile, destination)
18
+ end
20
19
 
21
- def data
22
- file.data
23
- end
20
+ def data
21
+ file.data
22
+ end
24
23
 
25
- def compile
26
- PluginAssetPipeline.compile_sass(self)
27
- end
24
+ def compile
25
+ Ink::PluginAssetPipeline.compile_sass(self)
28
26
  end
29
27
  end
30
28
  end
@@ -1,7 +1,5 @@
1
1
  module Octopress
2
- module Ink
3
- module LocalAssetPipeline
4
- VERSION = "1.1.0"
5
- end
2
+ module AssetPipeline
3
+ VERSION = "1.1.1"
6
4
  end
7
5
  end
@@ -9,136 +9,141 @@ require 'octopress-asset-pipeline/assets/javascript'
9
9
  require 'octopress-asset-pipeline/assets/coffeescript'
10
10
 
11
11
  module Octopress
12
- module Ink
13
- module AssetPipeline
14
- class Plugin < Ink::Plugin
15
- def configuration
16
- {
17
- name: "Octopress Asset Pipeline",
18
- slug: "octopress-asset-pipeline",
19
- path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
20
- type: "plugin",
21
- version: Octopress::Ink::LocalAssetPipeline::VERSION,
22
- description: "Combine and compress CSS and Sass, Javascript and Coffeescript to a single fingerprinted file.",
23
- source_url: "https://github.com/octopress/asset-pipeline",
24
- local: true
25
- }
26
- end
27
-
28
- def register
29
- # Tell Jekyll to read static files and pages
30
- # This is necessary when Jekyll isn't being asked to build a site,
31
- # like when a user runs the list command to list assets
32
- #
33
- if Octopress.site.pages.empty? && Octopress.site.posts.empty?
34
- Octopress.site.read_directories
35
- end
12
+ module AssetPipeline
13
+ class Plugin < Ink::Plugin
14
+ def configuration
15
+ {
16
+ name: "Octopress Asset Pipeline",
17
+ path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
18
+ type: "plugin",
19
+ version: Octopress::AssetPipeline::VERSION,
20
+ description: "Combine and compress CSS and Sass, Javascript and Coffeescript to a single fingerprinted file.",
21
+ source_url: "https://github.com/octopress/asset-pipeline",
22
+ local: true
23
+ }
24
+ end
36
25
 
37
- add_stylesheets
38
- add_javascripts
26
+ def register
27
+ # Tell Jekyll to read static files and pages
28
+ # This is necessary when Jekyll isn't being asked to build a site,
29
+ # like when a user runs the list command to list assets
30
+ #
31
+ if ENV['OCTOPRESS_DOCS']
32
+ add_docs
33
+ else
34
+ add_files
39
35
  end
36
+ end
40
37
 
41
- def config
42
- @config ||= begin
43
- Ink.configuration['asset_pipeline'].merge({'disable' => {}})
44
- end
38
+ def add_files
39
+ if Octopress.site.pages.empty? && Octopress.site.posts.empty?
40
+ Octopress.site.read_directories
45
41
  end
46
42
 
47
- # Return stylesheets to be combined in the asset pipeline
48
- def stylesheets
49
- sort(@css.clone.concat(@sass), config['order_css'] || [])
50
- end
43
+ add_stylesheets
44
+ add_javascripts
45
+ end
51
46
 
52
- def javascripts
53
- sort(@js.clone.concat(@coffee), config['order_js'] || [])
47
+ def config
48
+ @config ||= begin
49
+ Ink.configuration['asset_pipeline'].merge({'disable' => {}})
54
50
  end
51
+ end
55
52
 
56
- private
53
+ # Return stylesheets to be combined in the asset pipeline
54
+ def stylesheets
55
+ sort(@css.clone.concat(@sass), config['order_css'] || [])
56
+ end
57
57
 
58
- def combine_js
59
- config['combine_js']
60
- end
58
+ def javascripts
59
+ sort(@js.clone.concat(@coffee), config['order_js'] || [])
60
+ end
61
61
 
62
- def combine_css
63
- config['combine_css']
64
- end
62
+ private
65
63
 
66
- def add_stylesheets
67
- add_css
68
- add_sass
64
+ def combine_js
65
+ config['combine_js']
66
+ end
69
67
 
70
- if !combine_css
71
- # Add tags for {% css_asset_tag %}
72
- stylesheets.each { |f| Plugins.add_css_tag(f.tag) }
73
- @css.clear
74
- end
68
+ def combine_css
69
+ config['combine_css']
70
+ end
71
+
72
+ def add_stylesheets
73
+ add_css
74
+ add_sass
75
75
 
76
+ if !combine_css
77
+ # Add tags for {% css_asset_tag %}
78
+ stylesheets.each { |f| Ink::Plugins.add_css_tag(f.tag) }
79
+ @css.clear
76
80
  end
77
81
 
78
- def add_javascripts
79
- add_js
80
- add_coffee
82
+ end
81
83
 
82
- if !combine_js
83
- # Add tags for {% js_asset_tag %}
84
- javascripts.each { |f| Plugins.add_js_tag(f.tag) }
85
- @js.clear
86
- @coffee.clear
87
- end
84
+ def add_javascripts
85
+ add_js
86
+ add_coffee
87
+
88
+ if !combine_js
89
+ # Add tags for {% js_asset_tag %}
90
+ javascripts.each { |f| Ink::Plugins.add_js_tag(f.tag) }
91
+ @js.clear
92
+ @coffee.clear
88
93
  end
94
+ end
89
95
 
90
- def sort(files, config)
91
- sorted = []
92
- config.each do |item|
93
- files.each do |file|
94
- sorted << files.delete(file) if file.path.to_s.include? item
95
- end
96
+ def sort(files, config)
97
+ sorted = []
98
+ config.each do |item|
99
+ files.each do |file|
100
+ sorted << files.delete(file) if file.path.to_s.include? item
96
101
  end
97
-
98
- sorted.concat files
99
102
  end
100
103
 
101
- # Finds all Sass files registered by Jekyll
102
- #
103
- def add_sass
104
- Octopress.site.pages.each do |f|
105
- if f.ext =~ /\.s[ca]ss/
106
- @sass << LocalAssets::Sass.new(self, f)
107
- Octopress.site.pages.delete(f)
108
- end
104
+ sorted.concat files
105
+ end
106
+
107
+ # Finds all Sass files registered by Jekyll
108
+ #
109
+ def add_sass
110
+ Octopress.site.pages.each do |f|
111
+ if f.ext =~ /\.s[ca]ss/
112
+ @sass << Sass.new(self, f)
113
+ Octopress.site.pages.delete(f)
109
114
  end
110
115
  end
116
+ end
111
117
 
112
- # Finds all CSS files registered by Jekyll
113
- #
114
- def add_css
115
- Octopress.site.static_files.each do |f|
116
- if f.path =~ /\.css$/
117
- @css << LocalAssets::Css.new(self, f)
118
- Octopress.site.static_files.delete(f) if combine_css
119
- end
118
+ # Finds all CSS files registered by Jekyll
119
+ #
120
+ def add_css
121
+ Octopress.site.static_files.each do |f|
122
+ if f.path =~ /\.css$/
123
+ @css << Css.new(self, f)
124
+ Octopress.site.static_files.delete(f) if combine_css
120
125
  end
121
126
  end
127
+ end
122
128
 
123
- # Finds all Coffeescript files registered by Jekyll
124
- #
125
- def add_coffee
126
- Octopress.site.pages.each do |f|
127
- if f.ext =~ /\.coffee$/
128
- @coffee << LocalAssets::Coffeescript.new(self, f)
129
- Octopress.site.pages.delete(f) if combine_js
130
- end
129
+ # Finds all Coffeescript files registered by Jekyll
130
+ #
131
+ def add_coffee
132
+ Octopress.site.pages.each do |f|
133
+ if f.ext =~ /\.coffee$/
134
+ @coffee << Coffeescript.new(self, f)
135
+ Octopress.site.pages.delete(f) if combine_js
131
136
  end
132
137
  end
138
+ end
133
139
 
134
- # Finds all Javascript files registered by Jekyll
135
- #
136
- def add_js
137
- Octopress.site.static_files.each do |f|
138
- if f.path =~ /\.js$/
139
- @js << LocalAssets::Javascript.new(self, f)
140
- Octopress.site.static_files.delete(f) if combine_js
141
- end
140
+ # Finds all Javascript files registered by Jekyll
141
+ #
142
+ def add_js
143
+ Octopress.site.static_files.each do |f|
144
+ if f.path =~ /\.js$/
145
+ @js << Javascript.new(self, f)
146
+ Octopress.site.static_files.delete(f) if combine_js
142
147
  end
143
148
  end
144
149
  end
@@ -146,4 +151,4 @@ module Octopress
146
151
  end
147
152
  end
148
153
 
149
- Octopress::Ink.register_plugin(Octopress::Ink::AssetPipeline::Plugin)
154
+ Octopress::Ink.register_plugin(Octopress::AssetPipeline::Plugin)
@@ -5,7 +5,7 @@ require 'octopress-asset-pipeline/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "octopress-asset-pipeline"
8
- spec.version = Octopress::Ink::LocalAssetPipeline::VERSION
8
+ spec.version = Octopress::AssetPipeline::VERSION
9
9
  spec.authors = ["Brandon Mathis"]
10
10
  spec.email = ["brandon@imathis.com"]
11
11
  spec.summary = %q{Combine and compress CSS and Sass, Javascript and Coffeescript to a single fingerprinted file.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-asset-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis