cyborg 0.3.1 → 0.3.2

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: 1965c5ca512f92930d8e71545a5cde4f7dd4f5cb
4
- data.tar.gz: 6e471c42e47edc6f1204fd4d5afd1315b103bd28
3
+ metadata.gz: e6ab06a753a8ddb98750f6759240d69f255344ac
4
+ data.tar.gz: dd6120c1de552c10c2bee391c8b722fe153e33d3
5
5
  SHA512:
6
- metadata.gz: fdd2bb3447a147dbe12d2832d39fe1f83c8607057a57619affbd30296e0bd0d980062e28259f14e2bec5a2402bd178207e1c58e36f08f2558b9af1a56c771868
7
- data.tar.gz: e7beb9c432de50056b47f383216da79fb9b7b53eb252b0934296d8cf3a7e48cad3d2ac2b5af483e5ae682e648500c90a182c169d2135eca8d6afac581137297f
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
@@ -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'
@@ -7,12 +7,10 @@ module Cyborg
7
7
  DEPENDENCIES = YAML.load %Q{
8
8
  private: true
9
9
  devDependencies:
10
- autoprefixer: ^5.2.0
11
10
  babelify: ^6.4.0
12
11
  browserify: ^11.2.0
13
12
  browserify-incremental: ^3.0.1
14
13
  minifyify: ^7.3.2
15
- postcss-cli: ^1.5.0
16
14
  svgo: ^0.5.6
17
15
  }
18
16
 
@@ -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? || plugin.maps?
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
- system "cp #{file} #{destination(file)}"
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
- system "sass #{file}:#{dest} --style #{style} --sourcemap=#{sourcemap}"
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
 
@@ -1,3 +1,3 @@
1
1
  module Cyborg
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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.1
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-07-29 00:00:00.000000000 Z
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