maglove 0.7.0 → 0.7.1

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: c4e2e9a781d18a64e7f141302d3ecfe1b290d6f4
4
- data.tar.gz: 8df539bc813f9a445c5e611bad09b169a4fdd06c
3
+ metadata.gz: bce86c531503d256e0dc73e065011c64a173b0ec
4
+ data.tar.gz: c108429a7d25c0a4ae306306c2c215fdc362a176
5
5
  SHA512:
6
- metadata.gz: c4516a01d653724481049490caa3ff5f5b3f4e67878520e9b0ca5b2f7dc9af6df15a6a0fe90b3df49d08264d6f23c2dcf723cacfb61af40fae242147aad1e82f
7
- data.tar.gz: 0f96c25155e090f5b849456827309e0a7be10f6e345983a00999139f875108354aa0071a8ef4c0136f1480e3002005db19e1d61a9ac42e70a061776efbcc3540
6
+ metadata.gz: 809d81a5786404b84fd67495dfbb2a8f3ecd98dee200aafd1e9e961f101c4de90ac720dd85925deaad68cd2599647a5a7cb6d4d2f4f0d9a16e4c9adcb4d108b7
7
+ data.tar.gz: 027e7542acd94948f05786eb2ef6ea2a1897ec210e9726ba53bab282ebab71c6ef49c0e395a43f5e37a76932a3e2bd34959bf9146fda99408335af7ad82e5771
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maglove (0.7.0)
5
- activesupport (~> 4.2)
4
+ maglove (0.7.1)
5
+ actionpack (~> 5.0)
6
+ activesupport (~> 5.0)
6
7
  bundler (~> 1.10)
7
8
  coffee-script (~> 2.4)
8
9
  commander (~> 4.3)
@@ -24,15 +25,28 @@ PATH
24
25
  GEM
25
26
  remote: https://rubygems.org/
26
27
  specs:
27
- activesupport (4.2.7)
28
+ actionpack (5.0.0)
29
+ actionview (= 5.0.0)
30
+ activesupport (= 5.0.0)
31
+ rack (~> 2.0)
32
+ rack-test (~> 0.6.3)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
35
+ actionview (5.0.0)
36
+ activesupport (= 5.0.0)
37
+ builder (~> 3.1)
38
+ erubis (~> 2.7.0)
39
+ rails-dom-testing (~> 2.0)
40
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
41
+ activesupport (5.0.0)
42
+ concurrent-ruby (~> 1.0, >= 1.0.2)
28
43
  i18n (~> 0.7)
29
- json (~> 1.7, >= 1.7.7)
30
44
  minitest (~> 5.1)
31
- thread_safe (~> 0.3, >= 0.3.4)
32
45
  tzinfo (~> 1.1)
33
46
  ast (2.1.0)
34
47
  astrolabe (1.3.1)
35
48
  parser (~> 2.2)
49
+ builder (3.2.2)
36
50
  coderay (1.1.0)
37
51
  coffee-script (2.4.1)
38
52
  coffee-script-source
@@ -41,13 +55,15 @@ GEM
41
55
  commander (4.4.0)
42
56
  highline (~> 1.7.2)
43
57
  commonjs (0.2.7)
58
+ concurrent-ruby (1.0.2)
44
59
  diff-lcs (1.2.5)
45
60
  dotenv (2.1.1)
61
+ erubis (2.7.0)
46
62
  execjs (2.7.0)
47
- exifr (1.2.4)
63
+ exifr (1.2.5)
48
64
  filewatcher (0.5.3)
49
65
  trollop (~> 2.0)
50
- fspath (2.1.1)
66
+ fspath (3.0.0)
51
67
  haml (4.0.7)
52
68
  tilt
53
69
  hamloft (0.1.8)
@@ -55,18 +71,17 @@ GEM
55
71
  nokogiri (~> 1.6)
56
72
  highline (1.7.8)
57
73
  i18n (0.7.0)
58
- image_optim (0.22.1)
74
+ image_optim (0.23.0)
59
75
  exifr (~> 1.2, >= 1.2.2)
60
- fspath (~> 2.1)
76
+ fspath (~> 3.0)
61
77
  image_size (~> 1.3)
62
78
  in_threads (~> 1.3)
63
79
  progress (~> 3.0, >= 3.0.1)
