skyfire 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.npmignore +8 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +36 -0
- data/Rakefile +6 -0
- data/bin/assets/css/build.sh +4 -0
- data/bin/assets/includes/common.sh +6 -0
- data/bin/assets/js/build-debug.sh +2 -0
- data/bin/assets/js/build-dist.sh +1 -0
- data/bin/assets/js/build-min.sh +1 -0
- data/bin/assets/js/build.sh +5 -0
- data/bin/assets/skyfire +12 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/index.js +0 -0
- data/lib/generators/skyfire/install/install_generator.rb +17 -0
- data/lib/generators/skyfire/install/templates/package.json +10 -0
- data/lib/skyfire/asset_manifest.rb +35 -0
- data/lib/skyfire/assets_helper.rb +38 -0
- data/lib/skyfire/version.rb +3 -0
- data/lib/skyfire.rb +7 -0
- data/package.json +26 -0
- data/skyfire.gemspec +23 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2515c91100fd3b1c8346ade82c53084bfaf96af6
|
4
|
+
data.tar.gz: 2e0ce80fe5d792560353fde338c8f0d81ee56d42
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9ca23ce0105c89129fceedff9c2bf92bcf9dd1b882cc103a7b913af3e3596c666e79bbce4c59bac211f7f1da79a6683bdde21c2fb3a881231fd9f691eed83fc1
|
7
|
+
data.tar.gz: 1cdc1c9c6b21ab65b5214f09ddc0d2fb6ba2b223f9934d2cfce6dbf7c93c504a604e8e86ba8e9667072a217b9c3fd48fd26a1141518272382610f8aed2a3b176
|
data/.gitignore
ADDED
data/.npmignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Npm::Assets
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/npm/assets`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'skyfire'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install skyfire
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/skyfire.
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
#!/usr/bin/env bash
|
@@ -0,0 +1 @@
|
|
1
|
+
#!/usr/bin/env bash
|
data/bin/assets/skyfire
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env bash -e
|
2
|
+
export ROOT_PATH=$(git rev-parse --show-toplevel)
|
3
|
+
export ASSETS_PATH=${ROOT_PATH}/assets
|
4
|
+
export JAVASCRIPTS_PATH=${ASSETS_PATH}/javascripts
|
5
|
+
export CSS_PATH=${ASSETS_PATH}/stylesheets
|
6
|
+
export DIST_PATH=${ROOT_PATH}/public/vendor
|
7
|
+
|
8
|
+
BIN_DIR=$(dirname $BASH_SOURCE)
|
9
|
+
|
10
|
+
echo "Building Javascripts"
|
11
|
+
|
12
|
+
browserify -d -t babelify -g uglifyify -e ${JAVASCRIPTS_PATH}/application.js | uglifyjs --compress > ${DIST_PATH}/bundle.min.js
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "npm/assets"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/index.js
ADDED
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails/generators/base'
|
2
|
+
|
3
|
+
module Skyfire
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
desc "Copy Skyfire package manifest."
|
7
|
+
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
8
|
+
|
9
|
+
def copy_package_json
|
10
|
+
template 'package.json', 'package.json'
|
11
|
+
in_root do
|
12
|
+
run('npm install')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Skyfire
|
2
|
+
class AssetManifest
|
3
|
+
def self.manifest
|
4
|
+
if File.exists?("rev-manifest.json")
|
5
|
+
@manifest ||= JSON.parse(File.read("rev-manifest.json"))
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.stylesheet_path(url)
|
10
|
+
if AssetManifest.manifest
|
11
|
+
url += ".css" unless url.end_with?(".css")
|
12
|
+
AssetManifest.manifest[url] || url
|
13
|
+
else
|
14
|
+
url
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.javascript_path(url)
|
19
|
+
if AssetManifest.manifest
|
20
|
+
url += ".js" unless url.end_with?(".js")
|
21
|
+
AssetManifest.manifest[url] || url
|
22
|
+
else
|
23
|
+
url
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.asset_path(url)
|
28
|
+
if AssetManifest.manifest
|
29
|
+
AssetManifest.manifest[url] || url
|
30
|
+
else
|
31
|
+
url
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Skyfire
|
2
|
+
module ApplicationHelper
|
3
|
+
extend ::ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
|
7
|
+
def stylesheet_link_tag(url, options={})
|
8
|
+
url = Npm::Assets::AssetManifest.stylesheet_path(url)
|
9
|
+
|
10
|
+
super(url, options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def crossorigin_javascript_include_tag(url, options={})
|
14
|
+
url = Npm::Assets::AssetManifest.javascript_path(url)
|
15
|
+
|
16
|
+
super(url, options)
|
17
|
+
end
|
18
|
+
|
19
|
+
def image_tag(url, options={})
|
20
|
+
url = AssetManifest.asset_path(url)
|
21
|
+
|
22
|
+
super(url, options)
|
23
|
+
end
|
24
|
+
|
25
|
+
def image_path(url, options={})
|
26
|
+
url = Npm::Assets::AssetManifest.asset_path(url)
|
27
|
+
|
28
|
+
super(url, options)
|
29
|
+
end
|
30
|
+
|
31
|
+
def image_url(url, options={})
|
32
|
+
url = Npm::Assets::AssetManifest.asset_path(url)
|
33
|
+
|
34
|
+
super((ActionController::Base.asset_host || "") + url, options)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/skyfire.rb
ADDED
data/package.json
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"name": "skyfire",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "NPM rails assets pipeline CLI",
|
5
|
+
"main": "index.js",
|
6
|
+
"bin": {
|
7
|
+
"skyfire" : "bin/assets/skyfire"
|
8
|
+
},
|
9
|
+
"scripts": {
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
11
|
+
},
|
12
|
+
"dependencies": {
|
13
|
+
"babelify": "^6.1.3",
|
14
|
+
"browserify": "^11.0.0",
|
15
|
+
"nodemon": "^1.3.8",
|
16
|
+
"uglify-js": "^2.4.23",
|
17
|
+
"uglifyify": "^3.0.1",
|
18
|
+
"node-sass": "^3.2.0"
|
19
|
+
},
|
20
|
+
"author": "",
|
21
|
+
"license": "ISC",
|
22
|
+
"bugs": {
|
23
|
+
"url": "https://github.com/jobready/skyfire/issues"
|
24
|
+
},
|
25
|
+
"homepage": "https://github.com/jobready/skyfire#readme"
|
26
|
+
}
|
data/skyfire.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'skyfire/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "skyfire"
|
8
|
+
spec.version = Skyfire::VERSION
|
9
|
+
spec.authors = ["Andrew McNamara"]
|
10
|
+
spec.email = ["andrewm@jobready.com.au"]
|
11
|
+
|
12
|
+
spec.summary = %q{Rails asset pipeline replacement}
|
13
|
+
spec.description = %q{Rails asset pipeline replacement.}
|
14
|
+
spec.homepage = "https://github.com/jobready/skyfire"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
21
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
spec.add_development_dependency "rspec"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: skyfire
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrew McNamara
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Rails asset pipeline replacement.
|
56
|
+
email:
|
57
|
+
- andrewm@jobready.com.au
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".npmignore"
|
64
|
+
- ".rspec"
|
65
|
+
- ".travis.yml"
|
66
|
+
- Gemfile
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- bin/assets/css/build.sh
|
70
|
+
- bin/assets/includes/common.sh
|
71
|
+
- bin/assets/js/build-debug.sh
|
72
|
+
- bin/assets/js/build-dist.sh
|
73
|
+
- bin/assets/js/build-min.sh
|
74
|
+
- bin/assets/js/build.sh
|
75
|
+
- bin/assets/skyfire
|
76
|
+
- bin/console
|
77
|
+
- bin/setup
|
78
|
+
- index.js
|
79
|
+
- lib/generators/skyfire/install/install_generator.rb
|
80
|
+
- lib/generators/skyfire/install/templates/package.json
|
81
|
+
- lib/skyfire.rb
|
82
|
+
- lib/skyfire/asset_manifest.rb
|
83
|
+
- lib/skyfire/assets_helper.rb
|
84
|
+
- lib/skyfire/version.rb
|
85
|
+
- package.json
|
86
|
+
- skyfire.gemspec
|
87
|
+
homepage: https://github.com/jobready/skyfire
|
88
|
+
licenses: []
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
requirements: []
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 2.2.2
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: Rails asset pipeline replacement
|
110
|
+
test_files: []
|
111
|
+
has_rdoc:
|