cyborg 0.3.1 → 0.3.2
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 +4 -4
- data/bin/cyborg +0 -3
- data/cyborg.gemspec +1 -0
- data/lib/cyborg/command/npm.rb +0 -2
- data/lib/cyborg/plugin.rb +0 -7
- data/lib/cyborg/plugin/assets/javascripts.rb +1 -1
- data/lib/cyborg/plugin/assets/stylesheets.rb +10 -4
- data/lib/cyborg/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6ab06a753a8ddb98750f6759240d69f255344ac
|
4
|
+
data.tar.gz: dd6120c1de552c10c2bee391c8b722fe153e33d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c5efd7e1a5366435fb8b51544744658bfb71be3c4e77e16e04ec10af977805c3347407992570c5f0b0aa4e9237dff71e375dd220b67b8fc4bc755a240773f64
|
7
|
+
data.tar.gz: da535bf0c0c089b569841b2aba0b4995fc8ceb9cfaff65cf15ff2cb1653b420777f931a100ee8b2abe9ede9edebed7af26ff61e3fca40ca9a7429cfa7404366d
|
data/bin/cyborg
CHANGED
@@ -56,9 +56,6 @@ OptionParser.new do |opts|
|
|
56
56
|
options[:select_assets] = true
|
57
57
|
options[:svg] = true
|
58
58
|
end
|
59
|
-
opts.on("-m", "--maps", "Enable sourcemaps for javascript and stylesheets.") do |val|
|
60
|
-
options[:maps] = true
|
61
|
-
end
|
62
59
|
opts.on("-p", "--production", "Build assets as with production mode.") do |val|
|
63
60
|
options[:production] = true
|
64
61
|
end
|
data/cyborg.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_runtime_dependency 'block_helpers', '~> 0.3.3'
|
25
25
|
spec.add_runtime_dependency 'colorize'
|
26
26
|
spec.add_runtime_dependency "bundler", "~> 1.11"
|
27
|
+
spec.add_runtime_dependency "autoprefixer-rails", "~> 6.3"
|
27
28
|
|
28
29
|
spec.add_runtime_dependency "rails", "~> 4"
|
29
30
|
spec.add_dependency 'rack-cors'
|
data/lib/cyborg/command/npm.rb
CHANGED
data/lib/cyborg/plugin.rb
CHANGED
@@ -6,7 +6,6 @@ module Cyborg
|
|
6
6
|
def initialize(options)
|
7
7
|
@name = options.delete(:engine).downcase
|
8
8
|
@gem = Gem.loaded_specs[options.delete(:gem)]
|
9
|
-
@maps = false
|
10
9
|
config(options)
|
11
10
|
expand_asset_paths
|
12
11
|
|
@@ -66,16 +65,11 @@ module Cyborg
|
|
66
65
|
assets
|
67
66
|
end
|
68
67
|
|
69
|
-
def maps?
|
70
|
-
@maps == true
|
71
|
-
end
|
72
|
-
|
73
68
|
def svgs?
|
74
69
|
@svgs.icons.nil?
|
75
70
|
end
|
76
71
|
|
77
72
|
def build(options={})
|
78
|
-
@maps = options[:maps] || Cyborg.production?
|
79
73
|
# TODO: be sure gem builds use a clean asset_path
|
80
74
|
#FileUtils.rm_rf(root) if Cyborg.production?
|
81
75
|
FileUtils.mkdir_p(asset_path)
|
@@ -88,7 +82,6 @@ module Cyborg
|
|
88
82
|
end
|
89
83
|
|
90
84
|
def watch(options)
|
91
|
-
@maps = options[:maps] || Cyborg.production?
|
92
85
|
assets(options).map(&:watch)
|
93
86
|
end
|
94
87
|
|
@@ -42,7 +42,7 @@ module Cyborg
|
|
42
42
|
"browserifyinc --cachefile #{cache_file(File.basename(dest))} #{file} #{options}"
|
43
43
|
end
|
44
44
|
|
45
|
-
if Cyborg.production?
|
45
|
+
if Cyborg.production?
|
46
46
|
cmd += " -p [ minifyify --map #{url(file).sub(/\.js$/,'')}.map.json --output #{dest}.map.json ]"
|
47
47
|
end
|
48
48
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'sass'
|
2
|
+
require "autoprefixer-rails"
|
3
|
+
|
1
4
|
module Cyborg
|
2
5
|
module Assets
|
3
6
|
class Stylesheets < AssetType
|
@@ -27,19 +30,22 @@ module Cyborg
|
|
27
30
|
end
|
28
31
|
|
29
32
|
def build_css(file)
|
30
|
-
|
33
|
+
css = AutoprefixerRails.process(File.read(file)).css
|
34
|
+
File.open(destination(file), 'w') { |io| io.write(css) }
|
35
|
+
|
31
36
|
compress(destination(file))
|
32
37
|
end
|
33
38
|
|
34
39
|
def build_sass(file)
|
35
40
|
style = Cyborg.production? ? "compressed" : 'nested'
|
36
|
-
sourcemap = plugin.maps? ? 'auto' : 'none'
|
37
41
|
|
38
42
|
dest = destination(file)
|
39
43
|
|
40
|
-
|
44
|
+
css = Sass.compile_file(file, style: style)
|
45
|
+
css = AutoprefixerRails.process(css).css
|
46
|
+
|
47
|
+
File.open(dest, 'w') { |io| io.write(css) }
|
41
48
|
|
42
|
-
npm_command "postcss --use autoprefixer #{dest} -o #{dest}"
|
43
49
|
compress(dest)
|
44
50
|
end
|
45
51
|
|
data/lib/cyborg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyborg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.11'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: autoprefixer-rails
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '6.3'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '6.3'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rails
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|