64
- image_optim_pack (0.2.1.20160510)
65
- fspath (~> 2.1)
80
+ image_optim_pack (0.3.0)
81
+ fspath (>= 2.1, < 4)
66
82
  image_optim (~> 0.19)
67
83
  image_size (1.4.2)
68
84
  in_threads (1.3.1)
69
- json (1.8.3)
70
85
  less (2.6.0)
71
86
  commonjs (~> 0.2.7)
72
87
  libv8 (3.16.14.15)
@@ -74,6 +89,8 @@ GEM
74
89
  logging (2.1.0)
75
90
  little-plugger (~> 1.1)
76
91
  multi_json (~> 1.10)
92
+ loofah (2.0.3)
93
+ nokogiri (>= 1.5.9)
77
94
  method_source (0.8.2)
78
95
  mini_portile2 (2.1.0)
79
96
  minitar (0.5.4)
@@ -86,11 +103,19 @@ GEM
86
103
  ast (>= 1.1, < 3.0)
87
104
  pkg-config (1.1.7)
88
105
  powerpack (0.1.1)
89
- progress (3.1.1)
106
+ progress (3.2.2)
90
107
  pry (0.10.3)
91
108
  coderay (~> 1.1.0)
92
109
  method_source (~> 0.8.1)
93
110
  slop (~> 3.4)
111
+ rack (2.0.1)
112
+ rack-test (0.6.3)
113
+ rack (>= 1.0)
114
+ rails-dom-testing (2.0.1)
115
+ activesupport (>= 4.2.0, < 6.0)
116
+ nokogiri (~> 1.6.0)
117
+ rails-html-sanitizer (1.0.3)
118
+ loofah (~> 2.0)
94
119
  rainbow (2.0.0)
95
120
  ref (2.0.0)
96
121
  rspec (3.3.0)
data/bin/maglove CHANGED
@@ -8,7 +8,7 @@ Dotenv.load
8
8
  # Set up Hamloft
9
9
  Hamloft.register_template(:tumblr, MagLove::Template::Tumblr)
10
10
  Tilt.mappings["haml"] = [MagLove::Tilt::HamlTemplate]
11
- Tilt.mappings["sass"] = [MagLove::Tilt::SassTemplate]
11
+ Tilt.mappings["scss"] = [MagLove::Tilt::ScssTemplate]
12
12
  Tilt.mappings["less"] = [MagLove::Tilt::LessTemplate]
13
13
  Tilt.mappings["yml"] = [MagLove::Tilt::YamlTemplate]
14
14
  Tilt.mappings["coffee"] = [MagLove::Tilt::CoffeeTemplate]
@@ -7,7 +7,7 @@ module MagLove
7
7
 
8
8
  task :compile, theme: ENV["THEME"], sync: "NO", bucket: "localhost:3002" do |args, options|
9
9
  info("▸ compiling theme #{options.theme}")
10
- invoke_tasks(["core:validate", "core:clean", "compile:coffee", "compile:css", "compile:yaml", "compile:templates", "copy:base_images", "copy:images", "copy:thumbs", "compress:theme"], options)
10
+ invoke_tasks(["core:validate", "core:clean", "compile:coffee", "copy:base_images", "copy:images", "compile:css", "compile:yaml", "compile:templates", "copy:thumbs", "compress:theme"], options)
11
11
 
12
12
  if options.sync == "YES"
13
13
  error!("▸ SYNC error: please specify a bucket to use (cdn.magloft.com, test-cdn.magloft.com)") if options.bucket == "localhost:3001"
