middleman-asset-http-prefix 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 350137f1cbf7c874293bef27e8905d767c74f43f
4
+ data.tar.gz: a7150ae042e2cc512635cc0ba116f7ee78826588
5
+ SHA512:
6
+ metadata.gz: 05dcf162853b1af741af1077dfba3485cf8277f2eff72bb15b820ea6b4b5fcab8501f542a6f0833c85fb9df717ea417f51beb3fe2898d151c2f387b0aa107839
7
+ data.tar.gz: 3f2aaae2d889c3c6e2b0055690051c311613db4730302b767ba43c6029986ceff7b524c877246413abb3919ded019dc7f311782ef27c6b1d7776475d1ecbf0b0
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ # Ignore bundler lock file
2
+ /Gemfile.lock
3
+
4
+ # Ignore pkg folder
5
+ /pkg
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ # If you do not have OpenSSL installed, update
2
+ # the following line to use "http://" instead
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in middleman-asset-http-prefix.gemspec
6
+ gemspec
7
+
8
+ group :development do
9
+ gem 'rake'
10
+ gem 'rdoc'
11
+ gem 'yard'
12
+ end
13
+
14
+ group :test do
15
+ gem 'cucumber'
16
+ gem 'aruba'
17
+ gem 'rspec'
18
+ end
data/README.md ADDED
@@ -0,0 +1 @@
1
+ # middleman-asset-http-prefix
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'cucumber/rake/task'
5
+
6
+ Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
7
+ t.cucumber_opts = "--color --tags ~@wip --strict"
8
+ end
9
+
10
+ require 'rake/clean'
11
+
12
+ task test: ['cucumber']
13
+
14
+ task default: :test
@@ -0,0 +1,4 @@
1
+ PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
+ require 'middleman-core'
3
+ require 'middleman-core/step_definitions'
4
+ require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-asset-http-prefix')
@@ -0,0 +1,24 @@
1
+ # Require core library
2
+ require 'middleman-core'
3
+
4
+ # Extension namespace
5
+ class AssetHttpPrefix < ::Middleman::Extension
6
+ helpers do
7
+ def asset_url(path, prefix = '', **options)
8
+ begin
9
+ original_output = super
10
+ rescue
11
+ original_output = super(path, prefix)
12
+ end
13
+
14
+ if config[:asset_http_prefix]
15
+ original_output.sub(
16
+ /^#{Regexp.escape(config[:http_prefix])}/, config[:asset_http_prefix])
17
+ else
18
+ original_output
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ AssetHttpPrefix.register(:asset_http_prefix)
@@ -0,0 +1 @@
1
+ require 'middleman-asset-http-prefix'
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'middleman-asset-http-prefix'
6
+ s.version = '0.0.1'
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ['Ryan Mark']
9
+ s.email = ['ryan@mrk.cc']
10
+ s.homepage = 'https://github.com/ryanmark/middleman-asset-http-prefix'
11
+ s.summary = 'Middleman extension for putting assets at a different http prefix'
12
+ # s.description = %q{A longer description of your extension}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.require_paths = ['lib']
17
+
18
+ # The version of middleman-core your extension depends on
19
+ s.add_runtime_dependency('middleman-core', ['>= 3.4.0'])
20
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: middleman-asset-http-prefix
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Mark
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: middleman-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.4.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.4.0
27
+ description:
28
+ email:
29
+ - ryan@mrk.cc
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - README.md
37
+ - Rakefile
38
+ - features/support/env.rb
39
+ - lib/middleman-asset-http-prefix.rb
40
+ - lib/middleman_extension.rb
41
+ - middleman-asset-http-prefix.gemspec
42
+ homepage: https://github.com/ryanmark/middleman-asset-http-prefix
43
+ licenses: []
44
+ metadata: {}
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubyforge_project:
61
+ rubygems_version: 2.4.5
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: Middleman extension for putting assets at a different http prefix
65
+ test_files:
66
+ - features/support/env.rb