embork 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/embork/builder.rb +1 -1
- data/lib/embork/extension.rb +25 -0
- data/lib/embork/sprockets/helpers.rb +3 -3
- data/lib/embork/version.rb +1 -1
- data/spec/embork/sprockets/helper_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7a3dc2d7ad2150b084ce2c27a7e5614499960e0
|
4
|
+
data.tar.gz: d6393eb0b361c354101b206c108c01e551f7c47b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97a58839b957d3488104b7580f95c6f0a8ea8920d1ffb8ae7ab3b34915fbb87c856aac37facc60a60cdbc3e3d925e25ec3a11cc67ac78fbd3cd4263114cf9861
|
7
|
+
data.tar.gz: d8a0cdb1aeae8f8f8fbf21ab3e92ebf40c445bf0beede16f25774c64e974234f802e97383ec7c6f68010c2cc1e79e4085f69acc6558ec53d2ad7ee83b57dd119
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# 0.0.9
|
2
|
+
- Change every instance of 'bundled_version' to 'bundle_version' for
|
3
|
+
consistency.
|
4
|
+
- Add an extension class for external apps that may need erb helpers.
|
5
|
+
|
6
|
+
# 0.0.8
|
7
|
+
- Bump phrender version to 0.0.4
|
8
|
+
- Update bower depends in blueprint. Resolver and loader go up a version
|
data/lib/embork/builder.rb
CHANGED
@@ -21,7 +21,7 @@ class Embork::Builder
|
|
21
21
|
@version = Time.now.to_s.gsub(/( -|-| |:)/, '.')
|
22
22
|
|
23
23
|
@sprockets_environment.context_class.use_bundled_assets = true
|
24
|
-
@sprockets_environment.context_class.
|
24
|
+
@sprockets_environment.context_class.bundle_version = @version
|
25
25
|
|
26
26
|
Dir.chdir @project_root do
|
27
27
|
config_path = File.join 'config', Embork.env.to_s
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'embork/sprockets/helpers'
|
2
|
+
require 'embork/borkfile'
|
3
|
+
|
4
|
+
class Embork::Extension
|
5
|
+
def initialize(borkfile_path, bundled_assets = false, environment = nil)
|
6
|
+
@borkfile = Embork::Borkfile.new options[:borkfile], environment
|
7
|
+
@environment = environment || Embork.env || ENV['RACK_ENV']
|
8
|
+
if bundled_assets
|
9
|
+
version_file_path = File.join(@borkfile.project_root, 'build',
|
10
|
+
@environment.to_s, 'current-version')
|
11
|
+
@bundle_version = File.read(version_file_path)
|
12
|
+
@use_bundled_assets = true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def helpers
|
17
|
+
helpers = Embork::Sprockets::Helpers
|
18
|
+
if @use_bundled_assets
|
19
|
+
helpers.bundle_version = @bundle_version
|
20
|
+
helpers.use_bundled_assets = @use_bundled_assets
|
21
|
+
end
|
22
|
+
helpers
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Embork::Sprockets::Helpers
|
2
2
|
module ClassMethods
|
3
3
|
attr_accessor :use_bundled_assets
|
4
|
-
attr_accessor :
|
4
|
+
attr_accessor :bundle_version
|
5
5
|
end
|
6
6
|
|
7
7
|
def javascript_include_tag(path)
|
@@ -30,7 +30,7 @@ module Embork::Sprockets::Helpers
|
|
30
30
|
|
31
31
|
def build_version
|
32
32
|
if self.class.use_bundled_assets
|
33
|
-
self.class.
|
33
|
+
self.class.bundle_version
|
34
34
|
else
|
35
35
|
nil
|
36
36
|
end
|
@@ -69,7 +69,7 @@ module Embork::Sprockets::Helpers
|
|
69
69
|
path = File.dirname path_to_file
|
70
70
|
path = nil if path == '.'
|
71
71
|
|
72
|
-
versioned_name = "%s-%s%s" % [ base, self.class.
|
72
|
+
versioned_name = "%s-%s%s" % [ base, self.class.bundle_version, ext ]
|
73
73
|
(path.nil?) ? versioned_name : File.join(path, versioned_name)
|
74
74
|
end
|
75
75
|
|
data/lib/embork/version.rb
CHANGED
@@ -57,7 +57,7 @@ describe 'Embork::Sprockets::helpers' do
|
|
57
57
|
context 'versioned assets' do
|
58
58
|
before(:each) do
|
59
59
|
context_class.class.use_bundled_assets = true
|
60
|
-
context_class.class.
|
60
|
+
context_class.class.bundle_version = '12345abcd'
|
61
61
|
end
|
62
62
|
|
63
63
|
context '#javascript_include_tag' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mina Smart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sprockets
|
@@ -313,6 +313,7 @@ extensions: []
|
|
313
313
|
extra_rdoc_files: []
|
314
314
|
files:
|
315
315
|
- ".gitignore"
|
316
|
+
- CHANGELOG.md
|
316
317
|
- Gemfile
|
317
318
|
- LICENSE.txt
|
318
319
|
- README.md
|
@@ -368,6 +369,7 @@ files:
|
|
368
369
|
- lib/embork/builder.rb
|
369
370
|
- lib/embork/cli.rb
|
370
371
|
- lib/embork/environment.rb
|
372
|
+
- lib/embork/extension.rb
|
371
373
|
- lib/embork/forwarder.rb
|
372
374
|
- lib/embork/generator.rb
|
373
375
|
- lib/embork/logger.rb
|