@@ -0,0 +1,42 @@
1
+ module Sass::Script::Functions
2
+ def asset(url)
3
+ assert_type url, :String
4
+ Sass::Script::Value::String.new("url(\"#{::Hamloft::Options.defaults[:asset_uri]}/#{url.value}\")")
5
+ end
6
+ # declare(:asset, [:url])
7
+
8
+ def asset_data(url)
9
+ assert_type url, :String
10
+ theme = options[:locals][:theme]
11
+ asset_path = "dist/themes/#{theme}/#{url.value}"
12
+ asset_contents = File.open(asset_path).read
13
+ base64_string = Base64.strict_encode64(asset_contents)
14
+ extension = File.extname(url.value)[1..-1]
15
+ mime_type = Mime::Type.lookup_by_extension(extension).to_s
16
+ data_uri = "data:#{mime_type};base64,#{base64_string}"
17
+ Sass::Script::Value::String.new("url(#{data_uri})")
18
+ end
19
+ declare(:asset_data, [:url])
20
+ end
21
+
22
+ module MagLove
23
+ module Tilt
24
+ class ScssTemplate < ::Tilt::SassTemplate
25
+ self.default_mime_type = 'text/css'
26
+
27
+ def prepare
28
+ end
29
+
30
+ def evaluate(scope, locals, &block)
31
+ prepared_data = "@base: \"#{locals[:base_path].sub("src/", "../../")}\";\n#{data}"
32
+ engine = Sass::Engine.new(prepared_data, sass_options.merge({locals: locals}))
33
+ @output ||= engine.render
34
+ end
35
+
36
+ private
37
+ def sass_options
38
+ options.merge(:filename => eval_file, :line => line, :syntax => :scss)
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,3 +1,3 @@
1
1
  module MagLove
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
data/lib/maglove.rb CHANGED
@@ -12,6 +12,7 @@ require "coffee_script"
12
12
  require "therubyracer"
13
13
  require "less"
14
14
  require "sass"
15
+ require "action_dispatch/http/mime_type"
15
16
  require "commander"
16
17
  require "image_optim"
17
18
  require "zlib"
@@ -22,7 +23,7 @@ require "maglove/version"
22
23
  require "maglove/tilt/twig_template"
23
24
  require "maglove/tilt/haml_template"
24
25
  require "maglove/tilt/less_template"
25
- require "maglove/tilt/sass_template"
26
+ require "maglove/tilt/scss_template"
26
27
  require "maglove/tilt/coffee_template"
27
28
  require "maglove/tilt/js_template"
28
29
  require "maglove/tilt/yaml_template"
data/maglove.gemspec CHANGED
@@ -18,7 +18,8 @@ Gem::Specification.new do |s|
18
18
  s.add_runtime_dependency 'haml', "~> 4.0"
19
19
  s.add_runtime_dependency 'hamloft', "~> 0.1.7"
20
20
  s.add_runtime_dependency "rubyzip", "~> 1.1"
21
- s.add_runtime_dependency "activesupport", "~> 4.2"
21
+ s.add_runtime_dependency "activesupport", "~> 5.0"
22
+ s.add_runtime_dependency "actionpack", "~> 5.0"
22
23
  s.add_runtime_dependency "logging", "~> 2.0"
23
24
  s.add_runtime_dependency "tilt", "~> 1.4"
24
25
  s.add_runtime_dependency "coffee-script", "~> 2.4"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer
@@ -86,14 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '4.2'
89
+ version: '5.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '4.2'
96
+ version: '5.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: actionpack
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '5.0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '5.0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: logging
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -411,7 +425,7 @@ files:
411
425
  - lib/maglove/tilt/haml_template.rb
412
426
  - lib/maglove/tilt/js_template.rb
413
427
  - lib/maglove/tilt/less_template.rb
414
- - lib/maglove/tilt/sass_template.rb
428
+ - lib/maglove/tilt/scss_template.rb
415
429
  - lib/maglove/tilt/twig_template.rb
416
430
  - lib/maglove/tilt/yaml_template.rb
417
431
  - lib/maglove/version.rb
@@ -1,32 +0,0 @@
1
- module Sass::Script::Functions
2
- def asset(url)
3
- assert_type url, :String
4
- Sass::Script::Value::String.new("url(\"#{::Hamloft::Options.defaults[:asset_uri]}/#{url.value}\")")
5
- end
6
- declare(:asset, [:url])
7
- end
8
-
9
- module MagLove
10
- module Tilt
11
- class SassTemplate < ::Tilt::Template
12
- self.default_mime_type = 'theme/html'
13
-
14
- def prepare
15
- @options = options.merge({
16
- style: :nested,
17
- load_paths: [],
18
- cache: false,
19
- cache_location: nil,
20
- syntax: :sass,
21
- filesystem_importer: Sass::Importers::Filesystem
22
- })
23
- end
24
-
25
- def evaluate(scope, locals, &block)
26
- prepared_data = "@base: \"#{locals[:base_path].sub("src/", "../../")}\";\n#{data}"
27
- engine = Sass::Engine.new(prepared_data, @options)
28
- @output ||= engine.render
29
- end
30
- end
31
- end
32
- end